Skip to content

Commit

Permalink
Problem: address-by-acc-num query with id instead of account_id (#1609)
Browse files Browse the repository at this point in the history
* Problem: address-by-acc-num query with id instead of account_id

* update deps
  • Loading branch information
mmsqe authored Sep 26, 2024
1 parent 330a9cc commit e1cf56b
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
* [#1600](https://github.com/crypto-org-chain/cronos/pull/1600) Update ethermint to avoid unnecessary block result in header related api call.
* [#1606](https://github.com/crypto-org-chain/cronos/pull/1606) Fix pebbledb support.

### Bug Fixes

* [#1609](https://github.com/crypto-org-chain/cronos/pull/1609) Fix query address-by-acc-num by account_id instead of id.

*Sep 13, 2024*

## v1.4.0-rc0
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ require (

// release/v0.50.x
replace (
cosmossdk.io/client/v2 => github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240916022730-3317ca17f0f1
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240916022730-3317ca17f0f1
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240916022730-3317ca17f0f1
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240916022730-3317ca17f0f1
cosmossdk.io/client/v2 => github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240926054726-1675d17877a6
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240926054726-1675d17877a6
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240926054726-1675d17877a6
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240926054726-1675d17877a6
)

replace (
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,14 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c h1:MOgfS4+FBB8cMkDE2j2VBVsbY+HCkPIu0YsJ/9bbGeQ=
github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240916022730-3317ca17f0f1 h1:lWStPYj3ULmU5hRBFxR06QPK8Tp3v2t0qEBcEUHUjlk=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240916022730-3317ca17f0f1/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E=
github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240916022730-3317ca17f0f1 h1:m1ayhc+L/fZ+1uregeAZt4GB7Il8oviJ/znWZyK4X94=
github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240916022730-3317ca17f0f1/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240916022730-3317ca17f0f1 h1:27XoLx7tmWPV/yBV21zVLoOyQVpB2vY7fvfI9DZk0+0=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240916022730-3317ca17f0f1/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240916022730-3317ca17f0f1 h1:yKiDUGCgeFiM5RLwS8IPp0BmdQANVJN7qDTCdFCPLyE=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240916022730-3317ca17f0f1/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240926054726-1675d17877a6 h1:XQIkx8K/xNQaUc3ZpIJXkNV0YnhIdY2nN+9rzZ+jin4=
github.com/crypto-org-chain/cosmos-sdk v0.50.6-0.20240926054726-1675d17877a6/go.mod h1:Rb43DdB0i/rKcCN69Tg2X3+zA4WhJ7MC8K3a6Ezh38E=
github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240926054726-1675d17877a6 h1:Me9XgQhWuwscdIZWx8wE11miaqIEff9P+HQAEbT6MNY=
github.com/crypto-org-chain/cosmos-sdk/client/v2 v2.0.0-20240926054726-1675d17877a6/go.mod h1:W5sR4asmVDUhJpEmuXTUBkk/yEefKlXTjVWcNciVSR0=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240926054726-1675d17877a6 h1:MzDuYnr9KDb+9N5ZjU5UJSpif9rGATIXI15FqQBGw/E=
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20240926054726-1675d17877a6/go.mod h1:gjE3DZe4t/+VeIk6CmrouyqiuDbZ7QOVDDq3nLqBTpg=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240926054726-1675d17877a6 h1:ETMIWPL33D0bC2WNotH57i3aza2r9C3UKRgMDVeLlII=
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20240926054726-1675d17877a6/go.mod h1:RTiTs4hkXG6IvYGknvB8p79YgjYJdcbzLUOGJChsPnY=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240925024103-f2a562ba9b9f h1:Moucz7HfXoyNishzeMJOVbUdeLueOMAbNwnEN5M+iS8=
github.com/crypto-org-chain/ethermint v0.6.1-0.20240925024103-f2a562ba9b9f/go.mod h1:D2lnc8ARuVmgc2/2IWla2Ky1o8/pjmyrnIt+d46Clco=
github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 h1:OvD5Rm0B6LHUJk6z858UgwdP72jU2DuUdXeclRyKpDI=
Expand Down
10 changes: 5 additions & 5 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ schema = 3
version = "v0.7.5"
hash = "sha256-Nuw697sJr56kU3EU7DV1eYNkyI76psznIVqYAV6RfbQ="
[mod."cosmossdk.io/client/v2"]
version = "v2.0.0-20240916022730-3317ca17f0f1"
version = "v2.0.0-20240926054726-1675d17877a6"
hash = "sha256-60hmufv3Ml4Pv3zNwgn8eeqlEINOR6n9MKr2QHddoxo="
replaced = "github.com/crypto-org-chain/cosmos-sdk/client/v2"
[mod."cosmossdk.io/collections"]
Expand All @@ -48,7 +48,7 @@ schema = 3
version = "v0.0.0-20230608160436-666c345ad23d"
hash = "sha256-6BMBA98BpK3jG6++ZE4LdPQwwpS+lZ0GLMRF1fO4UfM="
[mod."cosmossdk.io/store"]
version = "v0.0.0-20240916022730-3317ca17f0f1"
version = "v0.0.0-20240926054726-1675d17877a6"
hash = "sha256-Dm3sSZNJBcnBF33PULoTpK4rkNQbsZl0DfTqH1GPCQM="
replaced = "github.com/crypto-org-chain/cosmos-sdk/store"
[mod."cosmossdk.io/tools/confix"]
Expand All @@ -61,7 +61,7 @@ schema = 3
version = "v0.1.1"
hash = "sha256-aps3LfnQau1TYeccGwtqHQvy1Rudc9+O+iVAwXBKyDw="
[mod."cosmossdk.io/x/tx"]
version = "v0.0.0-20240916022730-3317ca17f0f1"
version = "v0.0.0-20240926054726-1675d17877a6"
hash = "sha256-xT5IdapEx1h46ofBpxcBQfzGF2EntmC8xZl7aym/6xE="
replaced = "github.com/crypto-org-chain/cosmos-sdk/x/tx"
[mod."cosmossdk.io/x/upgrade"]
Expand Down Expand Up @@ -174,8 +174,8 @@ schema = 3
version = "v1.0.0-beta.5"
hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.50.6-0.20240916022730-3317ca17f0f1"
hash = "sha256-ehNXD1RsXdC+Et+RrwuycvJBQ2yQnPNQIAb1JCUM77U="
version = "v0.50.6-0.20240926054726-1675d17877a6"
hash = "sha256-/5W/4n6getoWtj/MIotvel86dcJUD7jm9a4aDdDD95w="
replaced = "github.com/crypto-org-chain/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
Expand Down
12 changes: 12 additions & 0 deletions integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,18 @@ def account(self, addr):
)
)

def account_by_num(self, num):
return json.loads(
self.raw(
"q",
"auth",
"address-by-acc-num",
num,
output="json",
node=self.node_rpc,
)
)

def total_supply(self):
return json.loads(
self.raw("query", "bank", "total", output="json", node=self.node_rpc)
Expand Down
11 changes: 11 additions & 0 deletions integration_tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,3 +974,14 @@ def test_block_stm_delete(cronos):
res = w3.eth.wait_for_transaction_receipt(txhash)
assert res.status == 1
w3_wait_for_block(w3, w3.eth.block_number + 3, timeout=30)


def test_multi_acc(cronos):
cli = cronos.cosmos_cli()
cli.make_multisig("multitest1", "signer1", "signer2")
multi_addr = cli.address("multitest1")
signer1 = cli.address("signer1")
cli.transfer(signer1, multi_addr, "1basetcro")
acc = cli.account(multi_addr)
res = cli.account_by_num(acc["account"]["value"]["base_account"]["account_number"])
assert res["account_address"] == multi_addr

0 comments on commit e1cf56b

Please sign in to comment.