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

feat(pip): implement PIP-23 #1397

Merged
merged 21 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions util/crypto/crypto.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package crypto

import "github.com/pactus-project/pactus/crypto/bls"

func SignMessageWithPrivateKey(prv, msg string) (string, error) {
b00f marked this conversation as resolved.
Show resolved Hide resolved
prvKey, err := bls.PrivateKeyFromString(prv)
if err != nil {
return "", err
}

return prvKey.Sign([]byte(msg)).String(), nil
}

func VerifyMessage(sigStr, pubStr, msg string) bool {
sig, err := bls.SignatureFromString(sigStr)
if err != nil {
return false
}

pub, err := bls.PublicKeyFromString(pubStr)
if err != nil {
return false
}

if err := pub.Verify([]byte(msg), sig); err != nil {
ZigBalthazar marked this conversation as resolved.
Show resolved Hide resolved
return false
}

return true
}
36 changes: 36 additions & 0 deletions util/crypto/crypto_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package crypto

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestSignMessageWithPrivateKey(t *testing.T) {
msg := "pactus"
prvStr := "SECRET1PDRWTLP5PX0FAHDX39GXZJP7FKZFALML0D5U9TT9KVQHDUC99CMGQQJVK67"
invalidPrvStr := "INVSECRET1PDRWTLP5PX0FAHDX39GXZJP7FKZFALML0D5U9TT9KVQHDUC99CMGQQJVK67"
sigStr := "923d67a8624cbb7972b29328e15ec76cc846076ccf00a9e94d991c677846f334ae4ba4551396fbcd6d1cab7593baf3b7"

sig, err := SignMessageWithPrivateKey(prvStr, msg)
ZigBalthazar marked this conversation as resolved.
Show resolved Hide resolved
assert.Nil(t, err)
assert.Equal(t, sig, sigStr)

sig, err = SignMessageWithPrivateKey(invalidPrvStr, msg)
assert.NotNil(t, err)
assert.Equal(t, sig, "")
}

func TestVerifyMessage(t *testing.T) {
ZigBalthazar marked this conversation as resolved.
Show resolved Hide resolved
msg := "pactus"
pubStr := "public1p4u8hfytl2pj6l9rj0t54gxcdmna4hq52ncqkkqjf3arha5mlk3x4mzpyjkhmdl20jae7f65aamjr" +
"vqcvf4sudcapz52ctcwc8r9wz3z2gwxs38880cgvfy49ta5ssyjut05myd4zgmjqstggmetyuyg7v5jhx47a"
sigStr := "923d67a8624cbb7972b29328e15ec76cc846076ccf00a9e94d991c677846f334ae4ba4551396fbcd6d1cab7593baf3b7"
invalidSigStr := "113d67a8624cbb7972b29328e15ec76cc846076ccf00a9e94d991c677846f334ae4ba4551396fbcd6d1cab7593baf3c9"

ok := VerifyMessage(sigStr, pubStr, msg)
assert.True(t, ok)

ok = VerifyMessage(invalidSigStr, pubStr, msg)
assert.False(t, ok)
}
9 changes: 9 additions & 0 deletions wallet/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,12 @@ func (wm *Manager) AddressHistory(

return wlt.GetHistory(address), nil
}

func (wm *Manager) SignMessage(msg, password, addr, walletName string) (string, error) {
ZigBalthazar marked this conversation as resolved.
Show resolved Hide resolved
wlt, ok := wm.wallets[walletName]
if !ok {
return "", status.Errorf(codes.NotFound, "wallet is not loaded")
}

return wlt.SignMessage(msg, password, addr)
}
9 changes: 9 additions & 0 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,3 +465,12 @@ func (w *Wallet) AddTransaction(id tx.ID) error {
func (w *Wallet) GetHistory(addr string) []HistoryInfo {
return w.store.History.getAddrHistory(addr)
}

func (w *Wallet) SignMessage(msg, password, addr string) (string, error) {
ZigBalthazar marked this conversation as resolved.
Show resolved Hide resolved
prv, err := w.PrivateKey(password, addr)
if err != nil {
return "", err
}

return prv.Sign([]byte(msg)).String(), nil
}
19 changes: 19 additions & 0 deletions wallet/wallet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/pactus-project/pactus/crypto"
"github.com/pactus-project/pactus/crypto/bls"
"github.com/pactus-project/pactus/genesis"
"github.com/pactus-project/pactus/state"
"github.com/pactus-project/pactus/types/account"
Expand Down Expand Up @@ -569,3 +570,21 @@ func TestTotalBalance(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, totalBalance, acc1.Balance()+acc3.Balance())
}

