From 10cff9e78cb1c34d2b3dc325a4ffe978f56679ee Mon Sep 17 00:00:00 2001 From: Matthias <97468149+matthiasmatt@users.noreply.github.com> Date: Mon, 20 May 2024 13:29:11 +0200 Subject: [PATCH] fix: remove all stringer for proto types (#1874) * fix: remove all stringer for proto types * chore: changelog --- CHANGELOG.md | 2 + eth/account.pb.go | 26 ++-- proto/eth/types/v1/account.proto | 1 - proto/nibiru/oracle/v1/oracle.proto | 4 - proto/nibiru/sudo/v1/state.proto | 1 - proto/nibiru/tokenfactory/v1/state.proto | 1 - x/oracle/types/oracle.pb.go | 145 ++++++++++++----------- x/oracle/types/params.go | 7 -- x/oracle/types/vote.go | 26 ---- x/sudo/keeper/msg_server.go | 3 +- x/sudo/types/state.go | 7 -- x/sudo/types/state.pb.go | 41 +++---- x/tokenfactory/cli/cli_test.go | 18 +-- x/tokenfactory/keeper/genesis.go | 4 +- x/tokenfactory/keeper/genesis_test.go | 2 +- x/tokenfactory/keeper/grpc_query_test.go | 6 +- x/tokenfactory/keeper/msg_server.go | 2 +- x/tokenfactory/keeper/msg_server_test.go | 26 ++-- x/tokenfactory/keeper/store.go | 16 +-- x/tokenfactory/keeper/store_test.go | 2 +- x/tokenfactory/keeper/wasm_test.go | 14 +-- x/tokenfactory/types/state.go | 22 ++-- x/tokenfactory/types/state.pb.go | 69 +++++------ x/tokenfactory/types/state_test.go | 4 +- 24 files changed, 205 insertions(+), 244 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc02f4b98..51faa53ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#1864](https://github.com/NibiruChain/nibiru/pull/1864) - fix(ica): add ICA controller stack - [#1872](https://github.com/NibiruChain/nibiru/pull/1872) - chore(math): use cosmossdk.io/math to replace sdk types +- [#1874](https://github.com/NibiruChain/nibiru/pull/1874) - chore(proto): remove the proto stringer as per Cosmos SDK migration guidelines + #### Nibiru EVM - [#1837](https://github.com/NibiruChain/nibiru/pull/1837) - feat(eth): protos, eth types, and evm module types diff --git a/eth/account.pb.go b/eth/account.pb.go index 59f2615f3..7cea10a19 100644 --- a/eth/account.pb.go +++ b/eth/account.pb.go @@ -34,8 +34,9 @@ type EthAccount struct { CodeHash string `protobuf:"bytes,2,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty" yaml:"code_hash"` } -func (m *EthAccount) Reset() { *m = EthAccount{} } -func (*EthAccount) ProtoMessage() {} +func (m *EthAccount) Reset() { *m = EthAccount{} } +func (m *EthAccount) String() string { return proto.CompactTextString(m) } +func (*EthAccount) ProtoMessage() {} func (*EthAccount) Descriptor() ([]byte, []int) { return fileDescriptor_33844e397ad0a9a0, []int{0} } @@ -73,28 +74,27 @@ func init() { func init() { proto.RegisterFile("eth/types/v1/account.proto", fileDescriptor_33844e397ad0a9a0) } var fileDescriptor_33844e397ad0a9a0 = []byte{ - // 322 bytes of a gzipped FileDescriptorProto + // 318 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0x2d, 0xc9, 0xd0, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x49, 0x2d, 0xc9, 0xd0, 0x03, 0xcb, 0xe9, 0x95, 0x19, 0x4a, 0xc9, 0x25, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, 0x27, 0x96, 0x96, 0x64, 0xe8, 0x97, 0x19, 0x26, 0xa5, 0x96, 0x24, 0x1a, 0x82, 0x39, 0x10, 0xd5, 0x52, 0x92, 0x10, 0xf9, 0x78, 0x30, 0x4f, 0x1f, 0xc2, 0x81, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x43, 0xc4, 0x41, 0x2c, 0x88, 0xa8, - 0xd2, 0x4f, 0x46, 0x2e, 0x2e, 0xd7, 0x92, 0x0c, 0x47, 0x88, 0x9d, 0x42, 0x09, 0x5c, 0x3c, 0x49, + 0xd2, 0x57, 0x46, 0x2e, 0x2e, 0xd7, 0x92, 0x0c, 0x47, 0x88, 0x9d, 0x42, 0x09, 0x5c, 0x3c, 0x49, 0x89, 0xc5, 0xa9, 0xf1, 0x50, 0x37, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x29, 0xe8, 0x41, 0x4d, 0x02, 0xdb, 0x04, 0xb5, 0x56, 0xcf, 0x29, 0xb1, 0x38, 0x15, 0xaa, 0xcf, 0x49, 0xfa, 0xc2, 0x3d, 0x79, 0xc6, 0x4f, 0xf7, 0xe4, 0x85, 0x2b, 0x13, 0x73, 0x73, 0xac, 0x94, 0x90, 0xcd, 0x50, 0x0a, 0xe2, 0x4e, 0x42, 0xa8, 0x14, 0x32, 0xe4, 0xe2, 0x4c, 0xce, 0x4f, 0x49, 0x8d, 0xcf, 0x48, 0x2c, 0xce, 0x90, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x74, 0x12, 0xf9, 0x74, 0x4f, 0x5e, 0x00, 0xa2, - 0x11, 0x2e, 0xa5, 0x14, 0xc4, 0x01, 0x62, 0x7b, 0x24, 0x16, 0x67, 0x58, 0x85, 0x75, 0x2c, 0x90, - 0x67, 0x98, 0xb1, 0x40, 0x9e, 0xe1, 0xc5, 0x02, 0x79, 0x86, 0x53, 0x5b, 0x74, 0xdd, 0xd2, 0x33, - 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xa1, 0x5e, 0x84, 0x52, 0xba, 0xc5, 0x29, 0xd9, - 0xfa, 0x15, 0x90, 0xc0, 0x81, 0x04, 0x19, 0x36, 0x77, 0x43, 0x5d, 0xe2, 0xe9, 0x64, 0x7d, 0xe2, - 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, - 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x8a, 0x48, 0x36, 0xf8, 0x65, 0x26, 0x65, - 0x16, 0x95, 0x3a, 0x67, 0x24, 0x66, 0xe6, 0xe9, 0xe7, 0x81, 0xd9, 0xfa, 0xa9, 0x25, 0x19, 0x49, - 0x6c, 0xe0, 0xf0, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf1, 0x86, 0xa7, 0xfe, 0xbc, 0x01, - 0x00, 0x00, + 0x11, 0x2e, 0xa5, 0x14, 0xc4, 0x01, 0x62, 0x7b, 0x24, 0x16, 0x67, 0x58, 0x05, 0x75, 0x2c, 0x90, + 0x67, 0x78, 0xb1, 0x40, 0x9e, 0xe1, 0xd4, 0x16, 0x5d, 0xb7, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, + 0xbd, 0xe4, 0xfc, 0x5c, 0xa8, 0xf7, 0xa0, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, 0x24, 0x60, + 0x20, 0xc1, 0x85, 0xcd, 0xcd, 0x50, 0x57, 0x78, 0x3a, 0x59, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, + 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, + 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x22, 0x92, 0x0d, 0x7e, 0x99, 0x49, 0x99, 0x45, 0xa5, 0xce, 0x19, + 0x89, 0x99, 0x79, 0xfa, 0x79, 0x60, 0xb6, 0x7e, 0x6a, 0x49, 0x46, 0x12, 0x1b, 0x38, 0xec, 0x8c, + 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x66, 0xb4, 0x6d, 0xb8, 0x01, 0x00, 0x00, } func (m *EthAccount) Marshal() (dAtA []byte, err error) { diff --git a/proto/eth/types/v1/account.proto b/proto/eth/types/v1/account.proto index 6c750ac17..ada2d316b 100644 --- a/proto/eth/types/v1/account.proto +++ b/proto/eth/types/v1/account.proto @@ -12,7 +12,6 @@ option go_package = "github.com/NibiruChain/nibiru/eth"; // authtypes.BaseAccount type. It is compatible with the auth AccountKeeper. message EthAccount { option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = false; option (cosmos_proto.implements_interface) = "github.com/cosmos/cosmos-sdk/x/auth/types.cosmos.auth.v1beta1.AccountI"; diff --git a/proto/nibiru/oracle/v1/oracle.proto b/proto/nibiru/oracle/v1/oracle.proto index 0e12baad2..e9f545623 100644 --- a/proto/nibiru/oracle/v1/oracle.proto +++ b/proto/nibiru/oracle/v1/oracle.proto @@ -10,7 +10,6 @@ option go_package = "github.com/NibiruChain/nibiru/x/oracle/types"; // Params defines the module parameters for the x/oracle module. message Params { option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; // VotePeriod defines the number of blocks during which voting takes place. uint64 vote_period = 1 [ (gogoproto.moretags) = "yaml:\"vote_period\"" ]; @@ -91,7 +90,6 @@ message Params { message AggregateExchangeRatePrevote { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; string hash = 1 [ (gogoproto.moretags) = "yaml:\"hash\"" ]; string voter = 2 [ (gogoproto.moretags) = "yaml:\"voter\"" ]; @@ -103,7 +101,6 @@ message AggregateExchangeRatePrevote { message AggregateExchangeRateVote { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; repeated ExchangeRateTuple exchange_rate_tuples = 1 [ (gogoproto.moretags) = "yaml:\"exchange_rate_tuples\"", @@ -118,7 +115,6 @@ message AggregateExchangeRateVote { message ExchangeRateTuple { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; string pair = 1 [ (gogoproto.moretags) = "yaml:\"pair\"", diff --git a/proto/nibiru/sudo/v1/state.proto b/proto/nibiru/sudo/v1/state.proto index 8e54d80fb..bce368185 100644 --- a/proto/nibiru/sudo/v1/state.proto +++ b/proto/nibiru/sudo/v1/state.proto @@ -8,7 +8,6 @@ import "google/api/annotations.proto"; option go_package = "github.com/NibiruChain/nibiru/x/sudo/types"; message Sudoers { - option (gogoproto.goproto_stringer) = false; // Root: The "root" user. string root = 1; diff --git a/proto/nibiru/tokenfactory/v1/state.proto b/proto/nibiru/tokenfactory/v1/state.proto index 255398aa2..e476ddbb5 100644 --- a/proto/nibiru/tokenfactory/v1/state.proto +++ b/proto/nibiru/tokenfactory/v1/state.proto @@ -55,7 +55,6 @@ message ModuleParams { // TFDenom is a token factory (TF) denom. The canonical representation is // "tf/{creator}/{subdenom}", its unique denomination in the x/bank module. message TFDenom { - option (gogoproto.goproto_stringer) = false; option (gogoproto.stringer) = false; // Creator: Bech32 address of the creator of the denom. diff --git a/x/oracle/types/oracle.pb.go b/x/oracle/types/oracle.pb.go index fc2b10c6d..65b124512 100644 --- a/x/oracle/types/oracle.pb.go +++ b/x/oracle/types/oracle.pb.go @@ -70,8 +70,9 @@ type Params struct { ExpirationBlocks uint64 `protobuf:"varint,11,opt,name=expiration_blocks,json=expirationBlocks,proto3" json:"expiration_blocks,omitempty" yaml:"expiration_blocks"` } -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { return fileDescriptor_43d45df86ea09ed4, []int{0} } @@ -147,8 +148,9 @@ type AggregateExchangeRatePrevote struct { SubmitBlock uint64 `protobuf:"varint,3,opt,name=submit_block,json=submitBlock,proto3" json:"submit_block,omitempty" yaml:"submit_block"` } -func (m *AggregateExchangeRatePrevote) Reset() { *m = AggregateExchangeRatePrevote{} } -func (*AggregateExchangeRatePrevote) ProtoMessage() {} +func (m *AggregateExchangeRatePrevote) Reset() { *m = AggregateExchangeRatePrevote{} } +func (m *AggregateExchangeRatePrevote) String() string { return proto.CompactTextString(m) } +func (*AggregateExchangeRatePrevote) ProtoMessage() {} func (*AggregateExchangeRatePrevote) Descriptor() ([]byte, []int) { return fileDescriptor_43d45df86ea09ed4, []int{1} } @@ -186,8 +188,9 @@ type AggregateExchangeRateVote struct { Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty" yaml:"voter"` } -func (m *AggregateExchangeRateVote) Reset() { *m = AggregateExchangeRateVote{} } -func (*AggregateExchangeRateVote) ProtoMessage() {} +func (m *AggregateExchangeRateVote) Reset() { *m = AggregateExchangeRateVote{} } +func (m *AggregateExchangeRateVote) String() string { return proto.CompactTextString(m) } +func (*AggregateExchangeRateVote) ProtoMessage() {} func (*AggregateExchangeRateVote) Descriptor() ([]byte, []int) { return fileDescriptor_43d45df86ea09ed4, []int{2} } @@ -224,8 +227,9 @@ type ExchangeRateTuple struct { ExchangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=exchange_rate,json=exchangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exchange_rate" yaml:"exchange_rate"` } -func (m *ExchangeRateTuple) Reset() { *m = ExchangeRateTuple{} } -func (*ExchangeRateTuple) ProtoMessage() {} +func (m *ExchangeRateTuple) Reset() { *m = ExchangeRateTuple{} } +func (m *ExchangeRateTuple) String() string { return proto.CompactTextString(m) } +func (*ExchangeRateTuple) ProtoMessage() {} func (*ExchangeRateTuple) Descriptor() ([]byte, []int) { return fileDescriptor_43d45df86ea09ed4, []int{3} } @@ -379,69 +383,68 @@ func init() { func init() { proto.RegisterFile("nibiru/oracle/v1/oracle.proto", fileDescriptor_43d45df86ea09ed4) } var fileDescriptor_43d45df86ea09ed4 = []byte{ - // 979 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xe6, 0x57, 0xe3, 0xb1, 0x53, 0x92, 0x69, 0x0a, 0x9b, 0x50, 0xbc, 0x61, 0x2a, 0x55, - 0x39, 0x94, 0x5d, 0xa5, 0x80, 0x10, 0x91, 0x38, 0xb0, 0x0d, 0x81, 0x48, 0x05, 0x59, 0xa3, 0x0a, - 0x24, 0x84, 0x64, 0xcd, 0xee, 0x4e, 0xd6, 0x23, 0xef, 0xee, 0x58, 0x33, 0xeb, 0x38, 0x91, 0x10, - 0x67, 0x8e, 0x3d, 0xa1, 0x1e, 0x73, 0xe6, 0x8e, 0xc4, 0x9f, 0xd0, 0x1b, 0x3d, 0xa2, 0x1e, 0xb6, - 0x28, 0xe1, 0x80, 0x10, 0x27, 0xff, 0x05, 0x68, 0x66, 0xc7, 0xf1, 0x26, 0xb6, 0x04, 0x01, 0xf5, - 0x64, 0xbf, 0xf7, 0xcd, 0x7c, 0xef, 0x7b, 0x3f, 0x66, 0x66, 0xc1, 0x5b, 0x19, 0x0b, 0x98, 0x18, - 0x78, 0x5c, 0x90, 0x30, 0xa1, 0xde, 0xd1, 0x8e, 0xf9, 0xe7, 0xf6, 0x05, 0xcf, 0x39, 0x5c, 0x2d, - 0x61, 0xd7, 0x38, 0x8f, 0x76, 0x36, 0xd7, 0x63, 0x1e, 0x73, 0x0d, 0x7a, 0xea, 0x5f, 0xb9, 0x6e, - 0xb3, 0x15, 0x73, 0x1e, 0x27, 0xd4, 0xd3, 0x56, 0x30, 0x38, 0xf4, 0xa2, 0x81, 0x20, 0x39, 0xe3, - 0xd9, 0x18, 0x0f, 0xb9, 0x4c, 0xb9, 0xf4, 0x02, 0x22, 0x55, 0x90, 0x80, 0xe6, 0x64, 0xc7, 0x0b, - 0x39, 0x33, 0x38, 0xfa, 0x65, 0x19, 0x2c, 0xb5, 0x89, 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f, 0x02, 0xee, 0x43, 0xce, 0x32, 0x7f, 0x41, 0x25, 0x8f, 0xcb, 0xd5, 0xfe, 0xfe, 0xb3, - 0xb3, 0x96, 0xf5, 0xfc, 0xac, 0x65, 0xfd, 0x76, 0xd6, 0xb2, 0x9e, 0x9c, 0xb7, 0x6a, 0xcf, 0xcf, - 0x5b, 0xb5, 0x5f, 0xcf, 0x5b, 0xb5, 0xaf, 0xef, 0xff, 0xd3, 0x30, 0x98, 0x2f, 0x19, 0x5d, 0xa5, - 0x60, 0x49, 0x5f, 0xc0, 0xef, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x73, 0x48, 0x19, 0x08, 0xe7, - 0x08, 0x00, 0x00, + // 976 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0x1b, 0xc5, + 0x1b, 0xf6, 0x26, 0x4e, 0x1a, 0x8f, 0x93, 0xfe, 0x92, 0x69, 0xfa, 0x63, 0x13, 0x8a, 0x37, 0x4c, + 0xa5, 0xca, 0x87, 0xb2, 0xab, 0x14, 0x10, 0x22, 0x12, 0x07, 0xb6, 0x21, 0x10, 0xa9, 0x20, 0x6b, + 0x54, 0x81, 0x84, 0x90, 0xac, 0xd9, 0xdd, 0xc9, 0x7a, 0xe4, 0xdd, 0x1d, 0x6b, 0x66, 0x1d, 0x27, + 0x12, 0xe2, 0xcc, 0xb1, 0x27, 0xc4, 0x31, 0x67, 0x6e, 0xdc, 0xf8, 0x08, 0x95, 0xb8, 0xf4, 0x88, + 0x7a, 0xd8, 0x56, 0xc9, 0x25, 0xe2, 0xe8, 0x4f, 0x80, 0x66, 0x76, 0x1c, 0x6f, 0xb0, 0x25, 0x08, + 0x88, 0x93, 0xf7, 0x7d, 0x9f, 0x99, 0xe7, 0x7d, 0xde, 0x3f, 0x33, 0x63, 0xf0, 0x56, 0xc6, 0x02, + 0x26, 0x86, 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, 0x17, 0x75, 0xb0, 0xfd, 0x1b, 0x07, 0x33, 0x69, + 0x55, 0xa8, 0x10, 0x06, 0xa5, 0xe5, 0x93, 0x2c, 0x82, 0x31, 0x68, 0x8c, 0x7a, 0x2c, 0xa7, 0x09, + 0x93, 0xb9, 0x5d, 0xdf, 0x59, 0x6c, 0x37, 0xfc, 0xc3, 0x97, 0x85, 0xb3, 0x5b, 0x09, 0xf0, 0x85, + 0x6e, 0xd2, 0xe3, 0x1e, 0x61, 0x99, 0x67, 0xfa, 0x79, 0xe2, 0x85, 0x3c, 0x4d, 0x79, 0xe6, 0x11, + 0x29, 0x69, 0xee, 0x76, 0x08, 0x13, 0xe3, 0xc2, 0x59, 0x2f, 0x63, 0x5d, 0xf1, 0x21, 0x3c, 0xe5, + 0x56, 0xf5, 0x93, 0x09, 0x91, 0xbd, 0xee, 0x91, 0x20, 0xa1, 0xea, 0x9d, 0xbd, 0xf4, 0xef, 0xea, + 0x77, 0x9d, 0x0d, 0xe1, 0x35, 0xed, 0x38, 0x30, 0x36, 0xdc, 0x03, 0xab, 0xe5, 0x8a, 0x11, 0xcb, + 0x22, 0x3e, 0xb2, 0x97, 0x75, 0xa7, 0xdf, 0x18, 0x17, 0xce, 0x9d, 0xea, 0xfe, 0x12, 0x45, 0xb8, + 0xa9, 0xcd, 0xaf, 0xb4, 0x05, 0xbf, 0x03, 0x9b, 0x29, 0xcb, 0xba, 0xc7, 0x24, 0x61, 0x91, 0x1a, + 0x86, 0x09, 0xc7, 0x2d, 0xad, 0xf8, 0xf3, 0x1b, 0x2b, 0x7e, 0xb3, 0x8c, 0x38, 0x8f, 0x13, 0xe1, + 0x8d, 0x94, 0x65, 0x5f, 0x2a, 0x6f, 0x87, 0x0a, 0x13, 0xff, 0x07, 0x0b, 0x6c, 0xe6, 0x23, 0x32, + 0xe8, 0x26, 0x9c, 0xf7, 0x03, 0x12, 0xf6, 0x27, 0x02, 0x56, 0x76, 0xac, 0x76, 0xf3, 0xd1, 0x96, + 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 0xa1, 0xa0, 0x2a, 0xb8, 0x19, + 0xc8, 0x05, 0x3d, 0x90, 0xf6, 0x74, 0xfb, 0x35, 0x18, 0xe1, 0x55, 0x63, 0xeb, 0x91, 0x44, 0x12, + 0xdc, 0xc2, 0xfa, 0xf5, 0x91, 0xf0, 0x36, 0x58, 0x60, 0xe6, 0x05, 0xc6, 0x0b, 0x2c, 0x82, 0x6f, + 0x83, 0xd5, 0xca, 0xeb, 0x2b, 0x4b, 0x62, 0xdc, 0x9c, 0xbe, 0xc1, 0x12, 0xbe, 0x0f, 0x96, 0xd4, + 0xb3, 0x2e, 0xed, 0x45, 0x3d, 0x98, 0x5b, 0x6e, 0x99, 0x88, 0xab, 0x1e, 0x7e, 0xd7, 0x3c, 0xfc, + 0xee, 0x63, 0xce, 0x32, 0xbf, 0xae, 0x92, 0xc7, 0xe5, 0x6a, 0xff, 0xe0, 0xf9, 0x79, 0xcb, 0x7a, + 0x71, 0xde, 0xb2, 0x5e, 0x9f, 0xb7, 0xac, 0x67, 0x17, 0xad, 0xda, 0x8b, 0x8b, 0x56, 0xed, 0xb7, + 0x8b, 0x56, 0xed, 0xeb, 0x87, 0x7f, 0x35, 0x08, 0xe6, 0x9f, 0x8b, 0xae, 0x52, 0xb0, 0xac, 0x2f, + 0xdc, 0x77, 0xff, 0x08, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x42, 0xc8, 0x75, 0xd7, 0x08, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { diff --git a/x/oracle/types/params.go b/x/oracle/types/params.go index cf17b313c..b31e8ac7a 100644 --- a/x/oracle/types/params.go +++ b/x/oracle/types/params.go @@ -5,7 +5,6 @@ import ( time "time" "cosmossdk.io/math" - "gopkg.in/yaml.v2" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" @@ -74,12 +73,6 @@ func DefaultParams() Params { } } -// String implements fmt.Stringer interface -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} - // Validate performs basic validation on oracle parameters. func (p Params) Validate() error { if p.VotePeriod == 0 { diff --git a/x/oracle/types/vote.go b/x/oracle/types/vote.go index 46937e949..5a74eecc8 100644 --- a/x/oracle/types/vote.go +++ b/x/oracle/types/vote.go @@ -9,8 +9,6 @@ import ( "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/set" - "gopkg.in/yaml.v2" - sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -30,12 +28,6 @@ func NewAggregateExchangeRatePrevote(hash AggregateVoteHash, voter sdk.ValAddres } } -// String implement stringify -func (v AggregateExchangeRatePrevote) String() string { - out, _ := yaml.Marshal(v) - return string(out) -} - // NewAggregateExchangeRateVote creates a AggregateExchangeRateVote instance func NewAggregateExchangeRateVote(exchangeRateTuples ExchangeRateTuples, voter sdk.ValAddress) AggregateExchangeRateVote { return AggregateExchangeRateVote{ @@ -44,12 +36,6 @@ func NewAggregateExchangeRateVote(exchangeRateTuples ExchangeRateTuples, voter s } } -// String implement stringify -func (v AggregateExchangeRateVote) String() string { - out, _ := yaml.Marshal(v) - return string(out) -} - // NewExchangeRateTuple creates a ExchangeRateTuple instance func NewExchangeRateTuple(pair asset.Pair, exchangeRate sdk.Dec) ExchangeRateTuple { return ExchangeRateTuple{ @@ -58,12 +44,6 @@ func NewExchangeRateTuple(pair asset.Pair, exchangeRate sdk.Dec) ExchangeRateTup } } -// String implement stringify -func (m ExchangeRateTuple) String() string { - out, _ := yaml.Marshal(m) - return string(out) -} - // ToString converts the ExchangeRateTuple to the vote string. func (m ExchangeRateTuple) ToString() (string, error) { err := m.Pair.Validate() @@ -125,12 +105,6 @@ func (tuples ExchangeRateTuples) ToMap() (exchangeRateMap map[asset.Pair]sdk.Dec return exchangeRateMap } -// String implements fmt.Stringer interface -func (tuples ExchangeRateTuples) String() string { - out, _ := yaml.Marshal(tuples) - return string(out) -} - func NewExchangeRateTuplesFromString(s string) (ExchangeRateTuples, error) { stringTuples := strings.Split(s, ExchangeRateTuplesSeparator) diff --git a/x/sudo/keeper/msg_server.go b/x/sudo/keeper/msg_server.go index ad22c3afb..bfba6d5c1 100644 --- a/x/sudo/keeper/msg_server.go +++ b/x/sudo/keeper/msg_server.go @@ -89,7 +89,8 @@ type Sudoers struct { } func (sudo Sudoers) String() string { - return sudo.ToPb().String() + r := sudo.ToPb() + return r.String() } func (sudo Sudoers) ToPb() sudotypes.Sudoers { diff --git a/x/sudo/types/state.go b/x/sudo/types/state.go index 94128577e..80517bc78 100644 --- a/x/sudo/types/state.go +++ b/x/sudo/types/state.go @@ -1,8 +1,6 @@ package types import ( - "encoding/json" - sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,8 +20,3 @@ type SudoersJson struct { Root string `json:"root"` Contracts []string `json:"contracts"` } - -func (sudo Sudoers) String() string { - jsonBz, _ := json.Marshal(SudoersJson(sudo)) - return string(jsonBz) -} diff --git a/x/sudo/types/state.pb.go b/x/sudo/types/state.pb.go index 2fcf10a1a..9ca78c3ea 100644 --- a/x/sudo/types/state.pb.go +++ b/x/sudo/types/state.pb.go @@ -31,8 +31,9 @@ type Sudoers struct { Contracts []string `protobuf:"bytes,2,rep,name=contracts,proto3" json:"contracts,omitempty"` } -func (m *Sudoers) Reset() { *m = Sudoers{} } -func (*Sudoers) ProtoMessage() {} +func (m *Sudoers) Reset() { *m = Sudoers{} } +func (m *Sudoers) String() string { return proto.CompactTextString(m) } +func (*Sudoers) ProtoMessage() {} func (*Sudoers) Descriptor() ([]byte, []int) { return fileDescriptor_4b462ff6aaf658cf, []int{0} } @@ -130,24 +131,24 @@ func init() { func init() { proto.RegisterFile("nibiru/sudo/v1/state.proto", fileDescriptor_4b462ff6aaf658cf) } var fileDescriptor_4b462ff6aaf658cf = []byte{ - // 264 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0xcb, 0x4c, 0xca, - 0x2c, 0x2a, 0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e1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, - 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, - 0xea, 0xfb, 0x81, 0xcd, 0x72, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x87, 0x06, 0x4e, 0x05, 0x24, 0x78, - 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x1e, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, - 0x5e, 0x2c, 0x41, 0x6d, 0x3a, 0x01, 0x00, 0x00, + // 258 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0x31, 0x4b, 0x03, 0x31, + 0x1c, 0xc5, 0xef, 0xb4, 0x58, 0x2e, 0x8a, 0x43, 0x10, 0x2c, 0x47, 0x89, 0xa5, 0x53, 0x71, 0x48, + 0xa8, 0x0e, 0x0e, 0x6e, 0x55, 0xe8, 0xe6, 0x70, 0xdd, 0xdc, 0x72, 0xd7, 0x90, 0x06, 0x34, 0xff, + 0x23, 0xf9, 0x5f, 0xd1, 0x6f, 0xe1, 0xc7, 0xea, 0xd8, 0xd1, 0x49, 0xe4, 0xee, 0x8b, 0xc8, 0x25, + 0x15, 0x71, 0x7b, 0xe4, 0xf7, 0x78, 0x79, 0xff, 0x47, 0x72, 0x6b, 0x4a, 0xe3, 0x1a, 0xe1, 0x9b, + 0x35, 0x88, 0xed, 0x5c, 0x78, 0x94, 0xa8, 0x78, 0xed, 0x00, 0x81, 0x9e, 0x47, 0xc6, 0x7b, 0xc6, + 0xb7, 0xf3, 0xfc, 0x42, 0x83, 0x86, 0x80, 0x44, 0xaf, 0xa2, 0x2b, 0x1f, 0x6b, 0x00, 0xfd, 0xa2, + 0x84, 0xac, 0x8d, 0x90, 0xd6, 0x02, 0x4a, 0x34, 0x60, 0x7d, 0xa4, 0xd3, 0x7b, 0x32, 0x5c, 0x35, + 0x6b, 0x50, 0xce, 0x53, 0x4a, 0x06, 0x0e, 0x00, 0x47, 0xe9, 0x24, 0x9d, 0x65, 0x45, 0xd0, 0x74, + 0x4c, 0xb2, 0x0a, 0x2c, 0x3a, 0x59, 0xa1, 0x1f, 0x1d, 0x4d, 0x8e, 0x67, 0x59, 0xf1, 0xf7, 0x30, + 0x5d, 0x92, 0xb3, 0xa5, 0xb2, 0xca, 0x1b, 0xbf, 0xea, 0x6b, 0xd1, 0x3b, 0x32, 0xf4, 0x31, 0x2c, + 0x84, 0x9c, 0xde, 0x5c, 0xf2, 0xff, 0x15, 0xf9, 0xe1, 0xaf, 0xc5, 0x60, 0xf7, 0x75, 0x95, 0x14, + 0xbf, 0xee, 0xc5, 0xe3, 0xae, 0x65, 0xe9, 0xbe, 0x65, 0xe9, 0x77, 0xcb, 0xd2, 0x8f, 0x8e, 0x25, + 0xfb, 0x8e, 0x25, 0x9f, 0x1d, 0x4b, 0x9e, 0xaf, 0xb5, 0xc1, 0x4d, 0x53, 0xf2, 0x0a, 0x5e, 0xc5, + 0x53, 0xc8, 0x7a, 0xd8, 0x48, 0x63, 0xc5, 0x61, 0x96, 0xb7, 0x38, 0x0c, 0xbe, 0xd7, 0xca, 0x97, + 0x27, 0xe1, 0xa4, 0xdb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x57, 0x7e, 0xb3, 0x34, 0x01, + 0x00, 0x00, } func (m *Sudoers) Marshal() (dAtA []byte, err error) { diff --git a/x/tokenfactory/cli/cli_test.go b/x/tokenfactory/cli/cli_test.go index f1f1e37e1..c7d432cb4 100644 --- a/x/tokenfactory/cli/cli_test.go +++ b/x/tokenfactory/cli/cli_test.go @@ -81,9 +81,9 @@ func (s *IntegrationTestSuite) CreateDenomTest() { ) denoms := denomResp.Denoms wantDenoms := []string{ - types.TFDenom{Creator: creator.String(), Subdenom: "nusd"}.String(), - types.TFDenom{Creator: creator.String(), Subdenom: "stnibi"}.String(), - types.TFDenom{Creator: creator.String(), Subdenom: "stnusd"}.String(), + types.TFDenom{Creator: creator.String(), Subdenom: "nusd"}.Denom().String(), + types.TFDenom{Creator: creator.String(), Subdenom: "stnibi"}.Denom().String(), + types.TFDenom{Creator: creator.String(), Subdenom: "stnusd"}.Denom().String(), } s.ElementsMatch(denoms, wantDenoms) } @@ -120,7 +120,7 @@ func (s *IntegrationTestSuite) MintBurnTest() { Creator: creator.String(), Subdenom: "nusd", } - coin := sdk.NewInt64Coin(denom.String(), 420) + coin := sdk.NewInt64Coin(denom.Denom().String(), 420) wantErr := false mint(coin.String(), creator.String(), wantErr) // happy @@ -135,12 +135,12 @@ func (s *IntegrationTestSuite) MintBurnTest() { burn("notacoin_231,,", creator.String(), wantErr) t.Log(`want error: unable to parse "mint-to" or "burn-from"`) - coin.Denom = denom.String() + coin.Denom = denom.Denom().String() mint(coin.String(), "invalidAddr", wantErr) burn(coin.String(), "invalidAddr", wantErr) t.Log("burn successfully") - coin.Denom = denom.String() + coin.Denom = denom.Denom().String() wantErr = false burn(coin.String(), creator.String(), wantErr) // happy } @@ -158,7 +158,7 @@ func (s *IntegrationTestSuite) ChangeAdminTest() { infoResp := new(types.QueryDenomInfoResponse) s.NoError( s.network.ExecQuery( - cli.NewQueryCmd(), []string{"denom-info", denom.String()}, infoResp, + cli.NewQueryCmd(), []string{"denom-info", denom.Denom().String()}, infoResp, ), ) s.Equal(infoResp.Admin, admin.String()) @@ -166,14 +166,14 @@ func (s *IntegrationTestSuite) ChangeAdminTest() { s.T().Log("Change to a new admin") _, err := s.network.ExecTxCmd( cli.NewTxCmd(), - admin, []string{"change-admin", denom.String(), newAdmin.String()}) + admin, []string{"change-admin", denom.Denom().String(), newAdmin.String()}) s.Require().NoError(err) s.T().Log("Verify new admin is in state") infoResp = new(types.QueryDenomInfoResponse) s.NoError( s.network.ExecQuery( - cli.NewQueryCmd(), []string{"denom-info", denom.String()}, infoResp, + cli.NewQueryCmd(), []string{"denom-info", denom.Denom().String()}, infoResp, ), ) s.Equal(infoResp.Admin, newAdmin.String()) diff --git a/x/tokenfactory/keeper/genesis.go b/x/tokenfactory/keeper/genesis.go index 488861333..01f08fb16 100644 --- a/x/tokenfactory/keeper/genesis.go +++ b/x/tokenfactory/keeper/genesis.go @@ -36,13 +36,13 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { denom := iter.Value() authorityMetadata, err := k.Store.GetDenomAuthorityMetadata( - ctx, denom.String()) + ctx, denom.Denom().String()) if err != nil { panic(err) } genDenoms = append(genDenoms, types.GenesisDenom{ - Denom: denom.String(), + Denom: denom.Denom().String(), AuthorityMetadata: authorityMetadata, }) } diff --git a/x/tokenfactory/keeper/genesis_test.go b/x/tokenfactory/keeper/genesis_test.go index 7ead2f7e8..8c2748b57 100644 --- a/x/tokenfactory/keeper/genesis_test.go +++ b/x/tokenfactory/keeper/genesis_test.go @@ -13,7 +13,7 @@ func (s *TestSuite) TestGenesis() { Subdenom: testutil.RandLetters(3), } s.Require().NoError(denom.Validate()) - return denom.String() + return denom.Denom().String() } testCases := []struct { diff --git a/x/tokenfactory/keeper/grpc_query_test.go b/x/tokenfactory/keeper/grpc_query_test.go index a9a2ff5b3..6897a5ec3 100644 --- a/x/tokenfactory/keeper/grpc_query_test.go +++ b/x/tokenfactory/keeper/grpc_query_test.go @@ -45,11 +45,11 @@ func (s *TestSuite) TestQueryDenoms() { denomsResp, err := queryDenoms(denom.Creator) s.NoError(err) s.ElementsMatch(denomsResp.Denoms, []string{ - denom.String(), + denom.Denom().String(), types.TFDenom{ Creator: denom.Creator, Subdenom: "foobar", - }.String(), + }.Denom().String(), }) denomsResp, err = queryDenoms("creator") @@ -91,7 +91,7 @@ func (s *TestSuite) TestQueryDenomInfo() { s.Run("case: happy", func() { resp, err := s.querier.DenomInfo(s.GoCtx(), &types.QueryDenomInfoRequest{ - Denom: denom.String(), + Denom: denom.Denom().String(), }) s.NoError(err) s.Equal(creator.String(), resp.Admin) diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index 5a56b5c50..279d6c4ba 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -36,7 +36,7 @@ func (k Keeper) CreateDenom( } return &types.MsgCreateDenomResponse{ - NewTokenDenom: denom.String(), + NewTokenDenom: denom.Denom().String(), }, err } diff --git a/x/tokenfactory/keeper/msg_server_test.go b/x/tokenfactory/keeper/msg_server_test.go index 8caf497fc..0167bd507 100644 --- a/x/tokenfactory/keeper/msg_server_test.go +++ b/x/tokenfactory/keeper/msg_server_test.go @@ -99,8 +99,8 @@ func (s *TestSuite) TestCreateDenom() { want := types.TFDenom{ Creator: tc.txMsg.Sender, Subdenom: tc.txMsg.Subdenom, - }.String() - s.Equal(want, resp.NewTokenDenom) + }.Denom() + s.Equal(want.String(), resp.NewTokenDenom) if tc.postHook != nil { tc.postHook(s.ctx, s.app) @@ -137,7 +137,7 @@ func (s *TestSuite) TestChangeAdmin() { Name: "sad: non-admin tries to change admin", txMsg: &types.MsgChangeAdmin{ Sender: testutil.AccAddress().String(), - Denom: types.TFDenom{Creator: sbf, Subdenom: "ftt"}.String(), + Denom: types.TFDenom{Creator: sbf, Subdenom: "ftt"}.Denom().String(), NewAdmin: testutil.AccAddress().String(), }, wantErr: "only the current admin can set a new admin", @@ -156,7 +156,7 @@ func (s *TestSuite) TestChangeAdmin() { Name: "happy: SBF changes FTT admin", txMsg: &types.MsgChangeAdmin{ Sender: sbf, - Denom: types.TFDenom{Creator: sbf, Subdenom: "ftt"}.String(), + Denom: types.TFDenom{Creator: sbf, Subdenom: "ftt"}.Denom().String(), NewAdmin: testutil.AccAddress().String(), }, wantErr: "", @@ -175,7 +175,7 @@ func (s *TestSuite) TestChangeAdmin() { Name: "sad: change admin for denom that doesn't exist ", txMsg: &types.MsgChangeAdmin{ Sender: sbf, - Denom: types.TFDenom{Creator: sbf, Subdenom: "ftt"}.String(), + Denom: types.TFDenom{Creator: sbf, Subdenom: "ftt"}.Denom().String(), NewAdmin: testutil.AccAddress().String(), }, wantErr: collections.ErrNotFound.Error(), @@ -330,7 +330,7 @@ func (s *TestSuite) TestMintBurn() { Subdenom: "nusd", } nusd69420 := sdk.Coin{ - Denom: tfdenom.String(), + Denom: tfdenom.Denom().String(), Amount: math.NewInt(69_420), } @@ -349,7 +349,7 @@ func (s *TestSuite) TestMintBurn() { Denom: types.TFDenom{ Creator: addrs[0].String(), Subdenom: "nusd", - }.String(), + }.Denom().String(), Amount: math.NewInt(69_420), }, MintTo: "", @@ -363,7 +363,7 @@ func (s *TestSuite) TestMintBurn() { Denom: types.TFDenom{ Creator: addrs[0].String(), Subdenom: "nusd", - }.String(), + }.Denom().String(), Amount: math.NewInt(1), }, BurnFrom: "", @@ -383,12 +383,12 @@ func (s *TestSuite) TestMintBurn() { s.T().Log("Total supply should decrease by burned amount.") denom := allDenoms[0] s.Equal( - math.NewInt(69_419), s.app.BankKeeper.GetSupply(s.ctx, denom.String()).Amount, + math.NewInt(69_419), s.app.BankKeeper.GetSupply(s.ctx, denom.Denom().String()).Amount, ) s.T().Log("Module account should be empty.") coin := s.app.BankKeeper.GetBalance( - s.ctx, tfModuleAddr, denom.String()) + s.ctx, tfModuleAddr, denom.Denom().String()) s.Equal( math.NewInt(0), coin.Amount, @@ -435,7 +435,7 @@ func (s *TestSuite) TestMintBurn() { &types.MsgChangeAdmin{ Sender: addrs[0].String(), - Denom: tfdenom.String(), + Denom: tfdenom.Denom().String(), NewAdmin: addrs[1].String(), }, }, @@ -533,13 +533,13 @@ func (s *TestSuite) TestSetDenomMetadata() { Description: "US Dollar", DenomUnits: []*banktypes.DenomUnit{ { - Denom: tfdenom.String(), + Denom: tfdenom.Denom().String(), Exponent: 0, Aliases: []string{"unusd"}, }, {Denom: "USD", Exponent: 6}, }, - Base: tfdenom.String(), + Base: tfdenom.Denom().String(), Display: "USD", Name: "USD", Symbol: "USD", diff --git a/x/tokenfactory/keeper/store.go b/x/tokenfactory/keeper/store.go index c0d7db2bf..a548ba392 100644 --- a/x/tokenfactory/keeper/store.go +++ b/x/tokenfactory/keeper/store.go @@ -34,17 +34,17 @@ func (api StoreAPI) InsertDenom( return err } // The x/bank keeper is the source of truth. - key := denom.String() + key := denom.Denom() found := api.HasDenom(ctx, denom) if found { - return tftypes.ErrDenomAlreadyRegistered.Wrap(key) + return tftypes.ErrDenomAlreadyRegistered.Wrap(key.String()) } admin := denom.Creator api.unsafeInsertDenom(ctx, denom, admin) api.bankKeeper.SetDenomMetaData(ctx, denom.DefaultBankMetadata()) - api.denomAdmins.Insert(ctx, key, tftypes.DenomAuthorityMetadata{ + api.denomAdmins.Insert(ctx, key.String(), tftypes.DenomAuthorityMetadata{ Admin: admin, }) return nil @@ -55,15 +55,15 @@ func (api StoreAPI) InsertDenom( func (api StoreAPI) unsafeInsertDenom( ctx sdk.Context, denom tftypes.TFDenom, admin string, ) { - denomStr := denom.String() - api.Denoms.Insert(ctx, denomStr, denom) + denomStr := denom.Denom() + api.Denoms.Insert(ctx, denomStr.String(), denom) api.creator.Insert(ctx, denom.Creator) api.bankKeeper.SetDenomMetaData(ctx, denom.DefaultBankMetadata()) - api.denomAdmins.Insert(ctx, denomStr, tftypes.DenomAuthorityMetadata{ + api.denomAdmins.Insert(ctx, denomStr.String(), tftypes.DenomAuthorityMetadata{ Admin: admin, }) _ = ctx.EventManager().EmitTypedEvent(&tftypes.EventCreateDenom{ - Denom: denomStr, + Denom: denomStr.String(), Creator: denom.Creator, }) } @@ -84,7 +84,7 @@ func (api StoreAPI) unsafeGenesisInsertDenom( func (api StoreAPI) HasDenom( ctx sdk.Context, denom tftypes.TFDenom, ) bool { - _, found := api.bankKeeper.GetDenomMetaData(ctx, denom.String()) + _, found := api.bankKeeper.GetDenomMetaData(ctx, denom.Denom().String()) return found } diff --git a/x/tokenfactory/keeper/store_test.go b/x/tokenfactory/keeper/store_test.go index 23c716fc1..c4892cdcc 100644 --- a/x/tokenfactory/keeper/store_test.go +++ b/x/tokenfactory/keeper/store_test.go @@ -31,7 +31,7 @@ func (s *TestSuite) TestStoreWrite() { s.NoError(tfdenom.Validate(), tfdenom) // query by denom should fail for all denoms - _, err := api.Denoms.Get(s.ctx, tfdenom.String()) + _, err := api.Denoms.Get(s.ctx, tfdenom.Denom().String()) s.Error(err) // query by creator should fail for all addrs diff --git a/x/tokenfactory/keeper/wasm_test.go b/x/tokenfactory/keeper/wasm_test.go index 3afe2ff34..8eb8666a4 100644 --- a/x/tokenfactory/keeper/wasm_test.go +++ b/x/tokenfactory/keeper/wasm_test.go @@ -161,7 +161,7 @@ func (s *TestSuite) TestStargate() { denoms := s.app.TokenFactoryKeeper.QueryDenoms(s.ctx, contract.Addr.String(), ) - s.ElementsMatch(denoms, []string{tfdenom.String()}) + s.ElementsMatch(denoms, []string{tfdenom.Denom().String()}) }) someoneElse := testutil.AccAddress() @@ -173,11 +173,11 @@ func (s *TestSuite) TestStargate() { "mint_to": "%s" } } - `, tfdenom, someoneElse), " ") + `, tfdenom.Denom(), someoneElse), " ") _, err := s.ExecuteAgainstContract(contract, execMsgJson) s.NoError(err, "execMsgJson: %v", execMsgJson) - balance := s.app.BankKeeper.GetBalance(s.ctx, someoneElse, tfdenom.String()) + balance := s.app.BankKeeper.GetBalance(s.ctx, someoneElse, tfdenom.Denom().String()) s.Equal(math.NewInt(69_420), balance.Amount) }) @@ -189,11 +189,11 @@ func (s *TestSuite) TestStargate() { "burn_from": "%s" } } - `, tfdenom, someoneElse), " ") + `, tfdenom.Denom(), someoneElse), " ") _, err := s.ExecuteAgainstContract(contract, execMsgJson) s.NoError(err, "execMsgJson: %v", execMsgJson) - balance := s.app.BankKeeper.GetBalance(s.ctx, someoneElse, tfdenom.String()) + balance := s.app.BankKeeper.GetBalance(s.ctx, someoneElse, tfdenom.Denom().String()) s.Equal(math.NewInt(420), balance.Amount) }) @@ -205,12 +205,12 @@ func (s *TestSuite) TestStargate() { "new_admin": "%s" } } - `, tfdenom, someoneElse), " ") + `, tfdenom.Denom(), someoneElse), " ") _, err := s.ExecuteAgainstContract(contract, execMsgJson) s.NoError(err, "execMsgJson: %v", execMsgJson) denomInfo, err := s.app.TokenFactoryKeeper.QueryDenomInfo( - s.ctx, tfdenom.String(), + s.ctx, tfdenom.Denom().String(), ) s.NoError(err) s.Equal(someoneElse.String(), denomInfo.Admin) diff --git a/x/tokenfactory/types/state.go b/x/tokenfactory/types/state.go index 05f0d0774..1a0f56b15 100644 --- a/x/tokenfactory/types/state.go +++ b/x/tokenfactory/types/state.go @@ -29,30 +29,30 @@ func (params ModuleParams) Validate() error { // ---------------------------------------------------- func (tfd TFDenom) Denom() DenomStr { - return DenomStr(tfd.String()) + return DenomStr(fmt.Sprintf("tf/%s/%s", tfd.Creator, tfd.Subdenom)) } -// String: returns the standard string representation. -func (tfd TFDenom) String() string { - return fmt.Sprintf("tf/%s/%s", tfd.Creator, tfd.Subdenom) -} +// // String: returns the standard string representation. +// func (tfd TFDenom) DenomStr() string { +// return fmt.Sprintf("tf/%s/%s", tfd.Creator, tfd.Subdenom) +// } func (tfd TFDenom) Validate() error { return tfd.Denom().Validate() } func (tfd TFDenom) DefaultBankMetadata() banktypes.Metadata { - denom := tfd.String() + denom := tfd.Denom() return banktypes.Metadata{ DenomUnits: []*banktypes.DenomUnit{{ - Denom: denom, + Denom: denom.String(), Exponent: 0, }}, - Base: denom, + Base: denom.String(), // The following is necessary for x/bank denom validation - Display: denom, - Name: denom, - Symbol: denom, + Display: denom.String(), + Name: denom.String(), + Symbol: denom.String(), } } diff --git a/x/tokenfactory/types/state.pb.go b/x/tokenfactory/types/state.pb.go index 8c4005b78..097e89c20 100644 --- a/x/tokenfactory/types/state.pb.go +++ b/x/tokenfactory/types/state.pb.go @@ -157,8 +157,9 @@ type TFDenom struct { Subdenom string `protobuf:"bytes,2,opt,name=subdenom,proto3" json:"subdenom,omitempty"` } -func (m *TFDenom) Reset() { *m = TFDenom{} } -func (*TFDenom) ProtoMessage() {} +func (m *TFDenom) Reset() { *m = TFDenom{} } +func (m *TFDenom) String() string { return proto.CompactTextString(m) } +func (*TFDenom) ProtoMessage() {} func (*TFDenom) Descriptor() ([]byte, []int) { return fileDescriptor_452ec984f7eef90f, []int{2} } @@ -322,38 +323,38 @@ func init() { } var fileDescriptor_452ec984f7eef90f = []byte{ - // 496 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xbd, 0x6e, 0x13, 0x4d, - 0x14, 0xdd, 0xcd, 0xe7, 0xfc, 0x7c, 0x13, 0x83, 0x60, 0x04, 0xc1, 0xb1, 0xc4, 0xae, 0x33, 0x82, - 0x88, 0x6a, 0x47, 0x36, 0x9d, 0x3b, 0xd6, 0x51, 0x22, 0x24, 0x82, 0xd0, 0x42, 0x45, 0xb3, 0xba, - 0xbb, 0x1e, 0xec, 0x81, 0xec, 0x8c, 0xb5, 0x33, 0x6b, 0xe1, 0x2e, 0x8f, 0x40, 0x49, 0x99, 0x27, - 0x81, 0x36, 0x65, 0x4a, 0x0a, 0x64, 0x21, 0xbb, 0xa1, 0xf6, 0x13, 0x20, 0xcf, 0x4c, 0x20, 0x21, - 0x09, 0xdd, 0xde, 0x7b, 0xce, 0x3d, 0x7b, 0xee, 0xcf, 0x20, 0x22, 0x78, 0xc6, 0xcb, 0x8a, 0x6a, - 0xf9, 0x81, 0x89, 0x77, 0x90, 0x6b, 0x59, 0x4e, 0xe8, 0xb8, 0x4d, 0x95, 0x06, 0xcd, 0xa2, 0x51, - 0x29, 0xb5, 0xc4, 0x5b, 0x96, 0x13, 0x5d, 0xe4, 0x44, 0xe3, 0x76, 0xf3, 0xde, 0x40, 0x0e, 0xa4, - 0xa1, 0xd0, 0xe5, 0x97, 0x65, 0x37, 0xb7, 0x73, 0xa9, 0x0a, 0xa9, 0x52, 0x0b, 0xd8, 0xc0, 0x41, - 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, 0x89, 0x2e, 0x76, 0x1d, 0xd7, 0x4e, 0xa7, 0xa1, - 0x97, 0xb8, 0x4a, 0xfc, 0x1e, 0xdd, 0x76, 0xc4, 0xd4, 0xfc, 0x4f, 0x35, 0x56, 0x5a, 0xff, 0xfd, - 0x4b, 0xcb, 0x39, 0x30, 0x2d, 0xc5, 0x0f, 0x97, 0x5a, 0x8b, 0x69, 0x78, 0xdf, 0x4e, 0xe8, 0xb2, - 0x12, 0x49, 0x6e, 0xb9, 0xc4, 0x9e, 0x8d, 0xbf, 0xfe, 0x69, 0xc0, 0x4e, 0x64, 0x17, 0xad, 0xda, - 0xa6, 0xaf, 0xac, 0xcf, 0xa4, 0x49, 0x62, 0x61, 0x7c, 0xec, 0x23, 0x0c, 0xe7, 0xcb, 0x4f, 0x0b, - 0xb7, 0x7d, 0x33, 0xaa, 0xcd, 0x4e, 0x74, 0x93, 0xd3, 0xeb, 0x6f, 0x26, 0xde, 0x71, 0x9e, 0xb7, - 0xdd, 0xa1, 0x5c, 0xd1, 0x25, 0xc9, 0x5d, 0xf8, 0xbb, 0xca, 0x5e, 0x50, 0xfc, 0xe2, 0x74, 0x16, - 0xf8, 0x67, 0xb3, 0xc0, 0xff, 0x31, 0x0b, 0xfc, 0x4f, 0xf3, 0xc0, 0x3b, 0x9b, 0x07, 0xde, 0xb7, - 0x79, 0xe0, 0xbd, 0xed, 0x0c, 0xb8, 0x1e, 0x56, 0x59, 0x94, 0xcb, 0x82, 0xbe, 0x34, 0x7e, 0x7a, - 0x43, 0xe0, 0x82, 0xba, 0x77, 0xf4, 0xf1, 0xf2, 0x4b, 0xd2, 0x93, 0x11, 0x53, 0xd9, 0x9a, 0x39, - 0xef, 0xa7, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd7, 0xfc, 0x2e, 0x39, 0x6d, 0x03, 0x00, 0x00, + // 490 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,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 0xd3, 0xd8, 0x43, 0xeb, 0xb6, 0xe1, 0x2b, 0xab, 0x33, 0x69, 0x92, + 0x58, 0x18, 0x9f, 0xf8, 0x08, 0xc3, 0xf9, 0xe2, 0xd3, 0xc2, 0x6d, 0xde, 0x8c, 0x69, 0xab, 0x13, + 0xad, 0x72, 0x7a, 0xfd, 0xbd, 0xc4, 0xbb, 0xce, 0xf3, 0x8e, 0x3b, 0x92, 0x2b, 0xba, 0x24, 0xb9, + 0x07, 0xff, 0x56, 0xd9, 0xeb, 0x89, 0x5f, 0x9e, 0xce, 0x02, 0xff, 0x6c, 0x16, 0xf8, 0x3f, 0x67, + 0x81, 0xff, 0x79, 0x1e, 0x78, 0x67, 0xf3, 0xc0, 0xfb, 0x3e, 0x0f, 0xbc, 0x77, 0x9d, 0x01, 0xd7, + 0xc3, 0x2a, 0x8b, 0x72, 0x59, 0xd0, 0x57, 0xc6, 0x4f, 0x6f, 0x08, 0x5c, 0x50, 0xf7, 0x86, 0x3e, + 0x5d, 0x7e, 0x45, 0x7a, 0x32, 0x62, 0x2a, 0xdb, 0x30, 0xa7, 0xfd, 0xec, 0x77, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x37, 0x74, 0x40, 0xb6, 0x69, 0x03, 0x00, 0x00, } func (this *DenomAuthorityMetadata) Equal(that interface{}) bool { diff --git a/x/tokenfactory/types/state_test.go b/x/tokenfactory/types/state_test.go index d532d47d5..614bc3794 100644 --- a/x/tokenfactory/types/state_test.go +++ b/x/tokenfactory/types/state_test.go @@ -35,7 +35,7 @@ func TestDenomStr_Validate(t *testing.T) { } require.NoError(t, err) assert.Equal(t, tfDenom.Denom(), tc.denom) - assert.Equal(t, tfDenom.String(), string(tc.denom)) + assert.Equal(t, tfDenom.Denom().String(), string(tc.denom)) assert.NoError(t, tfDenom.Validate()) assert.NotPanics(t, func() { @@ -68,7 +68,7 @@ func TestGenesisState(t *testing.T) { Denom: types.TFDenom{ Creator: creator.String(), Subdenom: testutil.Latin.Letters[lettersIdx : lettersIdx+4], - }.String(), + }.Denom().String(), AuthorityMetadata: types.DenomAuthorityMetadata{ Admin: creator.String(), },