-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add system tests #1411
Add system tests #1411
Conversation
tests/system/cli.go
Outdated
@@ -263,7 +263,7 @@ func (c WasmdCli) QuerySmart(contractAddr, msg string, args ...string) string { | |||
} | |||
|
|||
// QueryBalances queries all balances for an account. Returns json response | |||
// Example:`{"balances":[{"denom":"node0token","amount":"1000000000"},{"denom":"utgd","amount":"400000003"}],"pagination":{}}` | |||
// Example:`{"balances":[{"denom":"node0token","amount":"1000000000"},{"denom":"ustake","amount":"400000003"}],"pagination":{}}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good 👁️ ! Please use stake
here and everywhere else instead of ustake
. stake is the
sdk.DefaultBondDenom` .
// Example:`{"balances":[{"denom":"node0token","amount":"1000000000"},{"denom":"ustake","amount":"400000003"}],"pagination":{}}` | |
// Example:`{"balances":[{"denom":"node0token","amount":"1000000000"},{"denom":"stake","amount":"400000003"}],"pagination":{}}` |
@@ -284,23 +284,6 @@ func (c WasmdCli) QueryTotalSupply(denom string) int64 { | |||
return gjson.Get(raw, "amount").Int() | |||
} | |||
|
|||
// QueryValidator queries the validator for the given operator address. Returns json response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Codecov Report
@@ Coverage Diff @@
## 1362_tests #1411 +/- ##
==============================================
- Coverage 60.14% 60.03% -0.12%
==============================================
Files 60 61 +1
Lines 7557 7571 +14
==============================================
Hits 4545 4545
- Misses 2676 2690 +14
Partials 336 336
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress! 👏
@@ -95,6 +95,20 @@ jobs: | |||
- "profiles/*" | |||
- store_artifacts: | |||
path: /tmp/logs | |||
|
|||
test-system: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
cmd/wasmd/root.go
Outdated
@@ -31,6 +32,7 @@ import ( | |||
"github.com/spf13/cast" | |||
"github.com/spf13/cobra" | |||
"github.com/spf13/viper" | |||
tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd/wasmd/root.go
Outdated
@@ -302,3 +305,26 @@ func appExport( | |||
|
|||
return wasmApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) | |||
} | |||
|
|||
// extendUnsafeResetAllCmd - also clear wasm dir | |||
func extendUnsafeResetAllCmd(rootCmd *cobra.Command) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, you copied this over already. I had opened #1414 for this.
I was wondering if we want this here or in x/wasm/cli
?
go.mod
Outdated
@@ -40,6 +40,7 @@ require ( | |||
github.com/cometbft/cometbft v0.37.1 | |||
github.com/cometbft/cometbft-db v0.7.0 | |||
github.com/spf13/viper v1.15.0 | |||
github.com/tendermint/tendermint v0.35.9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -142,7 +142,7 @@ func UpdateInstantiateConfigCmd() *cobra.Command { | |||
} | |||
|
|||
msg := types.MsgUpdateInstantiateConfig{ | |||
Sender: string(clientCtx.GetFromAddress()), | |||
Sender: clientCtx.GetFromAddress().String(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Can you backport this for v0.40?
|
||
qResult = cli.CustomQuery("q", "wasm", "contract", newContractAddr) | ||
actualAdmin := gjson.Get(qResult, "contract_info.admin").String() | ||
assert.Equal(t, newAdmin, actualAdmin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good tests!
tests/system/cli.go
Outdated
@@ -256,14 +256,36 @@ func (c WasmdCli) WasmInstantiate(codeID int, initMsg string, args ...string) st | |||
return addr | |||
} | |||
|
|||
// Stake delegates amount to given validator | |||
func (c WasmdCli) Stake(validatorAddr, amount string, args ...string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 We should be careful to not blow up the CLI with too many features. If this is some common command then let's add it here to make the tests more readable otherwise it is better to have them in the test itself.
tests/system/cli_test.go
Outdated
assert.Equal(t, sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(200000002))), getGenesisBalance([]byte(raw), vest3Addr)) | ||
} | ||
|
||
func TestStakeUnstake(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this to a new file. How about staking_tests.go
?
}) | ||
} | ||
|
||
func TestVestingAccounts(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this was a some work to port it. I would have skipped this test as it is testing the genesis generation only, which is not part of wasmd.
tests/system/fraud_test.go
Outdated
) | ||
|
||
func TestRecursiveMsgsExternalTrigger(t *testing.T) { | ||
t.Skip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is WIP ?
* Updates * Minor cleanup * Make tests pass
* Start system tests * Go mod tidy * Add system tests (#1411) * Add tests * Add test-system to CI * Fix path * Remove store artifact steps * Add small fixes * Add stake/unstake tests * Add unsafe-reset-all extention + system test * Replace ustake with stake * Add more tests + fix bug in cli * Fix comments and add multi contract system test * Updates and fixes to system tests (#1449) * Updates * Minor cleanup * Make tests pass --------- Co-authored-by: Alexander Peters <[email protected]> * Fix Makefile to return exit code for system tests (#1450) * Abort on error results --------- Co-authored-by: pinosu <[email protected]>
No description provided.