func TestSignMessage(t *testing.T) {
td := setup(t)
defer td.Close()

msg := "pactus"
sigStr := "923d67a8624cbb7972b29328e15ec76cc846076ccf00a9e94d991c677846f334ae4ba4551396fbcd6d1cab7593baf3b7"
ZigBalthazar marked this conversation as resolved.
Show resolved Hide resolved

ZigBalthazar marked this conversation as resolved.
Show resolved Hide resolved
prv, _ := bls.PrivateKeyFromString(
ZigBalthazar marked this conversation as resolved.
Show resolved Hide resolved
"SECRET1PDRWTLP5PX0FAHDX39GXZJP7FKZFALML0D5U9TT9KVQHDUC99CMGQQJVK67")

err := td.wallet.ImportPrivateKey("", prv)
assert.NoError(t, err)

sig, err := td.wallet.SignMessage(msg, td.password, td.wallet.AllAccountAddresses()[0].Address)
assert.NoError(t, err)
assert.Equal(t, sig, sigStr)
}
3 changes: 3 additions & 0 deletions www/grpc/buf/grpc-gateway.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ http:

- selector: pactus.Wallet.GetTotalBalance
get: "/pactus/wallet/get_total_balance"

- selector: pactus.Wallet.SignMessage
get: "/pactus/wallet/sign_message"
140 changes: 140 additions & 0 deletions www/grpc/gen/dart/wallet.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,142 @@ class GetTotalBalanceResponse extends $pb.GeneratedMessage {
void clearTotalBalance() => clearField(2);
}

class SignMessageRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignMessageRequest', 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') ? '' : 'walletName')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'address')
..aOS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'message')
..hasRequiredFields = false
;

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

@$pb.TagNumber(1)
$core.String get walletName => $_getSZ(0);
@$pb.TagNumber(1)
set walletName($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasWalletName() => $_has(0);
@$pb.TagNumber(1)
void clearWalletName() => clearField(1);

@$pb.TagNumber(2)
$core.String get password => $_getSZ(1);
@$pb.TagNumber(2)
set password($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasPassword() => $_has(1);
@$pb.TagNumber(2)
void clearPassword() => clearField(2);

@$pb.TagNumber(3)
$core.String get address => $_getSZ(2);
@$pb.TagNumber(3)
set address($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasAddress() => $_has(2);
@$pb.TagNumber(3)
void clearAddress() => clearField(3);

@$pb.TagNumber(4)
$core.String get message => $_getSZ(3);
@$pb.TagNumber(4)
set message($core.String v) { $_setString(3, v); }
@$pb.TagNumber(4)
$core.bool hasMessage() => $_has(3);
@$pb.TagNumber(4)
void clearMessage() => clearField(4);
}

class SignMessageResponse extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignMessageResponse', 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') ? '' : 'signature')
..hasRequiredFields = false
;

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

@$pb.TagNumber(1)
$core.String get signature => $_getSZ(0);
@$pb.TagNumber(1)
set signature($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasSignature() => $_has(0);
@$pb.TagNumber(1)
void clearSignature() => clearField(1);
}

class WalletApi {
$pb.RpcClient _client;
WalletApi(this._client);
Expand Down Expand Up @@ -1243,5 +1379,9 @@ class WalletApi {
var emptyResponse = GetAddressHistoryResponse();
return _client.invoke<GetAddressHistoryResponse>(ctx, 'Wallet', 'GetAddressHistory', request, emptyResponse);
}
$async.Future<SignMessageResponse> signMessage($pb.ClientContext? ctx, SignMessageRequest request) {
var emptyResponse = SignMessageResponse();
return _client.invoke<SignMessageResponse>(ctx, 'Wallet', 'SignMessage', request, emptyResponse);
}
}

28 changes: 27 additions & 1 deletion www/grpc/gen/dart/wallet.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,29 @@ const GetTotalBalanceResponse$json = const {

/// Descriptor for `GetTotalBalanceResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getTotalBalanceResponseDescriptor = $convert.base64Decode('ChdHZXRUb3RhbEJhbGFuY2VSZXNwb25zZRIfCgt3YWxsZXRfbmFtZRgBIAEoCVIKd2FsbGV0TmFtZRIjCg10b3RhbF9iYWxhbmNlGAIgASgDUgx0b3RhbEJhbGFuY2U=');
@$core.Deprecated('Use signMessageRequestDescriptor instead')
const SignMessageRequest$json = const {
'1': 'SignMessageRequest',
'2': const [
const {'1': 'wallet_name', '3': 1, '4': 1, '5': 9, '10': 'walletName'},
const {'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'},
const {'1': 'address', '3': 3, '4': 1, '5': 9, '10': 'address'},
const {'1': 'message', '3': 4, '4': 1, '5': 9, '10': 'message'},
],
};

/// Descriptor for `SignMessageRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signMessageRequestDescriptor = $convert.base64Decode('ChJTaWduTWVzc2FnZVJlcXVlc3QSHwoLd2FsbGV0X25hbWUYASABKAlSCndhbGxldE5hbWUSGgoIcGFzc3dvcmQYAiABKAlSCHBhc3N3b3JkEhgKB2FkZHJlc3MYAyABKAlSB2FkZHJlc3MSGAoHbWVzc2FnZRgEIAEoCVIHbWVzc2FnZQ==');
@$core.Deprecated('Use signMessageResponseDescriptor instead')
const SignMessageResponse$json = const {
'1': 'SignMessageResponse',
'2': const [
const {'1': 'signature', '3': 1, '4': 1, '5': 9, '10': 'signature'},
],
};

/// Descriptor for `SignMessageResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List signMessageResponseDescriptor = $convert.base64Decode('ChNTaWduTWVzc2FnZVJlc3BvbnNlEhwKCXNpZ25hdHVyZRgBIAEoCVIJc2lnbmF0dXJl');
const $core.Map<$core.String, $core.dynamic> WalletServiceBase$json = const {
'1': 'Wallet',
'2': const [
Expand All @@ -250,6 +273,7 @@ const $core.Map<$core.String, $core.dynamic> WalletServiceBase$json = const {
const {'1': 'GetValidatorAddress', '2': '.pactus.GetValidatorAddressRequest', '3': '.pactus.GetValidatorAddressResponse'},
const {'1': 'GetNewAddress', '2': '.pactus.GetNewAddressRequest', '3': '.pactus.GetNewAddressResponse'},
const {'1': 'GetAddressHistory', '2': '.pactus.GetAddressHistoryRequest', '3': '.pactus.GetAddressHistoryResponse'},
const {'1': 'SignMessage', '2': '.pactus.SignMessageRequest', '3': '.pactus.SignMessageResponse'},
],
};

Expand All @@ -275,7 +299,9 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> WalletServ
'.pactus.GetAddressHistoryRequest': GetAddressHistoryRequest$json,
'.pactus.GetAddressHistoryResponse': GetAddressHistoryResponse$json,
'.pactus.HistoryInfo': HistoryInfo$json,
'.pactus.SignMessageRequest': SignMessageRequest$json,
'.pactus.SignMessageResponse': SignMessageResponse$json,
};

/// Descriptor for `Wallet`. Decode as a `google.protobuf.ServiceDescriptorProto`.
final $typed_data.Uint8List walletServiceDescriptor = $convert.base64Decode('CgZXYWxsZXQSSQoMQ3JlYXRlV2FsbGV0EhsucGFjdHVzLkNyZWF0ZVdhbGxldFJlcXVlc3QaHC5wYWN0dXMuQ3JlYXRlV2FsbGV0UmVzcG9uc2USTAoNUmVzdG9yZVdhbGxldBIcLnBhY3R1cy5SZXN0b3JlV2FsbGV0UmVxdWVzdBodLnBhY3R1cy5SZXN0b3JlV2FsbGV0UmVzcG9uc2USQwoKTG9hZFdhbGxldBIZLnBhY3R1cy5Mb2FkV2FsbGV0UmVxdWVzdBoaLnBhY3R1cy5Mb2FkV2FsbGV0UmVzcG9uc2USSQoMVW5sb2FkV2FsbGV0EhsucGFjdHVzLlVubG9hZFdhbGxldFJlcXVlc3QaHC5wYWN0dXMuVW5sb2FkV2FsbGV0UmVzcG9uc2USUgoPR2V0VG90YWxCYWxhbmNlEh4ucGFjdHVzLkdldFRvdGFsQmFsYW5jZVJlcXVlc3QaHy5wYWN0dXMuR2V0VG90YWxCYWxhbmNlUmVzcG9uc2USWwoSU2lnblJhd1RyYW5zYWN0aW9uEiEucGFjdHVzLlNpZ25SYXdUcmFuc2FjdGlvblJlcXVlc3QaIi5wYWN0dXMuU2lnblJhd1RyYW5zYWN0aW9uUmVzcG9uc2USXgoTR2V0VmFsaWRhdG9yQWRkcmVzcxIiLnBhY3R1cy5HZXRWYWxpZGF0b3JBZGRyZXNzUmVxdWVzdBojLnBhY3R1cy5HZXRWYWxpZGF0b3JBZGRyZXNzUmVzcG9uc2USTAoNR2V0TmV3QWRkcmVzcxIcLnBhY3R1cy5HZXROZXdBZGRyZXNzUmVxdWVzdBodLnBhY3R1cy5HZXROZXdBZGRyZXNzUmVzcG9uc2USWAoRR2V0QWRkcmVzc0hpc3RvcnkSIC5wYWN0dXMuR2V0QWRkcmVzc0hpc3RvcnlSZXF1ZXN0GiEucGFjdHVzLkdldEFkZHJlc3NIaXN0b3J5UmVzcG9uc2U=');
final $typed_data.Uint8List walletServiceDescriptor = $convert.base64Decode('CgZXYWxsZXQSSQoMQ3JlYXRlV2FsbGV0EhsucGFjdHVzLkNyZWF0ZVdhbGxldFJlcXVlc3QaHC5wYWN0dXMuQ3JlYXRlV2FsbGV0UmVzcG9uc2USTAoNUmVzdG9yZVdhbGxldBIcLnBhY3R1cy5SZXN0b3JlV2FsbGV0UmVxdWVzdBodLnBhY3R1cy5SZXN0b3JlV2FsbGV0UmVzcG9uc2USQwoKTG9hZFdhbGxldBIZLnBhY3R1cy5Mb2FkV2FsbGV0UmVxdWVzdBoaLnBhY3R1cy5Mb2FkV2FsbGV0UmVzcG9uc2USSQoMVW5sb2FkV2FsbGV0EhsucGFjdHVzLlVubG9hZFdhbGxldFJlcXVlc3QaHC5wYWN0dXMuVW5sb2FkV2FsbGV0UmVzcG9uc2USUgoPR2V0VG90YWxCYWxhbmNlEh4ucGFjdHVzLkdldFRvdGFsQmFsYW5jZVJlcXVlc3QaHy5wYWN0dXMuR2V0VG90YWxCYWxhbmNlUmVzcG9uc2USWwoSU2lnblJhd1RyYW5zYWN0aW9uEiEucGFjdHVzLlNpZ25SYXdUcmFuc2FjdGlvblJlcXVlc3QaIi5wYWN0dXMuU2lnblJhd1RyYW5zYWN0aW9uUmVzcG9uc2USXgoTR2V0VmFsaWRhdG9yQWRkcmVzcxIiLnBhY3R1cy5HZXRWYWxpZGF0b3JBZGRyZXNzUmVxdWVzdBojLnBhY3R1cy5HZXRWYWxpZGF0b3JBZGRyZXNzUmVzcG9uc2USTAoNR2V0TmV3QWRkcmVzcxIcLnBhY3R1cy5HZXROZXdBZGRyZXNzUmVxdWVzdBodLnBhY3R1cy5HZXROZXdBZGRyZXNzUmVzcG9uc2USWAoRR2V0QWRkcmVzc0hpc3RvcnkSIC5wYWN0dXMuR2V0QWRkcmVzc0hpc3RvcnlSZXF1ZXN0GiEucGFjdHVzLkdldEFkZHJlc3NIaXN0b3J5UmVzcG9uc2USRgoLU2lnbk1lc3NhZ2USGi5wYWN0dXMuU2lnbk1lc3NhZ2VSZXF1ZXN0GhsucGFjdHVzLlNpZ25NZXNzYWdlUmVzcG9uc2U=');
3 changes: 3 additions & 0 deletions www/grpc/gen/dart/wallet.pbserver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ abstract class WalletServiceBase extends $pb.GeneratedService {
$async.Future<$3.GetValidatorAddressResponse> getValidatorAddress($pb.ServerContext ctx, $3.GetValidatorAddressRequest request);
$async.Future<$3.GetNewAddressResponse> getNewAddress($pb.ServerContext ctx, $3.GetNewAddressRequest request);
$async.Future<$3.GetAddressHistoryResponse> getAddressHistory($pb.ServerContext ctx, $3.GetAddressHistoryRequest request);
$async.Future<$3.SignMessageResponse> signMessage($pb.ServerContext ctx, $3.SignMessageRequest request);

$pb.GeneratedMessage createRequest($core.String method) {
switch (method) {
Expand All @@ -37,6 +38,7 @@ abstract class WalletServiceBase extends $pb.GeneratedService {
case 'GetValidatorAddress': return $3.GetValidatorAddressRequest();
case 'GetNewAddress': return $3.GetNewAddressRequest();
case 'GetAddressHistory': return $3.GetAddressHistoryRequest();
case 'SignMessage': return $3.SignMessageRequest();
default: throw $core.ArgumentError('Unknown method: $method');
}
}
Expand All @@ -52,6 +54,7 @@ abstract class WalletServiceBase extends $pb.GeneratedService {
case 'GetValidatorAddress': return this.getValidatorAddress(ctx, request as $3.GetValidatorAddressRequest);
case 'GetNewAddress': return this.getNewAddress(ctx, request as $3.GetNewAddressRequest);
case 'GetAddressHistory': return this.getAddressHistory(ctx, request as $3.GetAddressHistoryRequest);
case 'SignMessage': return this.signMessage(ctx, request as $3.SignMessageRequest);
default: throw $core.ArgumentError('Unknown method: $method');
}
}
Expand Down
Loading
Loading