Update tests (new default contract addr)
This commit is contained in:
@@ -474,7 +474,7 @@ func TestImportContractWithCodeHistoryReset(t *testing.T) {
|
||||
],
|
||||
"contracts": [
|
||||
{
|
||||
"contract_address": "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5",
|
||||
"contract_address": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhuc53mp6",
|
||||
"contract_info": {
|
||||
"code_id": "1",
|
||||
"creator": "cosmos13x849jzd03vne42ynpj25hn8npjecxqrjghd8x",
|
||||
@@ -533,7 +533,7 @@ func TestImportContractWithCodeHistoryReset(t *testing.T) {
|
||||
assert.Equal(t, expCodeInfo, *gotCodeInfo)
|
||||
|
||||
// verify contract
|
||||
contractAddr, _ := sdk.AccAddressFromBech32("cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5")
|
||||
contractAddr, _ := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhuc53mp6")
|
||||
gotContractInfo := keeper.GetContractInfo(ctx, contractAddr)
|
||||
require.NotNil(t, gotContractInfo)
|
||||
contractCreatorAddr := "cosmos13x849jzd03vne42ynpj25hn8npjecxqrjghd8x"
|
||||
|
||||
@@ -280,7 +280,7 @@ func TestInstantiate(t *testing.T) {
|
||||
// create with no balance is also legal
|
||||
gotContractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, codeID, creator, nil, initMsgBz, "demo contract 1", nil)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", gotContractAddr.String())
|
||||
require.Equal(t, "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhuc53mp6", gotContractAddr.String())
|
||||
|
||||
gasAfter := ctx.GasMeter().GasConsumed()
|
||||
if types.EnableGasVerification {
|
||||
@@ -481,7 +481,7 @@ func TestExecute(t *testing.T) {
|
||||
|
||||
addr, _, err := keepers.ContractKeeper.Instantiate(ctx, contractID, creator, nil, initMsgBz, "demo contract 3", deposit)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", addr.String())
|
||||
require.Equal(t, "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhuc53mp6", addr.String())
|
||||
|
||||
// ensure bob doesn't exist
|
||||
bobAcct := accKeeper.GetAccount(ctx, bob)
|
||||
@@ -1163,7 +1163,7 @@ func TestSudo(t *testing.T) {
|
||||
|
||||
addr, _, err := keepers.ContractKeeper.Instantiate(ctx, contractID, creator, nil, initMsgBz, "demo contract 3", deposit)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5", addr.String())
|
||||
require.Equal(t, "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhuc53mp6", addr.String())
|
||||
|
||||
// the community is broke
|
||||
_, _, community := keyPubAddr()
|
||||
@@ -1501,7 +1501,6 @@ func TestBuildContractAddress(t *testing.T) {
|
||||
specs := map[string]struct {
|
||||
srcCodeID uint64
|
||||
srcInstanceID uint64
|
||||
expPanic bool
|
||||
}{
|
||||
"both empty": {},
|
||||
"both below max": {
|
||||
@@ -1512,23 +1511,17 @@ func TestBuildContractAddress(t *testing.T) {
|
||||
srcCodeID: math.MaxUint32,
|
||||
srcInstanceID: math.MaxUint32,
|
||||
},
|
||||
"codeID > max": {
|
||||
srcCodeID: math.MaxUint32 + 1,
|
||||
expPanic: true,
|
||||
"codeID > max u32": {
|
||||
srcCodeID: math.MaxUint32 + 1,
|
||||
srcInstanceID: 17,
|
||||
},
|
||||
"instanceID > max": {
|
||||
"instanceID > max u32": {
|
||||
srcCodeID: 22,
|
||||
srcInstanceID: math.MaxUint32 + 1,
|
||||
expPanic: true,
|
||||
},
|
||||
}
|
||||
for name, spec := range specs {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
if spec.expPanic {
|
||||
require.Panics(t, func() {
|
||||
BuildContractAddress(spec.srcCodeID, spec.srcInstanceID)
|
||||
})
|
||||
return
|
||||
}
|
||||
gotAddr := BuildContractAddress(spec.srcCodeID, spec.srcInstanceID)
|
||||
require.NotNil(t, gotAddr)
|
||||
assert.Nil(t, sdk.VerifyAddressFormat(gotAddr))
|
||||
|
||||
@@ -98,7 +98,7 @@ func TestInstantiateProposal(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// then
|
||||
contractAddr, err := sdk.AccAddressFromBech32("cosmos18vd8fpwxzck93qlwghaj6arh4p7c5n89uzcee5")
|
||||
contractAddr, err := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhuc53mp6")
|
||||
require.NoError(t, err)
|
||||
|
||||
cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr)
|
||||
|
||||
Reference in New Issue
Block a user