Skip to content

Commit

Permalink
feat: ADR-008: Change the plain text encoding of links to hex (#652)
Browse files Browse the repository at this point in the history
## Description

This PR implements what's described inside [ADR-008](#642).
Closes: #636

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html)
- [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
  • Loading branch information
dadamu authored Oct 15, 2021
1 parent 36ad022 commit dd2162e
Show file tree
Hide file tree
Showing 18 changed files with 112 additions and 92 deletions.
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions app/desmos/cmd/chainlink/create_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion app/desmos/cmd/chainlink/create_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TestGetCreateChainLinkJSON(t *testing.T) {
profilestypes.NewProof(
key.GetPubKey(),
"c3bd014b2178d63d94b9c28e628bfcf56736de28f352841b0bb27d6fff2968d62c13a10aeddd1ebfe3b13f3f8e61f79a2c63ae6ff5cb78cb0d64e6b0a70fae57",
"cosmos13j7p6faa9jr8ty6lvqv0prldprr6m5xenmafnt"),
"636f736d6f7331336a377036666161396a72387479366c7671763070726c64707272366d3578656e6d61666e74"),
profilestypes.NewChainConfig("cosmos"),
)

Expand Down
6 changes: 3 additions & 3 deletions app/desmos/cmd/sign/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/desmos/cmd/sign/sign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion x/profiles/client/cli/cli_chain_links.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions x/profiles/client/cli/cli_chain_links_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions x/profiles/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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"),
)

Expand Down
12 changes: 6 additions & 6 deletions x/profiles/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
18 changes: 9 additions & 9 deletions x/profiles/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down
25 changes: 13 additions & 12 deletions x/profiles/keeper/keeper_chain_links_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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),
},
Expand All @@ -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),
),
Expand All @@ -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),
)
Expand All @@ -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),
),
Expand All @@ -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),
))
Expand All @@ -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),
),
Expand All @@ -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),
),
Expand All @@ -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),
),
Expand All @@ -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),
))
Expand Down Expand Up @@ -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),
)
Expand Down Expand Up @@ -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),
)
Expand All @@ -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),
)
Expand Down
Loading

0 comments on commit dd2162e

Please sign in to comment.