mirror of https://github.com/certusone/wasmd.git
Update simulation test to the high-level behavior we want - simulate than create for real
This commit is contained in:
parent
74bd873152
commit
9dda90cdf6
|
@ -93,12 +93,21 @@ func TestCreateWithSimulation(t *testing.T) {
|
|||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
contractID, err := keeper.Create(ctx, creator, wasmCode, "https://github.com/cosmwasm/wasmd/blob/master/x/wasm/testdata/escrow.wasm", "cosmwasm-opt:0.5.2")
|
||||
// create this once in simulation mode
|
||||
contractID, err := keeper.Create(ctx, creator, wasmCode, "https://github.com/cosmwasm/wasmd/blob/master/x/wasm/testdata/escrow.wasm", "confio/cosmwasm-opt:0.57.2")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, uint64(1), contractID)
|
||||
|
||||
// then try to create it in non-simulation mode (should not fail)
|
||||
ctx, accKeeper, keeper = CreateTestInput(t, false, tempDir)
|
||||
contractID, err = keeper.Create(ctx, creator, wasmCode, "https://github.com/cosmwasm/wasmd/blob/master/x/wasm/testdata/escrow.wasm", "confio/cosmwasm-opt:0.7.2")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, uint64(1), contractID)
|
||||
|
||||
// and verify content
|
||||
_, err = keeper.GetByteCode(ctx, contractID)
|
||||
require.Error(t, err, os.ErrNotExist)
|
||||
code, err := keeper.GetByteCode(ctx, contractID)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, code, wasmCode)
|
||||
}
|
||||
|
||||
func TestIsSimulationMode(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue