Skip to content

Commit

Permalink
fix: update regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyasbhat0 committed Sep 17, 2024
1 parent 051443a commit 652f72c
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 57 deletions.
3 changes: 3 additions & 0 deletions directory/indexer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ func convertEventToMap(event abcitypes.Event) (map[string]any, error) {
if attr.Key == "msg_index" {
continue
}
if attr.Key == "mode" {
continue
}
switch attrValue[0] {
case '{':
var nest any
Expand Down
39 changes: 17 additions & 22 deletions test/regression/mnt/exports/suites_contracts_pay-as-you-go.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"authorization": "STRICT",
"client": "tarkeopub1addwnpepq2res6tu0m73ulk5sepgp6g3y37schfgymxy8z6l3lc78k7ju9u45yajwem",
"delegate": "",
"deposit": "100",
"deposit": "3",
"duration": "10",
"height": "2",
"id": "1",
Expand All @@ -40,7 +40,7 @@
},
"service": 1,
"settlement_duration": "11",
"settlement_height": "0",
"settlement_height": "15",
"type": "PAY_AS_YOU_GO"
}
],
Expand Down Expand Up @@ -72,16 +72,7 @@
]
}
],
"user_contract_sets": [
{
"contract_set": {
"contract_ids": [
"1"
]
},
"user": "tarkeopub1addwnpepq2res6tu0m73ulk5sepgp6g3y37schfgymxy8z6l3lc78k7ju9u45yajwem"
}
],
"user_contract_sets": [],
"version": "0"
},
"auth": {
Expand Down Expand Up @@ -273,20 +264,11 @@
}
]
},
{
"address": "tarkeo1kz2dkl8zlxwte008astc5e65htrxdcse6x3h3h",
"coins": [
{
"amount": "97",
"denom": "uarkeo"
}
]
},
{
"address": "tarkeo1uhapc6jjq6ns0ydnk7zld5x7f5kl2ukemjw5fg",
"coins": [
{
"amount": "999999899999900",
"amount": "999999899999997",
"denom": "uarkeo"
}
]
Expand Down Expand Up @@ -340,6 +322,19 @@
}
]
},
"claimarkeo": {
"claim_records": [],
"module_account_balance": {
"amount": "0",
"denom": "uarkeo"
},
"params": {
"claim_denom": "uarkeo",
"duration_of_decay": "3600s",
"duration_until_decay": "3600s",
"initial_gas_amount": null
}
},
"crisis": {
"constant_fee": {
"amount": "1000",
Expand Down
43 changes: 19 additions & 24 deletions test/regression/mnt/exports/suites_contracts_subscription.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"height": "2",
"id": "1",
"nonce": "0",
"paid": "0",
"paid": "100",
"provider": "tarkeopub1addwnpepqtsg8syrpcn60t2nnvnhtk6psr8qxlrtwjk8rmpkhxk9vy9wkd8ewmqv7rh",
"queries_per_minute": "1",
"rate": {
Expand All @@ -40,7 +40,7 @@
},
"service": 1,
"settlement_duration": "11",
"settlement_height": "0",
"settlement_height": "12",
"type": "SUBSCRIPTION"
},
{
Expand Down Expand Up @@ -93,16 +93,7 @@
]
}
],
"user_contract_sets": [
{
"contract_set": {
"contract_ids": [
"1"
]
},
"user": "tarkeopub1addwnpepq2res6tu0m73ulk5sepgp6g3y37schfgymxy8z6l3lc78k7ju9u45yajwem"
}
],
"user_contract_sets": [],
"version": "0"
},
"auth": {
Expand Down Expand Up @@ -268,7 +259,7 @@
"address": "tarkeo1v0n7wer498vqq6yddkr4clg3lck7kaw9lstp4k",
"coins": [
{
"amount": "1000000000000018",
"amount": "1000000000000108",
"denom": "uarkeo"
}
]
Expand All @@ -277,7 +268,7 @@
"address": "tarkeo1d0m97ywk2y4vq58ud6q5e0r3q9khj9e3unfe4t",
"coins": [
{
"amount": "200000002",
"amount": "200000012",
"denom": "uarkeo"
}
]
Expand All @@ -291,15 +282,6 @@
}
]
},
{
"address": "tarkeo1kz2dkl8zlxwte008astc5e65htrxdcse6x3h3h",
"coins": [
{
"amount": "100",
"denom": "uarkeo"
}
]
},
{
"address": "tarkeo1uhapc6jjq6ns0ydnk7zld5x7f5kl2ukemjw5fg",
"coins": [
Expand Down Expand Up @@ -358,6 +340,19 @@
}
]
},
"claimarkeo": {
"claim_records": [],
"module_account_balance": {
"amount": "0",
"denom": "uarkeo"
},
"params": {
"claim_denom": "uarkeo",
"duration_of_decay": "3600s",
"duration_until_decay": "3600s",
"initial_gas_amount": null
}
},
"crisis": {
"constant_fee": {
"amount": "1000",
Expand Down Expand Up @@ -708,7 +703,7 @@
"upgrade": {},
"vesting": {}
},
"app_version": "v1.0.0-prerelease",
"app_version": "v1.0.0-prerelease",
"chain_id": "arkeo",
"consensus": {
"params": {
Expand Down
15 changes: 14 additions & 1 deletion test/regression/mnt/exports/suites_core_send.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,19 @@
}
]
},
"claimarkeo": {
"claim_records": [],
"module_account_balance": {
"amount": "0",
"denom": "uarkeo"
},
"params": {
"claim_denom": "uarkeo",
"duration_of_decay": "3600s",
"duration_until_decay": "3600s",
"initial_gas_amount": null
}
},
"crisis": {
"constant_fee": {
"amount": "1000",
Expand Down Expand Up @@ -565,7 +578,7 @@
"upgrade": {},
"vesting": {}
},
"app_version": "v1.0.0-prerelease",
"app_version": "v1.0.0-prerelease",
"chain_id": "arkeo",
"consensus": {
"params": {
Expand Down
15 changes: 14 additions & 1 deletion test/regression/mnt/exports/suites_initialize.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,19 @@
}
]
},
"claimarkeo": {
"claim_records": [],
"module_account_balance": {
"amount": "0",
"denom": "uarkeo"
},
"params": {
"claim_denom": "uarkeo",
"duration_of_decay": "3600s",
"duration_until_decay": "3600s",
"initial_gas_amount": null
}
},
"crisis": {
"constant_fee": {
"amount": "1000",
Expand Down Expand Up @@ -562,7 +575,7 @@
"upgrade": {},
"vesting": {}
},
"app_version": "v1.0.0-prerelease",
"app_version": "v1.0.0-prerelease",
"chain_id": "arkeo",
"consensus": {
"params": {
Expand Down
13 changes: 13 additions & 0 deletions test/regression/mnt/exports/suites_providers_providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,19 @@
}
]
},
"claimarkeo": {
"claim_records": [],
"module_account_balance": {
"amount": "0",
"denom": "uarkeo"
},
"params": {
"claim_denom": "uarkeo",
"duration_of_decay": "3600s",
"duration_until_decay": "3600s",
"initial_gas_amount": null
}
},
"crisis": {
"constant_fee": {
"amount": "1000",
Expand Down
13 changes: 13 additions & 0 deletions test/regression/mnt/exports/suites_sentinel_contract_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@
}
]
},
"claimarkeo": {
"claim_records": [],
"module_account_balance": {
"amount": "0",
"denom": "uarkeo"
},
"params": {
"claim_denom": "uarkeo",
"duration_of_decay": "3600s",
"duration_until_decay": "3600s",
"initial_gas_amount": null
}
},
"crisis": {
"constant_fee": {
"amount": "1000",
Expand Down
13 changes: 13 additions & 0 deletions test/regression/mnt/exports/suites_sentinel_sentinel.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,19 @@
}
]
},
"claimarkeo": {
"claim_records": [],
"module_account_balance": {
"amount": "0",
"denom": "uarkeo"
},
"params": {
"claim_denom": "uarkeo",
"duration_of_decay": "3600s",
"duration_until_decay": "3600s",
"initial_gas_amount": null
}
},
"crisis": {
"constant_fee": {
"amount": "1000",
Expand Down
6 changes: 3 additions & 3 deletions test/regression/suites/contracts/pay-as-you-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,12 @@ description: cat account balance should increase
endpoint: http://localhost:1317/cosmos/bank/v1beta1/balances/{{ addr_cat }}
asserts:
- .balances|length == 1
- .balances[]|select(.denom == "uarkeo")|.amount|tonumber == 999999899999900
- .balances[]|select(.denom == "uarkeo")|.amount|tonumber == 999999899999997
---
type: check
description: ensure contract is closed
endpoint: http://localhost:1317/arkeo/contract/1
asserts:
- .contract.paid == "3"
- .contract.deposit == "100"
---
- .contract.deposit == "3"
---
12 changes: 6 additions & 6 deletions test/regression/suites/contracts/subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ type: check
description: ensure contract is closed
endpoint: http://localhost:1317/arkeo/contract/1
asserts:
- .contract.paid == "0"
- .contract.paid == "100"
---
type: check
description: fox account balance should increase
endpoint: http://localhost:1317/cosmos/bank/v1beta1/balances/{{ addr_fox }}
asserts:
- .balances|length == 1
- .balances[]|select(.denom == "uarkeo")|.amount|tonumber == 1000000000000000 # fox gets 90 due to 10% tax to reserve
- .balances[]|select(.denom == "uarkeo")|.amount|tonumber == 1000000000000090 # fox gets 90 due to 10% tax to reserve
---
type: check
description: check that contract is in directory service
Expand All @@ -111,8 +111,8 @@ asserts:
- .client_pubkey == "tarkeopub1addwnpepq2res6tu0m73ulk5sepgp6g3y37schfgymxy8z6l3lc78k7ju9u45yajwem"
- .contract_type == "SUBSCRIPTION"
- .settlement_duration == 11
- .paid == 0
- .reserve_contrib_asset == 0
- .paid == 100
- .reserve_contrib_asset == 10
# - .reserve_contrib_usd == 10 # TODO
---
########################################################################################
Expand Down Expand Up @@ -209,7 +209,7 @@ description: fox account balance should increase
endpoint: http://localhost:1317/cosmos/bank/v1beta1/balances/{{ addr_fox }}
asserts:
- .balances|length == 1
- .balances[]|select(.denom == "uarkeo")|.amount|tonumber == 1000000000000018
- .balances[]|select(.denom == "uarkeo")|.amount|tonumber == 1000000000000108
---
type: check
description: ensure contract is closed
Expand All @@ -225,4 +225,4 @@ asserts:
- .paid == 20
- .reserve_contrib_asset == 2
# - .reserve_contrib_usd == 10 # TODO
- .settlement_duration == 11
- .settlement_duration == 11

0 comments on commit 652f72c

Please sign in to comment.