Skip to content

Commit

Permalink
fix threshold encode
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Sep 27, 2024
1 parent f2181f7 commit d7dc694
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 34 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ require (

replace (
// release/v0.50.x
cosmossdk.io/client/v2 => github.com/mmsqe/cosmos-sdk/client/v2 v2.0.0-20240926072432-2a329c06bee2
cosmossdk.io/store => github.com/mmsqe/cosmos-sdk/store v0.0.0-20240926072432-2a329c06bee2
cosmossdk.io/x/tx => github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20240926072432-2a329c06bee2
github.com/cosmos/cosmos-sdk => github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20240926072432-2a329c06bee2
cosmossdk.io/client/v2 => github.com/mmsqe/cosmos-sdk/client/v2 v2.0.0-20240927050756-4d8162ae3f7a
cosmossdk.io/store => github.com/mmsqe/cosmos-sdk/store v0.0.0-20240927050756-4d8162ae3f7a
cosmossdk.io/x/tx => github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20240927050756-4d8162ae3f7a
github.com/cosmos/cosmos-sdk => github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20240927050756-4d8162ae3f7a
)

replace (
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -874,14 +874,14 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A=
github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4=
github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20240926072432-2a329c06bee2 h1:aphpEkt5vGb1tGQHzATdNbuQf0jer8LMnhwgrBIgmNk=
github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20240926072432-2a329c06bee2/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E=
github.com/mmsqe/cosmos-sdk/client/v2 v2.0.0-20240926072432-2a329c06bee2 h1:W1M70iuJu2vp/lCdjMG5PEz1eZrVwpUXhfjSnVZBEyU=
github.com/mmsqe/cosmos-sdk/client/v2 v2.0.0-20240926072432-2a329c06bee2/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0=
github.com/mmsqe/cosmos-sdk/store v0.0.0-20240926072432-2a329c06bee2 h1:Ov69kMGaDXgA4ZXzhilWTGfen/oetAI+odXwYhcVIj0=
github.com/mmsqe/cosmos-sdk/store v0.0.0-20240926072432-2a329c06bee2/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20240926072432-2a329c06bee2 h1:h9W3s9qyBlu8uBpwBM6ifn+kl6+C0vjAk/277Xkh0YA=
github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20240926072432-2a329c06bee2/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY=
github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20240927050756-4d8162ae3f7a h1:4afbdA2U7FZbGBwgISAaXYPMDgNOGHlkeJwvaCTZNVQ=
github.com/mmsqe/cosmos-sdk v0.46.0-beta2.0.20240927050756-4d8162ae3f7a/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E=
github.com/mmsqe/cosmos-sdk/client/v2 v2.0.0-20240927050756-4d8162ae3f7a h1:GGjqRkX8WZa0T0lQ+Ox4Lab1NwOwqzh9BgnGMG6B0Jw=
github.com/mmsqe/cosmos-sdk/client/v2 v2.0.0-20240927050756-4d8162ae3f7a/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0=
github.com/mmsqe/cosmos-sdk/store v0.0.0-20240927050756-4d8162ae3f7a h1:echGnYz/jaw948wNvvbokO6sy9YJv8kPYUOp1xxw4xo=
github.com/mmsqe/cosmos-sdk/store v0.0.0-20240927050756-4d8162ae3f7a/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20240927050756-4d8162ae3f7a h1:7R2bl/UvKZRXnXFzDaY5cYVku8x/V//zj8VH2ilWn+o=
github.com/mmsqe/cosmos-sdk/x/tx v0.0.0-20240927050756-4d8162ae3f7a/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand Down
10 changes: 5 additions & 5 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ schema = 3
version = "v0.7.5"
hash = "sha256-Nuw697sJr56kU3EU7DV1eYNkyI76psznIVqYAV6RfbQ="
[mod."cosmossdk.io/client/v2"]
version = "v2.0.0-20240926072432-2a329c06bee2"
version = "v2.0.0-20240927050756-4d8162ae3f7a"
hash = "sha256-60hmufv3Ml4Pv3zNwgn8eeqlEINOR6n9MKr2QHddoxo="
replaced = "github.com/mmsqe/cosmos-sdk/client/v2"
[mod."cosmossdk.io/collections"]
Expand All @@ -42,7 +42,7 @@ schema = 3
version = "v1.3.0"
hash = "sha256-EEFK43Cr0g0ndhQhkIKher0FqV3mvkmE9z0sP7uVSHg="
[mod."cosmossdk.io/store"]
version = "v0.0.0-20240926072432-2a329c06bee2"
version = "v0.0.0-20240927050756-4d8162ae3f7a"
hash = "sha256-Dm3sSZNJBcnBF33PULoTpK4rkNQbsZl0DfTqH1GPCQM="
replaced = "github.com/mmsqe/cosmos-sdk/store"
[mod."cosmossdk.io/tools/confix"]
Expand All @@ -55,8 +55,8 @@ schema = 3
version = "v0.1.0"
hash = "sha256-/gWvrqvy6bW90+NU66T+9QysYgvG1VbwfYJZ8tkqpeA="
[mod."cosmossdk.io/x/tx"]
version = "v0.0.0-20240926072432-2a329c06bee2"
hash = "sha256-/KS4Tw8nlY9TeQRInICFs0LkjAIjyMflHvp7LztrJxs="
version = "v0.0.0-20240927050756-4d8162ae3f7a"
hash = "sha256-5HPcm3oCWAC9oKOGMP+PVMdCPF7ELVHmxpN1FasUgAY="
replaced = "github.com/mmsqe/cosmos-sdk/x/tx"
[mod."cosmossdk.io/x/upgrade"]
version = "v0.1.1"
Expand Down Expand Up @@ -163,7 +163,7 @@ schema = 3
version = "v1.0.0-beta.5"
hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.46.0-beta2.0.20240926072432-2a329c06bee2"
version = "v0.46.0-beta2.0.20240927050756-4d8162ae3f7a"
hash = "sha256-/5W/4n6getoWtj/MIotvel86dcJUD7jm9a4aDdDD95w="
replaced = "github.com/mmsqe/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/configs/default.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
mnemonic: '${COMMUNITY_MNEMONIC}',
}, {
name: 'signer1',
coins: '100multi,20000000000000000000000aphoton',
coins: '20000000000000000000000aphoton',
mnemonic: '${SIGNER1_MNEMONIC}',
}, {
name: 'signer2',
Expand Down
5 changes: 4 additions & 1 deletion tests/integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,12 @@ def combine_batch_multisig_tx(
def broadcast_tx(self, tx_file, **kwargs):
kwargs.setdefault("broadcast_mode", "sync")
kwargs.setdefault("output", "json")
return json.loads(
rsp = json.loads(
self.raw("tx", "broadcast", tx_file, node=self.node_rpc, **kwargs)
)
if rsp["code"] == 0:
rsp = self.event_query_tx_for(rsp["txhash"])
return rsp

def broadcast_tx_json(self, tx, **kwargs):
with tempfile.NamedTemporaryFile("w") as fp:
Expand Down
21 changes: 6 additions & 15 deletions tests/integration_tests/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,37 +79,27 @@ def test_multisig(ethermint, tmp_path):
cli.make_multisig("multitest1", "signer1", "signer2")
multi_addr = cli.address("multitest1")
signer1 = cli.address("signer1")
signer2 = cli.address("signer2")
max_gas = 1000000
gas_price = 10000000000000000
limit = f"{max_gas*gas_price*2}aphoton"
rsp = cli.grant(signer1, multi_addr, limit)
assert rsp["code"] == 0, rsp["raw_log"]
grant_detail = cli.query_grant(signer1, multi_addr)
assert grant_detail["granter"] == signer1
assert grant_detail["grantee"] == multi_addr

denom = "multi"
amt = 10
denom = "aphoton"
amt = 2000000000000000000
rsp = cli.transfer(signer1, multi_addr, f"{amt}{denom}")
assert rsp["code"] == 0, rsp["raw_log"]
assert cli.balance(multi_addr, denom=denom) == amt

acc = cli.account(multi_addr)
res = cli.account_by_num(acc["account"]["value"]["base_account"]["account_number"])
acc = cli.account(multi_addr)["account"]["value"]["base_account"]
res = cli.account_by_num(acc["account_number"])
assert res["account_address"] == multi_addr

m_txt = tmp_path / "m.txt"
p1_txt = tmp_path / "p1.txt"
p2_txt = tmp_path / "p2.txt"
tx_txt = tmp_path / "tx.txt"
amt = 1
signer2 = cli.address("signer2")
multi_tx = cli.transfer(
multi_addr,
signer2,
f"{amt}{denom}",
generate_only=True,
fee_granter=signer1,
)
json.dump(multi_tx, m_txt.open("w"))
signature1 = cli.sign_multisig_tx(m_txt, multi_addr, "signer1")
Expand All @@ -125,3 +115,4 @@ def test_multisig(ethermint, tmp_path):
json.dump(final_multi_tx, tx_txt.open("w"))
rsp = cli.broadcast_tx(tx_txt)
assert rsp["code"] == 0, rsp["raw_log"]
assert cli.account(multi_addr)["account"]["value"]["base_account"]["address"] == acc["address"]

Check failure on line 118 in tests/integration_tests/test_batch.py

View workflow job for this annotation

GitHub Actions / Run flake8 on python integration tests

./tests/integration_tests/test_batch.py:118:89: E501 line too long (99 > 88 characters)

0 comments on commit d7dc694

Please sign in to comment.