Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: GetValidators return all validators in state validators map #512

Merged
merged 12 commits into from
Jun 18, 2023
Merged
1 change: 1 addition & 0 deletions execution/executor/transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func checkTotalCoin(t *testing.T, fee int64) {
for _, acc := range tSandbox.TestStore.Accounts {
total += acc.Balance()
}

for _, val := range tSandbox.TestStore.Validators {
total += val.Stake()
}
Expand Down
1 change: 1 addition & 0 deletions state/facade.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Facade interface {
AccountByNumber(number int32) *account.Account
ValidatorByAddress(addr crypto.Address) *validator.Validator
ValidatorByNumber(number int32) *validator.Validator
ValidatorAddresses() []crypto.Address
Params() param.Params
Close() error
Fingerprint() string
Expand Down
5 changes: 3 additions & 2 deletions state/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@ func (m *MockState) AccountByAddress(addr crypto.Address) *account.Account {
a, _ := m.TestStore.Account(addr)
return a
}

func (m *MockState) AccountByNumber(number int32) *account.Account {
a, _ := m.TestStore.AccountByNumber(number)
return a
}

func (m *MockState) ValidatorAddresses() []crypto.Address {
return m.TestStore.ValidatorAddresses()
}
func (m *MockState) ValidatorByAddress(addr crypto.Address) *validator.Validator {
v, _ := m.TestStore.Validator(addr)
return v
Expand Down
4 changes: 4 additions & 0 deletions state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,10 @@ func (st *state) AccountByNumber(number int32) *account.Account {
return acc
}

func (st *state) ValidatorAddresses() []crypto.Address {
return st.store.ValidatorAddresses()
}

func (st *state) ValidatorByAddress(addr crypto.Address) *validator.Validator {
val, err := st.store.Validator(addr)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion store/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestAccountByNumber(t *testing.T) {
func TestAccountByAddress(t *testing.T) {
setup(t)

total := util.RandInt32(100)
total := util.RandInt32(100) + 1
Ja7ad marked this conversation as resolved.
Show resolved Hide resolved
var lastAddr crypto.Address
t.Run("Add some accounts", func(t *testing.T) {
for i := int32(0); i < total; i++ {
Expand Down
1 change: 1 addition & 0 deletions store/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type Reader interface {
AccountByNumber(number int32) (*account.Account, error)
TotalAccounts() int32
HasValidator(crypto.Address) bool
ValidatorAddresses() []crypto.Address
Validator(addr crypto.Address) (*validator.Validator, error)
ValidatorByNumber(num int32) (*validator.Validator, error)
IterateValidators(consumer func(*validator.Validator) (stop bool))
Expand Down
7 changes: 7 additions & 0 deletions store/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ func (m *MockStore) HasValidator(addr crypto.Address) bool {
_, ok := m.Validators[addr]
return ok
}
func (m *MockStore) ValidatorAddresses() []crypto.Address {
addrs := make([]crypto.Address, 0, len(m.Validators))
for addr := range m.Validators {
addrs = append(addrs, addr)
}
return addrs
}
func (m *MockStore) Validator(addr crypto.Address) (*validator.Validator, error) {
v, ok := m.Validators[addr]
if ok {
Expand Down
7 changes: 7 additions & 0 deletions store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ func (s *store) HasValidator(addr crypto.Address) bool {
return s.validatorStore.hasValidator(addr)
}

func (s *store) ValidatorAddresses() []crypto.Address {
s.lk.RLock()
defer s.lk.RUnlock()

return s.validatorStore.ValidatorAddresses()
}

func (s *store) Validator(addr crypto.Address) (*validator.Validator, error) {
s.lk.Lock()
defer s.lk.Unlock()
Expand Down
8 changes: 8 additions & 0 deletions store/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ func (vs *validatorStore) hasValidator(addr crypto.Address) bool {
return ok
}

func (vs *validatorStore) ValidatorAddresses() []crypto.Address {
addrs := make([]crypto.Address, 0, len(vs.addressMap))
for addr := range vs.addressMap {
addrs = append(addrs, addr)
}
return addrs
}

func (vs *validatorStore) validator(addr crypto.Address) (*validator.Validator, error) {
val, ok := vs.addressMap[addr]
if ok {
Expand Down
31 changes: 30 additions & 1 deletion store/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,35 @@ func TestValidatorBatchSaving(t *testing.T) {
})
}

func TestValidatorAddresses(t *testing.T) {
Ja7ad marked this conversation as resolved.
Show resolved Hide resolved
setup(t)

t.Run("Add some validators", func(t *testing.T) {
for i := 0; i < 10; i++ {
val, _ := validator.GenerateTestValidator(int32(i))
tStore.UpdateValidator(val)
}
assert.NoError(t, tStore.WriteBatch())

v, err := tStore.ValidatorByNumber(5)
assert.NoError(t, err)
require.NotNil(t, v)
assert.Equal(t, v.Number(), int32(5))

v, err = tStore.ValidatorByNumber(11)
assert.Error(t, err)
assert.Nil(t, v)
})

t.Run("Get list of validator addresses", func(t *testing.T) {
tStore.Close()
store, _ := NewStore(tStore.config, 21)

vals := store.ValidatorAddresses()
assert.NotNil(t, vals)
})
}

func TestValidatorByNumber(t *testing.T) {
setup(t)

Expand Down Expand Up @@ -159,7 +188,7 @@ func TestValidatorByAddress(t *testing.T) {
func TestIterateValidators(t *testing.T) {
setup(t)

total := util.RandInt32(100)
total := util.RandInt32(100) + 1
vals1 := []hash.Hash{}
for i := int32(0); i < total; i++ {
val, _ := validator.GenerateTestValidator(i)
Expand Down
5 changes: 5 additions & 0 deletions wallet/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ func (s *blockchainServer) GetAccount(_ context.Context,
return nil, fmt.Errorf("unknown request")
}

func (s *blockchainServer) GetValidatorAddresses(_ context.Context,
_ *pactus.GetValidatorAddressesRequest) (*pactus.GetValidatorAddressesResponse, error) {
return nil, nil
}

func (s *blockchainServer) GetAccountByNumber(_ context.Context,
_ *pactus.GetAccountByNumberRequest) (*pactus.GetAccountResponse, error) {
return nil, nil
Expand Down
12 changes: 11 additions & 1 deletion www/grpc/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,23 @@ func (s *blockchainServer) GetValidator(_ context.Context,
func (s *blockchainServer) GetValidators(_ context.Context,
Ja7ad marked this conversation as resolved.
Show resolved Hide resolved
_ *pactus.GetValidatorsRequest) (*pactus.GetValidatorsResponse, error) {
validators := s.state.CommitteeValidators()
validatorsInfo := make([]*pactus.ValidatorInfo, 0)
Ja7ad marked this conversation as resolved.
Show resolved Hide resolved
validatorsInfo := make([]*pactus.ValidatorInfo, 0, len(validators))
for _, val := range validators {
validatorsInfo = append(validatorsInfo, validatorToProto(val))
}
return &pactus.GetValidatorsResponse{Validators: validatorsInfo}, nil
}

func (s *blockchainServer) GetValidatorAddresses(_ context.Context,
_ *pactus.GetValidatorAddressesRequest) (*pactus.GetValidatorAddressesResponse, error) {
addresses := s.state.ValidatorAddresses()
addressesPB := make([]string, 0, len(addresses))
for _, address := range addresses {
addressesPB = append(addressesPB, address.String())
}
return &pactus.GetValidatorAddressesResponse{Addresses: addressesPB}, nil
}

func validatorToProto(val *validator.Validator) *pactus.ValidatorInfo {
data, _ := val.Bytes()
return &pactus.ValidatorInfo{
Expand Down
15 changes: 15 additions & 0 deletions www/grpc/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,21 @@ func TestGetValidators(t *testing.T) {
assert.Nil(t, conn.Close(), "Error closing connection")
}

func TestGetValidatorAddresses(t *testing.T) {
conn, client := testBlockchainClient(t)

t.Run("should return list of validator addresses", func(t *testing.T) {
res, err := client.GetValidatorAddresses(tCtx,
&pactus.GetValidatorAddressesRequest{})

assert.NoError(t, err)
assert.NotNil(t, res)
assert.Equal(t, 2, len(res.GetAddresses()))
})

assert.Nil(t, conn.Close(), "Error closing connection")
}

func TestConsensusInfo(t *testing.T) {
conn, client := testBlockchainClient(t)

Expand Down
74 changes: 74 additions & 0 deletions www/grpc/gen/dart/blockchain.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,76 @@ class GetValidatorsRequest extends $pb.GeneratedMessage {
static GetValidatorsRequest? _defaultInstance;
}

class GetValidatorAddressesRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetValidatorAddressesRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
..hasRequiredFields = false
;

GetValidatorAddressesRequest._() : super();
factory GetValidatorAddressesRequest() => create();
factory GetValidatorAddressesRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory GetValidatorAddressesRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
GetValidatorAddressesRequest clone() => GetValidatorAddressesRequest()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
GetValidatorAddressesRequest copyWith(void Function(GetValidatorAddressesRequest) updates) => super.copyWith((message) => updates(message as GetValidatorAddressesRequest)) as GetValidatorAddressesRequest; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetValidatorAddressesRequest create() => GetValidatorAddressesRequest._();
GetValidatorAddressesRequest createEmptyInstance() => create();
static $pb.PbList<GetValidatorAddressesRequest> createRepeated() => $pb.PbList<GetValidatorAddressesRequest>();
@$core.pragma('dart2js:noInline')
static GetValidatorAddressesRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GetValidatorAddressesRequest>(create);
static GetValidatorAddressesRequest? _defaultInstance;
}

class GetValidatorAddressesResponse extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetValidatorAddressesResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'addresses')
..hasRequiredFields = false
;

GetValidatorAddressesResponse._() : super();
factory GetValidatorAddressesResponse({
$core.Iterable<$core.String>? addresses,
}) {
final _result = create();
if (addresses != null) {
_result.addresses.addAll(addresses);
}
return _result;
}
factory GetValidatorAddressesResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory GetValidatorAddressesResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
GetValidatorAddressesResponse clone() => GetValidatorAddressesResponse()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
GetValidatorAddressesResponse copyWith(void Function(GetValidatorAddressesResponse) updates) => super.copyWith((message) => updates(message as GetValidatorAddressesResponse)) as GetValidatorAddressesResponse; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetValidatorAddressesResponse create() => GetValidatorAddressesResponse._();
GetValidatorAddressesResponse createEmptyInstance() => create();
static $pb.PbList<GetValidatorAddressesResponse> createRepeated() => $pb.PbList<GetValidatorAddressesResponse>();
@$core.pragma('dart2js:noInline')
static GetValidatorAddressesResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GetValidatorAddressesResponse>(create);
static GetValidatorAddressesResponse? _defaultInstance;

@$pb.TagNumber(1)
$core.List<$core.String> get addresses => $_getList(0);
}

class GetValidatorRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetValidatorRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'address')
Expand Down Expand Up @@ -1671,6 +1741,10 @@ class BlockchainApi {
var emptyResponse = GetValidatorResponse();
return _client.invoke<GetValidatorResponse>(ctx, 'Blockchain', 'GetValidatorByNumber', request, emptyResponse);
}
$async.Future<GetValidatorAddressesResponse> getValidatorAddresses($pb.ClientContext? ctx, GetValidatorAddressesRequest request) {
var emptyResponse = GetValidatorAddressesResponse();
return _client.invoke<GetValidatorAddressesResponse>(ctx, 'Blockchain', 'GetValidatorAddresses', request, emptyResponse);
}
$async.Future<GetValidatorsResponse> getValidators($pb.ClientContext? ctx, GetValidatorsRequest request) {
var emptyResponse = GetValidatorsResponse();
return _client.invoke<GetValidatorsResponse>(ctx, 'Blockchain', 'GetValidators', request, emptyResponse);
Expand Down
22 changes: 21 additions & 1 deletion www/grpc/gen/dart/blockchain.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@ const GetValidatorsRequest$json = const {

/// Descriptor for `GetValidatorsRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getValidatorsRequestDescriptor = $convert.base64Decode('ChRHZXRWYWxpZGF0b3JzUmVxdWVzdA==');
@$core.Deprecated('Use getValidatorAddressesRequestDescriptor instead')
const GetValidatorAddressesRequest$json = const {
'1': 'GetValidatorAddressesRequest',
};

/// Descriptor for `GetValidatorAddressesRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getValidatorAddressesRequestDescriptor = $convert.base64Decode('ChxHZXRWYWxpZGF0b3JBZGRyZXNzZXNSZXF1ZXN0');
@$core.Deprecated('Use getValidatorAddressesResponseDescriptor instead')
const GetValidatorAddressesResponse$json = const {
'1': 'GetValidatorAddressesResponse',
'2': const [
const {'1': 'addresses', '3': 1, '4': 3, '5': 9, '10': 'addresses'},
],
};

/// Descriptor for `GetValidatorAddressesResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getValidatorAddressesResponseDescriptor = $convert.base64Decode('Ch1HZXRWYWxpZGF0b3JBZGRyZXNzZXNSZXNwb25zZRIcCglhZGRyZXNzZXMYASADKAlSCWFkZHJlc3Nlcw==');
@$core.Deprecated('Use getValidatorRequestDescriptor instead')
const GetValidatorRequest$json = const {
'1': 'GetValidatorRequest',
Expand Down Expand Up @@ -319,6 +336,7 @@ const $core.Map<$core.String, $core.dynamic> BlockchainServiceBase$json = const
const {'1': 'GetAccountByNumber', '2': '.pactus.GetAccountByNumberRequest', '3': '.pactus.GetAccountResponse'},
const {'1': 'GetValidator', '2': '.pactus.GetValidatorRequest', '3': '.pactus.GetValidatorResponse'},
const {'1': 'GetValidatorByNumber', '2': '.pactus.GetValidatorByNumberRequest', '3': '.pactus.GetValidatorResponse'},
const {'1': 'GetValidatorAddresses', '2': '.pactus.GetValidatorAddressesRequest', '3': '.pactus.GetValidatorAddressesResponse'},
const {'1': 'GetValidators', '2': '.pactus.GetValidatorsRequest', '3': '.pactus.GetValidatorsResponse'},
],
};
Expand Down Expand Up @@ -353,9 +371,11 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> Blockchain
'.pactus.GetValidatorRequest': GetValidatorRequest$json,
'.pactus.GetValidatorResponse': GetValidatorResponse$json,
'.pactus.GetValidatorByNumberRequest': GetValidatorByNumberRequest$json,
'.pactus.GetValidatorAddressesRequest': GetValidatorAddressesRequest$json,
'.pactus.GetValidatorAddressesResponse': GetValidatorAddressesResponse$json,
'.pactus.GetValidatorsRequest': GetValidatorsRequest$json,
'.pactus.GetValidatorsResponse': GetValidatorsResponse$json,
};

/// Descriptor for `Blockchain`. Decode as a `google.protobuf.ServiceDescriptorProto`.
final $typed_data.Uint8List blockchainServiceDescriptor = $convert.base64Decode('CgpCbG9ja2NoYWluEj0KCEdldEJsb2NrEhcucGFjdHVzLkdldEJsb2NrUmVxdWVzdBoYLnBhY3R1cy5HZXRCbG9ja1Jlc3BvbnNlEkkKDEdldEJsb2NrSGFzaBIbLnBhY3R1cy5HZXRCbG9ja0hhc2hSZXF1ZXN0GhwucGFjdHVzLkdldEJsb2NrSGFzaFJlc3BvbnNlEk8KDkdldEJsb2NrSGVpZ2h0Eh0ucGFjdHVzLkdldEJsb2NrSGVpZ2h0UmVxdWVzdBoeLnBhY3R1cy5HZXRCbG9ja0hlaWdodFJlc3BvbnNlElgKEUdldEJsb2NrY2hhaW5JbmZvEiAucGFjdHVzLkdldEJsb2NrY2hhaW5JbmZvUmVxdWVzdBohLnBhY3R1cy5HZXRCbG9ja2NoYWluSW5mb1Jlc3BvbnNlElUKEEdldENvbnNlbnN1c0luZm8SHy5wYWN0dXMuR2V0Q29uc2Vuc3VzSW5mb1JlcXVlc3QaIC5wYWN0dXMuR2V0Q29uc2Vuc3VzSW5mb1Jlc3BvbnNlEkMKCkdldEFjY291bnQSGS5wYWN0dXMuR2V0QWNjb3VudFJlcXVlc3QaGi5wYWN0dXMuR2V0QWNjb3VudFJlc3BvbnNlElMKEkdldEFjY291bnRCeU51bWJlchIhLnBhY3R1cy5HZXRBY2NvdW50QnlOdW1iZXJSZXF1ZXN0GhoucGFjdHVzLkdldEFjY291bnRSZXNwb25zZRJJCgxHZXRWYWxpZGF0b3ISGy5wYWN0dXMuR2V0VmFsaWRhdG9yUmVxdWVzdBocLnBhY3R1cy5HZXRWYWxpZGF0b3JSZXNwb25zZRJZChRHZXRWYWxpZGF0b3JCeU51bWJlchIjLnBhY3R1cy5HZXRWYWxpZGF0b3JCeU51bWJlclJlcXVlc3QaHC5wYWN0dXMuR2V0VmFsaWRhdG9yUmVzcG9uc2USTAoNR2V0VmFsaWRhdG9ycxIcLnBhY3R1cy5HZXRWYWxpZGF0b3JzUmVxdWVzdBodLnBhY3R1cy5HZXRWYWxpZGF0b3JzUmVzcG9uc2U=');
final $typed_data.Uint8List blockchainServiceDescriptor = $convert.base64Decode('CgpCbG9ja2NoYWluEj0KCEdldEJsb2NrEhcucGFjdHVzLkdldEJsb2NrUmVxdWVzdBoYLnBhY3R1cy5HZXRCbG9ja1Jlc3BvbnNlEkkKDEdldEJsb2NrSGFzaBIbLnBhY3R1cy5HZXRCbG9ja0hhc2hSZXF1ZXN0GhwucGFjdHVzLkdldEJsb2NrSGFzaFJlc3BvbnNlEk8KDkdldEJsb2NrSGVpZ2h0Eh0ucGFjdHVzLkdldEJsb2NrSGVpZ2h0UmVxdWVzdBoeLnBhY3R1cy5HZXRCbG9ja0hlaWdodFJlc3BvbnNlElgKEUdldEJsb2NrY2hhaW5JbmZvEiAucGFjdHVzLkdldEJsb2NrY2hhaW5JbmZvUmVxdWVzdBohLnBhY3R1cy5HZXRCbG9ja2NoYWluSW5mb1Jlc3BvbnNlElUKEEdldENvbnNlbnN1c0luZm8SHy5wYWN0dXMuR2V0Q29uc2Vuc3VzSW5mb1JlcXVlc3QaIC5wYWN0dXMuR2V0Q29uc2Vuc3VzSW5mb1Jlc3BvbnNlEkMKCkdldEFjY291bnQSGS5wYWN0dXMuR2V0QWNjb3VudFJlcXVlc3QaGi5wYWN0dXMuR2V0QWNjb3VudFJlc3BvbnNlElMKEkdldEFjY291bnRCeU51bWJlchIhLnBhY3R1cy5HZXRBY2NvdW50QnlOdW1iZXJSZXF1ZXN0GhoucGFjdHVzLkdldEFjY291bnRSZXNwb25zZRJJCgxHZXRWYWxpZGF0b3ISGy5wYWN0dXMuR2V0VmFsaWRhdG9yUmVxdWVzdBocLnBhY3R1cy5HZXRWYWxpZGF0b3JSZXNwb25zZRJZChRHZXRWYWxpZGF0b3JCeU51bWJlchIjLnBhY3R1cy5HZXRWYWxpZGF0b3JCeU51bWJlclJlcXVlc3QaHC5wYWN0dXMuR2V0VmFsaWRhdG9yUmVzcG9uc2USZAoVR2V0VmFsaWRhdG9yQWRkcmVzc2VzEiQucGFjdHVzLkdldFZhbGlkYXRvckFkZHJlc3Nlc1JlcXVlc3QaJS5wYWN0dXMuR2V0VmFsaWRhdG9yQWRkcmVzc2VzUmVzcG9uc2USTAoNR2V0VmFsaWRhdG9ycxIcLnBhY3R1cy5HZXRWYWxpZGF0b3JzUmVxdWVzdBodLnBhY3R1cy5HZXRWYWxpZGF0b3JzUmVzcG9uc2U=');
3 changes: 3 additions & 0 deletions www/grpc/gen/dart/blockchain.pbserver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ abstract class BlockchainServiceBase extends $pb.GeneratedService {
$async.Future<$1.GetAccountResponse> getAccountByNumber($pb.ServerContext ctx, $1.GetAccountByNumberRequest request);
$async.Future<$1.GetValidatorResponse> getValidator($pb.ServerContext ctx, $1.GetValidatorRequest request);
$async.Future<$1.GetValidatorResponse> getValidatorByNumber($pb.ServerContext ctx, $1.GetValidatorByNumberRequest request);
$async.Future<$1.GetValidatorAddressesResponse> getValidatorAddresses($pb.ServerContext ctx, $1.GetValidatorAddressesRequest request);
$async.Future<$1.GetValidatorsResponse> getValidators($pb.ServerContext ctx, $1.GetValidatorsRequest request);

$pb.GeneratedMessage createRequest($core.String method) {
Expand All @@ -38,6 +39,7 @@ abstract class BlockchainServiceBase extends $pb.GeneratedService {
case 'GetAccountByNumber': return $1.GetAccountByNumberRequest();
case 'GetValidator': return $1.GetValidatorRequest();
case 'GetValidatorByNumber': return $1.GetValidatorByNumberRequest();
case 'GetValidatorAddresses': return $1.GetValidatorAddressesRequest();
case 'GetValidators': return $1.GetValidatorsRequest();
default: throw $core.ArgumentError('Unknown method: $method');
}
Expand All @@ -54,6 +56,7 @@ abstract class BlockchainServiceBase extends $pb.GeneratedService {
case 'GetAccountByNumber': return this.getAccountByNumber(ctx, request as $1.GetAccountByNumberRequest);
case 'GetValidator': return this.getValidator(ctx, request as $1.GetValidatorRequest);
case 'GetValidatorByNumber': return this.getValidatorByNumber(ctx, request as $1.GetValidatorByNumberRequest);
case 'GetValidatorAddresses': return this.getValidatorAddresses(ctx, request as $1.GetValidatorAddressesRequest);
case 'GetValidators': return this.getValidators(ctx, request as $1.GetValidatorsRequest);
default: throw $core.ArgumentError('Unknown method: $method');
}
Expand Down
Loading