diff --git a/.changeset/entries/ffc3d0026ae324f3a3a5bbfaeac4056e894dca906008a632a7e74a6cc5119407.yaml b/.changeset/entries/ffc3d0026ae324f3a3a5bbfaeac4056e894dca906008a632a7e74a6cc5119407.yaml new file mode 100644 index 0000000000..a51e9d6cf9 --- /dev/null +++ b/.changeset/entries/ffc3d0026ae324f3a3a5bbfaeac4056e894dca906008a632a7e74a6cc5119407.yaml @@ -0,0 +1,6 @@ +type: feat +module: x/profiles +pull_request: 652 +description: Change the plain text encoding of links to hex +backward_compatible: true +date: 2021-10-15T07:15:41.3678891Z diff --git a/app/desmos/cmd/chainlink/create_json.go b/app/desmos/cmd/chainlink/create_json.go index 8cd09adac2..2583f84afa 100644 --- a/app/desmos/cmd/chainlink/create_json.go +++ b/app/desmos/cmd/chainlink/create_json.go @@ -86,14 +86,15 @@ func generateChainLinkJSON(mnemonic string, chain chainlinktypes.Chain) (profile // Generate the proof signing it with the key key, _ := keyBase.Key(keyName) addr, _ := sdk.Bech32ifyAddressBytes(chain.Prefix, key.GetAddress()) - sig, pubkey, err := keyBase.Sign(keyName, []byte(addr)) + value := []byte(addr) + sig, pubkey, err := keyBase.Sign(keyName, value) if err != nil { return profilescliutils.ChainLinkJSON{}, err } return profilescliutils.NewChainLinkJSON( profilestypes.NewBech32Address(addr, chain.Prefix), - profilestypes.NewProof(pubkey, hex.EncodeToString(sig), addr), + profilestypes.NewProof(pubkey, hex.EncodeToString(sig), hex.EncodeToString(value)), profilestypes.NewChainConfig(chain.Name), ), nil } diff --git a/app/desmos/cmd/chainlink/create_json_test.go b/app/desmos/cmd/chainlink/create_json_test.go index 6f9be5cc69..1e4d976662 100644 --- a/app/desmos/cmd/chainlink/create_json_test.go +++ b/app/desmos/cmd/chainlink/create_json_test.go @@ -87,7 +87,7 @@ func TestGetCreateChainLinkJSON(t *testing.T) { profilestypes.NewProof( key.GetPubKey(), "c3bd014b2178d63d94b9c28e628bfcf56736de28f352841b0bb27d6fff2968d62c13a10aeddd1ebfe3b13f3f8e61f79a2c63ae6ff5cb78cb0d64e6b0a70fae57", - "cosmos13j7p6faa9jr8ty6lvqv0prldprr6m5xenmafnt"), + "636f736d6f7331336a377036666161396a72387479366c7671763070726c64707272366d3578656e6d61666e74"), profilestypes.NewChainConfig("cosmos"), ) diff --git a/app/desmos/cmd/sign/sign.go b/app/desmos/cmd/sign/sign.go index 2b7113509e..3ea64ffd1f 100644 --- a/app/desmos/cmd/sign/sign.go +++ b/app/desmos/cmd/sign/sign.go @@ -46,8 +46,8 @@ func GetSignCmd() *cobra.Command { } // Sign the data with the private key - value := args[0] - bz, pubKey, err := txFactory.Keybase().Sign(key.GetName(), []byte(value)) + value := []byte(args[0]) + bz, pubKey, err := txFactory.Keybase().Sign(key.GetName(), value) if err != nil { return err } @@ -57,7 +57,7 @@ func GetSignCmd() *cobra.Command { Address: strings.ToLower(pubKey.Address().String()), Signature: strings.ToLower(hex.EncodeToString(bz)), PubKey: strings.ToLower(hex.EncodeToString(pubKey.Bytes())), - Value: value, + Value: hex.EncodeToString(value), } // Serialize the output as JSON and print it diff --git a/app/desmos/cmd/sign/sign_test.go b/app/desmos/cmd/sign/sign_test.go index 1dca2a26cf..80c8baecfa 100644 --- a/app/desmos/cmd/sign/sign_test.go +++ b/app/desmos/cmd/sign/sign_test.go @@ -51,7 +51,7 @@ func TestGetSignCmd(t *testing.T) { Address: "8cbc1d27bd2c8675935f6018f08fed08c7add0d9", PubKey: "0235088ee6a12267eda6410028706c4ec192b1ce04a298def8dad1c146257012eb", Signature: "39cc04208d25e445a46bd6853cfa7b1b295961bc43d6facf387f4bd9c0c4647163ef2e296f49e307cdb657a7acdf4e2ee56e9bbf1f9723113385f4dd3601061e", - Value: "This is my signed value", + Value: "54686973206973206d79207369676e65642076616c7565", } require.Equal(t, expected, data) diff --git a/x/profiles/client/cli/cli_chain_links.go b/x/profiles/client/cli/cli_chain_links.go index 58309b612f..c60dae8667 100644 --- a/x/profiles/client/cli/cli_chain_links.go +++ b/x/profiles/client/cli/cli_chain_links.go @@ -42,7 +42,7 @@ Where data.json contains: "key":"A58DXR/lXKVkIjLofXgST/OHi+pkOQbVIiOjnTy7Zoqo" }, "signature":"ecc6175e730917fb289d3a9f4e49a5630a44b42d972f481342f540e09def2ec5169780d85c4e060d52cc3ffb3d677745a4d56cd385760735bc6db0f1816713be", - "plain_text":"cosmos15uc89vnzufu5kuhhsxdkltt38zfx8vcyggzwfm" + "plain_text":"636f736d6f73313575633839766e7a756675356b7568687378646b6c747433387a66783876637967677a77666d" }, "chain_config":{ "name":"cosmos" diff --git a/x/profiles/client/cli/cli_chain_links_test.go b/x/profiles/client/cli/cli_chain_links_test.go index 9fc77498a6..b5269ac42f 100644 --- a/x/profiles/client/cli/cli_chain_links_test.go +++ b/x/profiles/client/cli/cli_chain_links_test.go @@ -44,7 +44,7 @@ func (s *IntegrationTestSuite) TestCmdQueryChainLinks() { types.NewProof( pubKey, "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -55,7 +55,7 @@ func (s *IntegrationTestSuite) TestCmdQueryChainLinks() { types.NewProof( pubKey, "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -97,7 +97,7 @@ func (s *IntegrationTestSuite) TestCmdQueryChainLinks() { types.NewProof( pubKey, "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -108,7 +108,7 @@ func (s *IntegrationTestSuite) TestCmdQueryChainLinks() { types.NewProof( pubKey, "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), diff --git a/x/profiles/client/cli/cli_test.go b/x/profiles/client/cli/cli_test.go index 63905f0a0a..12341e9169 100644 --- a/x/profiles/client/cli/cli_test.go +++ b/x/profiles/client/cli/cli_test.go @@ -164,7 +164,7 @@ func (s *IntegrationTestSuite) SetupSuite() { types.NewProof( pubKey, "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -226,7 +226,7 @@ func (s *IntegrationTestSuite) writeChainLinkJSONFile(filePath string) { jsonData := utils.NewChainLinkJSON( types.NewBech32Address(addStr, "cosmos"), - types.NewProof(srcKey.PubKey(), hex.EncodeToString(sigBz), plainText), + types.NewProof(srcKey.PubKey(), hex.EncodeToString(sigBz), hex.EncodeToString([]byte(plainText))), types.NewChainConfig("cosmos"), ) diff --git a/x/profiles/keeper/genesis_test.go b/x/profiles/keeper/genesis_test.go index 200f2ae29f..d571d8d2f9 100644 --- a/x/profiles/keeper/genesis_test.go +++ b/x/profiles/keeper/genesis_test.go @@ -111,7 +111,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -194,7 +194,7 @@ func (suite *KeeperTestSuite) Test_ExportGenesis() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2019, 1, 1, 00, 00, 00, 000, time.UTC), @@ -307,14 +307,14 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), hex.EncodeToString(ext.Sign(ext.GetAddress())), ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), hex.EncodeToString(ext.Sign(ext.GetAddress())), hex.EncodeToString([]byte(ext.GetAddress().String()))), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), hex.EncodeToString(ext.Sign(ext.GetAddress())), ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), hex.EncodeToString(ext.Sign(ext.GetAddress())), hex.EncodeToString([]byte(ext.GetAddress().String()))), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), @@ -394,7 +394,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { types.NewProof( ext.GetPubKey(), hex.EncodeToString(ext.Sign([]byte(ext.GetAddress().String()))), - ext.GetAddress().String(), + hex.EncodeToString([]byte(ext.GetAddress().String())), ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), @@ -478,7 +478,7 @@ func (suite *KeeperTestSuite) Test_InitGenesis() { types.NewProof( ext.GetPubKey(), hex.EncodeToString(ext.Sign([]byte(ext.GetAddress().String()))), - ext.GetAddress().String(), + hex.EncodeToString([]byte(ext.GetAddress().String())), ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), diff --git a/x/profiles/keeper/grpc_query_test.go b/x/profiles/keeper/grpc_query_test.go index 7eaf19d095..ec868b800c 100644 --- a/x/profiles/keeper/grpc_query_test.go +++ b/x/profiles/keeper/grpc_query_test.go @@ -215,7 +215,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), @@ -231,7 +231,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), @@ -252,7 +252,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), @@ -263,7 +263,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), @@ -281,7 +281,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), @@ -297,7 +297,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), @@ -319,7 +319,7 @@ func (suite *KeeperTestSuite) TestQueryServer_ChainLinks() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), @@ -378,7 +378,7 @@ func (suite *KeeperTestSuite) TestQueryServer_UserChainLink() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), @@ -398,7 +398,7 @@ func (suite *KeeperTestSuite) TestQueryServer_UserChainLink() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), diff --git a/x/profiles/keeper/keeper_chain_links_test.go b/x/profiles/keeper/keeper_chain_links_test.go index 8940676781..de09e37619 100644 --- a/x/profiles/keeper/keeper_chain_links_test.go +++ b/x/profiles/keeper/keeper_chain_links_test.go @@ -19,6 +19,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { // Generate source and destination key ext := suite.GetRandomProfile() sig := hex.EncodeToString(ext.Sign([]byte(ext.GetAddress().String()))) + plainText := hex.EncodeToString([]byte(ext.GetAddress().String())) testCases := []struct { name string @@ -31,7 +32,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { name: "invalid chain address packed value returns error", link: types.ChainLink{ Address: testutil.NewAny(ext.privKey), - Proof: types.NewProof(ext.GetPubKey(), sig, ext.GetAddress().String()), + Proof: types.NewProof(ext.GetPubKey(), sig, plainText), ChainConfig: types.NewChainConfig("cosmos"), CreationTime: time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), }, @@ -42,7 +43,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { link: types.NewChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", types.NewBech32Address("", "cosmos"), - types.NewProof(ext.GetPubKey(), sig, ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), sig, plainText), types.NewChainConfig("cosmos"), time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ), @@ -69,7 +70,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { link := types.NewChainLink( address, types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), sig, ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), sig, plainText), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ) @@ -78,7 +79,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { link: types.NewChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), sig, ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), sig, plainText), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), @@ -89,7 +90,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { suite.Require().Contains(links, types.NewChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), sig, ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), sig, plainText), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), )) @@ -100,7 +101,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { link: types.NewChainLink( "", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), sig, ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), sig, plainText), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), @@ -111,7 +112,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { link: types.NewChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), sig, ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), sig, plainText), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), @@ -127,7 +128,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { link: types.NewChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), sig, ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), sig, plainText), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ), @@ -138,7 +139,7 @@ func (suite *KeeperTestSuite) TestKeeper_StoreChainLink() { suite.Require().Contains(links, types.NewChainLink( "cosmos19xz3mrvzvp9ymgmudhpukucg6668l5haakh04x", types.NewBech32Address(ext.GetAddress().String(), "cosmos"), - types.NewProof(ext.GetPubKey(), sig, ext.GetAddress().String()), + types.NewProof(ext.GetPubKey(), sig, plainText), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), )) @@ -191,7 +192,7 @@ func (suite *KeeperTestSuite) TestKeeper_GetChainLink() { link := types.NewChainLink( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), "signature", "plain_text"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), "signature", "706c61696e5f74657874"), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), ) @@ -335,7 +336,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserChainLinks() { link := types.NewChainLink( user, types.NewBech32Address("cosmos10nsdxxdvy9qka3zv0lzw8z9cnu6kanld8jh773", "cosmos"), - types.NewProof(key, "signature", "plain text"), + types.NewProof(key, "signature", "706c61696e74657874"), types.NewChainConfig("cosmos"), time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ) @@ -347,7 +348,7 @@ func (suite *KeeperTestSuite) TestKeeper_DeleteAllUserChainLinks() { link = types.NewChainLink( user, types.NewBech32Address("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn", "cosmos"), - types.NewProof(key, "signature", "plain text"), + types.NewProof(key, "signature", "706c61696e74657874"), types.NewChainConfig("cosmos"), time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ) diff --git a/x/profiles/keeper/msg_server_chain_link_test.go b/x/profiles/keeper/msg_server_chain_link_test.go index f3d7ec53fb..3b8aaede57 100644 --- a/x/profiles/keeper/msg_server_chain_link_test.go +++ b/x/profiles/keeper/msg_server_chain_link_test.go @@ -51,7 +51,7 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { name: "invalid chain link returns error", msg: types.NewMsgLinkChainAccount( types.NewBech32Address(srcAddr, "cosmos"), - types.NewProof(srcPubKey, srcSigHex, srcAddr), + types.NewProof(srcPubKey, srcSigHex, hex.EncodeToString([]byte(srcAddr))), types.NewChainConfig("cosmos"), destAddr, ), @@ -62,7 +62,7 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { name: "invalid chain address packed value returns error", msg: &types.MsgLinkChainAccount{ ChainAddress: testutil.NewAny(srcPriv), - Proof: types.NewProof(srcPubKey, srcSigHex, srcAddr), + Proof: types.NewProof(srcPubKey, srcSigHex, hex.EncodeToString([]byte(srcAddr))), ChainConfig: types.NewChainConfig("cosmos"), Signer: destAddr, }, @@ -101,7 +101,7 @@ func (suite *KeeperTestSuite) TestMsgServer_LinkChainAccount() { }, msg: types.NewMsgLinkChainAccount( types.NewBech32Address(srcAddr, "cosmos"), - types.NewProof(srcPubKey, srcSigHex, srcAddr), + types.NewProof(srcPubKey, srcSigHex, hex.EncodeToString([]byte(srcAddr))), types.NewChainConfig("cosmos"), destAddr, ), @@ -181,7 +181,7 @@ func (suite *KeeperTestSuite) TestMsgServer_UnlinkChainAccount() { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepqvryxhhqhw52c4ny5twtfzf3fsrjqhx0x5cuya0fylw0wu0eqptykeqhr4d"), "909e38994b1583d3f14384c2e9a03c90064e8fd8e19b780bb0ba303dfe671a27287da04d0ce096ce9a140bd070ee36818f5519eb2070a16971efd8143855524b", - "text", + "74657874", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 1, 00, 00, 00, 000, time.UTC), diff --git a/x/profiles/keeper/relay_chain_links_test.go b/x/profiles/keeper/relay_chain_links_test.go index a3aa288e99..acf9f42f9d 100644 --- a/x/profiles/keeper/relay_chain_links_test.go +++ b/x/profiles/keeper/relay_chain_links_test.go @@ -32,14 +32,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { SourceProof: types.NewProof( suite.chainA.Account.GetPubKey(), srcSigHex, - srcAddr, + hex.EncodeToString([]byte(srcAddr)), ), SourceChainConfig: types.NewChainConfig("cosmos"), DestinationAddress: destAddr, DestinationProof: types.NewProof( suite.chainB.Account.GetPubKey(), destSigHex, - destAddr, + hex.EncodeToString([]byte(destAddr)), ), } }, @@ -55,14 +55,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { SourceProof: types.NewProof( suite.chainA.Account.GetPubKey(), srcSigHex, - srcAddr, + hex.EncodeToString([]byte(srcAddr)), ), SourceChainConfig: types.NewChainConfig("cosmos"), DestinationAddress: destAddr, DestinationProof: types.NewProof( suite.chainB.Account.GetPubKey(), destSigHex, - destAddr, + hex.EncodeToString([]byte(destAddr)), ), } }, @@ -76,14 +76,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewProof( suite.chainA.Account.GetPubKey(), srcSigHex, - srcAddr, + hex.EncodeToString([]byte(srcAddr)), ), types.NewChainConfig("cosmos"), "cosmos1asdjlansdjhasd", types.NewProof( suite.chainB.Account.GetPubKey(), destSigHex, - destAddr, + hex.EncodeToString([]byte(destAddr)), ), ) }, @@ -97,14 +97,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewProof( suite.chainA.Account.GetPubKey(), srcSigHex, - srcAddr, + hex.EncodeToString([]byte(srcAddr)), ), types.NewChainConfig("cosmos"), destAddr, types.NewProof( suite.chainB.Account.GetPubKey(), destSigHex, - destAddr, + hex.EncodeToString([]byte(destAddr)), ), ) }, @@ -118,14 +118,14 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewProof( suite.chainA.Account.GetPubKey(), srcSigHex, - srcAddr, + hex.EncodeToString([]byte(srcAddr)), ), types.NewChainConfig("cosmos"), destAddr, types.NewProof( suite.chainB.Account.GetPubKey(), destSigHex, - destAddr, + hex.EncodeToString([]byte(destAddr)), ), ) }, @@ -159,7 +159,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewProof( suite.chainA.Account.GetPubKey(), srcSigHex, - srcAddr, + hex.EncodeToString([]byte(srcAddr)), ), types.NewChainConfig( "cosmos", @@ -168,7 +168,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewProof( suite.chainB.Account.GetPubKey(), destSigHex, - "invalid", + "696e76616c6964", ), ) }, @@ -202,7 +202,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewProof( suite.chainA.Account.GetPubKey(), srcSigHex, - srcAddr, + hex.EncodeToString([]byte(srcAddr)), ), types.NewChainConfig( "cosmos", @@ -211,7 +211,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewProof( suite.chainB.Account.GetPubKey(), destSigHex, - destAddr, + hex.EncodeToString([]byte(destAddr)), ), ) }, @@ -241,7 +241,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { link := types.NewChainLink( addr.String(), types.NewBech32Address(srcAddr, "cosmos"), - types.NewProof(suite.chainA.Account.GetPubKey(), "signature", srcAddr), + types.NewProof(suite.chainA.Account.GetPubKey(), "signature", hex.EncodeToString([]byte(srcAddr))), types.NewChainConfig("cosmos"), time.Date(2021, 1, 1, 00, 00, 00, 000, time.UTC), ) @@ -257,7 +257,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewProof( suite.chainA.Account.GetPubKey(), srcSigHex, - srcAddr, + hex.EncodeToString([]byte(srcAddr)), ), types.NewChainConfig( "cosmos", @@ -266,7 +266,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket() { types.NewProof( suite.chainB.Account.GetPubKey(), destSigHex, - destAddr, + hex.EncodeToString([]byte(destAddr)), ), ) }, diff --git a/x/profiles/types/genesis_test.go b/x/profiles/types/genesis_test.go index d23dc65bc0..63eb9fac55 100644 --- a/x/profiles/types/genesis_test.go +++ b/x/profiles/types/genesis_test.go @@ -259,7 +259,7 @@ func TestValidateGenesis(t *testing.T) { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), "4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e", - "cosmos1xmquc944hzu6n6qtljcexkuhhz76mucxtgm5x0", + "636f736d6f7331786d717563393434687a75366e3671746c6a6365786b7568687a37366d75637874676d357830", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), @@ -270,7 +270,7 @@ func TestValidateGenesis(t *testing.T) { types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), "4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e", - "cosmos1xmquc944hzu6n6qtljcexkuhhz76mucxtgm5x0", + "636f736d6f7331786d717563393434687a75366e3671746c6a6365786b7568687a37366d75637874676d357830", ), types.NewChainConfig("cosmos"), time.Date(2020, 1, 2, 00, 00, 00, 000, time.UTC), diff --git a/x/profiles/types/models_chain_links.go b/x/profiles/types/models_chain_links.go index 1230d1326f..7888154134 100644 --- a/x/profiles/types/models_chain_links.go +++ b/x/profiles/types/models_chain_links.go @@ -68,6 +68,11 @@ func (p Proof) Validate() error { return fmt.Errorf("plain text cannot be empty or blank") } + _, err = hex.DecodeString(p.PlainText) + if err != nil { + return fmt.Errorf("invalid hex-encoded plain text") + } + return nil } @@ -80,8 +85,10 @@ func (p Proof) Verify(unpacker codectypes.AnyUnpacker, address AddressData) erro return fmt.Errorf("failed to unpack the public key") } + value, _ := hex.DecodeString(p.PlainText) + sig, _ := hex.DecodeString(p.Signature) - if !pubkey.VerifySignature([]byte(p.PlainText), sig) { + if !pubkey.VerifySignature(value, sig) { return fmt.Errorf("failed to verify the signature") } diff --git a/x/profiles/types/models_chain_links_test.go b/x/profiles/types/models_chain_links_test.go index 445637f684..153aac527c 100644 --- a/x/profiles/types/models_chain_links_test.go +++ b/x/profiles/types/models_chain_links_test.go @@ -75,12 +75,12 @@ func TestProof_Validate(t *testing.T) { }{ { name: "null public key returns error", - proof: types.Proof{Signature: "74657874", PlainText: "text"}, + proof: types.Proof{Signature: "74657874", PlainText: "74657874"}, shouldErr: true, }, { name: "invalid signature format returns error", - proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), "=", "text"), + proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), "=", "74657874"), shouldErr: true, }, { @@ -88,9 +88,14 @@ func TestProof_Validate(t *testing.T) { proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", ""), shouldErr: true, }, + { + name: "invalid plain text format returns error", + proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", "="), + shouldErr: true, + }, { name: "valid proof returns no error", - proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", "text"), + proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", "74657874"), shouldErr: false, }, } @@ -144,7 +149,7 @@ func TestProof_Verify(t *testing.T) { }{ { name: "Invalid public key value returns error", - proof: types.Proof{PubKey: invalidAny, Signature: bech32SigHex, PlainText: plainText}, + proof: types.Proof{PubKey: invalidAny, Signature: bech32SigHex, PlainText: hex.EncodeToString([]byte(plainText))}, addressData: types.NewBech32Address(bech32Addr, "cosmos"), shouldErr: true, }, @@ -156,31 +161,31 @@ func TestProof_Verify(t *testing.T) { }, { name: "wrong signature returns error", - proof: types.NewProof(bech32PubKey, "74657874", plainText), + proof: types.NewProof(bech32PubKey, "74657874", hex.EncodeToString([]byte(plainText))), addressData: types.NewBech32Address(bech32Addr, "cosmos"), shouldErr: true, }, { name: "wrong Bech32 address returns error", - proof: types.NewProof(bech32PubKey, bech32SigHex, plainText), + proof: types.NewProof(bech32PubKey, bech32SigHex, hex.EncodeToString([]byte(plainText))), addressData: types.NewBech32Address("cosmos1xcy3els9ua75kdm783c3qu0rfa2eplesldfevn", "cosmos"), shouldErr: true, }, { name: "wrong Base58 address returns error", - proof: types.NewProof(base58PubKey, base58SigHex, plainText), + proof: types.NewProof(base58PubKey, base58SigHex, hex.EncodeToString([]byte(plainText))), addressData: types.NewBase58Address("HWQ14mk82aRMAad2TdxFHbeqLeUGo5SiBxTXyZyTesJT"), shouldErr: true, }, { name: "correct proof with Base58 address returns no error", - proof: types.NewProof(base58PubKey, base58SigHex, plainText), + proof: types.NewProof(base58PubKey, base58SigHex, hex.EncodeToString([]byte(plainText))), addressData: types.NewBase58Address(base58Addr), shouldErr: false, }, { name: "correct proof with Bech32 address returns no error", - proof: types.NewProof(bech32PubKey, bech32SigHex, plainText), + proof: types.NewProof(bech32PubKey, bech32SigHex, hex.EncodeToString([]byte(plainText))), addressData: types.NewBech32Address(bech32Addr, "cosmos"), shouldErr: false, }, @@ -352,7 +357,7 @@ func TestChainLink_Validate(t *testing.T) { name: "empty address returns error", chainLink: types.ChainLink{ User: "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", - Proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), "=", "text"), + Proof: types.NewProof(secp256k1.GenPrivKey().PubKey(), "=", "74657874"), ChainConfig: types.NewChainConfig("cosmos"), CreationTime: time.Now(), }, @@ -363,7 +368,7 @@ func TestChainLink_Validate(t *testing.T) { chainLink: types.NewChainLink( "", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), "=", "text"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), "=", "74657874"), types.NewChainConfig("cosmos"), time.Now(), ), @@ -374,7 +379,7 @@ func TestChainLink_Validate(t *testing.T) { chainLink: types.NewChainLink( "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), "=", "text"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), "=", "74657874"), types.NewChainConfig("cosmos"), time.Now(), ), @@ -385,7 +390,7 @@ func TestChainLink_Validate(t *testing.T) { chainLink: types.NewChainLink( "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", "text"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", "74657874"), types.NewChainConfig(""), time.Now(), ), @@ -396,7 +401,7 @@ func TestChainLink_Validate(t *testing.T) { chainLink: types.NewChainLink( "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", "text"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", "74657874"), types.NewChainConfig("cosmos"), time.Time{}, ), @@ -407,7 +412,7 @@ func TestChainLink_Validate(t *testing.T) { chainLink: types.NewChainLink( "cosmos10clxpupsmddtj7wu7g0wdysajqwp890mva046f", types.NewBech32Address("cosmos1cjf97gpzwmaf30pzvaargfgr884mpp5ak8f7ns", "cosmos"), - types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", "text"), + types.NewProof(secp256k1.GenPrivKey().PubKey(), "74657874", "74657874"), types.NewChainConfig("cosmos"), time.Now(), ), diff --git a/x/profiles/types/models_packets_test.go b/x/profiles/types/models_packets_test.go index b2f9b9b007..629fb43eb8 100644 --- a/x/profiles/types/models_packets_test.go +++ b/x/profiles/types/models_packets_test.go @@ -21,14 +21,14 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { SourceProof: types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), SourceChainConfig: types.NewChainConfig("cosmos"), DestinationAddress: "cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", DestinationProof: types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), }, shouldErr: true, @@ -43,7 +43,7 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), ), shouldErr: true, @@ -55,14 +55,14 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), types.NewChainConfig(""), "cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), ), shouldErr: true, @@ -74,14 +74,14 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), types.NewChainConfig("cosmos"), "", types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), ), shouldErr: true, @@ -93,7 +93,7 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), types.NewChainConfig("cosmos"), "cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", @@ -108,14 +108,14 @@ func TestLinkChainAccountPacketData_Validate(t *testing.T) { types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), types.NewChainConfig("cosmos"), "cosmos1yt7rqhj0hjw92ed0948r2pqwtp9smukurqcs70", types.NewProof( secp256k1.GenPrivKey().PubKey(), "032086ede8d4bce29fe364a94744ca71dbeaf370221ba20f9716a165c54b079561", - "plain_text", + "706c61696e5f74657874", ), ), shouldErr: false, diff --git a/x/profiles/types/msgs_chain_links_test.go b/x/profiles/types/msgs_chain_links_test.go index ffafbb40e8..b65dd1a885 100644 --- a/x/profiles/types/msgs_chain_links_test.go +++ b/x/profiles/types/msgs_chain_links_test.go @@ -18,7 +18,7 @@ var msgChainLinkAccount = types.NewMsgLinkChainAccount( types.NewProof( testutil.PubKeyFromBech32("cosmospub1addwnpepq0j8zw4t6tg3v8gh7d2d799gjhue7ewwmpg2hwr77f9kuuyzgqtrw5r6wec"), "ad112abb30e5240c7b9d21b4cc5421d76cfadfcd5977cca262523b5f5bc759457d4aa6d5c1eb6223db104b47aa1f222468be8eb5bb2762b971622ac5b96351b5", - "text", + "74657874", ), types.NewChainConfig("cosmos"), "cosmos1u9hgsqfpe3snftr7p7fsyja3wtlmj2sgf2w9yl", @@ -99,7 +99,7 @@ func TestMsgLinkChainAccount_ValidateBasic(t *testing.T) { } func TestMsgLinkChainAccount_GetSignBytes(t *testing.T) { - expected := `{"type":"desmos/MsgLinkChainAccount","value":{"chain_address":{"prefix":"cosmos","value":"cosmos1xmquc944hzu6n6qtljcexkuhhz76mucxtgm5x0"},"chain_config":{"name":"cosmos"},"proof":{"plain_text":"text","pub_key":{"type":"tendermint/PubKeySecp256k1","value":"A+RxOqvS0RYdF/NU3xSolfmfZc7YUKu4fvJLbnCCQBY3"},"signature":"ad112abb30e5240c7b9d21b4cc5421d76cfadfcd5977cca262523b5f5bc759457d4aa6d5c1eb6223db104b47aa1f222468be8eb5bb2762b971622ac5b96351b5"},"signer":"cosmos1u9hgsqfpe3snftr7p7fsyja3wtlmj2sgf2w9yl"}}` + expected := `{"type":"desmos/MsgLinkChainAccount","value":{"chain_address":{"prefix":"cosmos","value":"cosmos1xmquc944hzu6n6qtljcexkuhhz76mucxtgm5x0"},"chain_config":{"name":"cosmos"},"proof":{"plain_text":"74657874","pub_key":{"type":"tendermint/PubKeySecp256k1","value":"A+RxOqvS0RYdF/NU3xSolfmfZc7YUKu4fvJLbnCCQBY3"},"signature":"ad112abb30e5240c7b9d21b4cc5421d76cfadfcd5977cca262523b5f5bc759457d4aa6d5c1eb6223db104b47aa1f222468be8eb5bb2762b971622ac5b96351b5"},"signer":"cosmos1u9hgsqfpe3snftr7p7fsyja3wtlmj2sgf2w9yl"}}` require.Equal(t, expected, string(msgChainLinkAccount.GetSignBytes())) }