Review feedback

This commit is contained in:
Alex Peters 2020-11-17 13:43:51 +01:00
parent 6a920852bf
commit 0589dfa76a
No known key found for this signature in database
GPG Key ID: 4E18CD9F98929E11
3 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,7 @@ func TestStoreCodeProposal(t *testing.T) {
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
require.NoError(t, err)
myActorAddress := AnyAccAddress(t)
myActorAddress := RandomBech32AccountAddress(t)
src := types.StoreCodeProposalFixture(func(p *types.StoreCodeProposal) {
p.RunAs = myActorAddress

View File

@ -37,7 +37,7 @@ func TestQueryAllContractState(t *testing.T) {
expModelContains: contractModel,
},
"query all with unknown address": {
srcQuery: &types.QueryAllContractStateRequest{Address: AnyAccAddress(t)},
srcQuery: &types.QueryAllContractStateRequest{Address: RandomBech32AccountAddress(t)},
expErr: types.ErrNotFound,
},
}
@ -82,7 +82,7 @@ func TestQuerySmartContractState(t *testing.T) {
expErr: types.ErrQueryFailed,
},
"query smart with unknown address": {
srcQuery: &types.QuerySmartContractStateRequest{Address: AnyAccAddress(t), QueryData: []byte(`{"verifier":{}}`)},
srcQuery: &types.QuerySmartContractStateRequest{Address: RandomBech32AccountAddress(t), QueryData: []byte(`{"verifier":{}}`)},
expErr: types.ErrNotFound,
},
}
@ -137,7 +137,7 @@ func TestQueryRawContractState(t *testing.T) {
expData: nil,
},
"query raw with unknown address": {
srcQuery: &types.QueryRawContractStateRequest{Address: AnyAccAddress(t), QueryData: []byte("foo")},
srcQuery: &types.QueryRawContractStateRequest{Address: RandomBech32AccountAddress(t), QueryData: []byte("foo")},
expErr: types.ErrNotFound,
},
}

View File

@ -335,7 +335,7 @@ func handleExecute(ctx sdk.Context, k *Keeper, msg *types.MsgExecuteContract) (*
return res, nil
}
func AnyAccAddress(_ *testing.T) string {
func RandomBech32AccountAddress(_ *testing.T) string {
_, _, addr := keyPubAddr()
return addr.String()
}