Skip to content
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

Consistent argument order in entrypoint wrappers. (backport #5134) #5252

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/light-clients/08-wasm/types/client_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (cs ClientState) VerifyMembership(
Value: value,
},
}
_, err := wasmSudo[EmptyResult](ctx, cdc, payload, clientStore, &cs)
_, err := wasmSudo[EmptyResult](ctx, cdc, clientStore, &cs, payload)
return err
}

Expand Down Expand Up @@ -212,6 +212,6 @@ func (cs ClientState) VerifyNonMembership(
Path: merklePath,
},
}
_, err := wasmSudo[EmptyResult](ctx, cdc, payload, clientStore, &cs)
_, err := wasmSudo[EmptyResult](ctx, cdc, clientStore, &cs, payload)
return err
}
2 changes: 1 addition & 1 deletion modules/light-clients/08-wasm/types/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func WasmQuery[T ContractResult](ctx sdk.Context, clientStore storetypes.KVStore

// WasmSudo wraps wasmCall and is used solely for testing.
func WasmSudo[T ContractResult](ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, cs *ClientState, payload SudoMsg) (T, error) {
return wasmSudo[T](ctx, cdc, payload, clientStore, cs)
return wasmSudo[T](ctx, cdc, clientStore, cs, payload)
}

// WasmInstantiate wraps wasmInstantiate and is used solely for testing.
Expand Down
2 changes: 1 addition & 1 deletion modules/light-clients/08-wasm/types/proposal_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ func (cs ClientState) CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.B
MigrateClientStore: &MigrateClientStoreMsg{},
}

_, err := wasmSudo[EmptyResult](ctx, cdc, payload, store, &cs)
_, err := wasmSudo[EmptyResult](ctx, cdc, store, &cs, payload)
return err
}
4 changes: 2 additions & 2 deletions modules/light-clients/08-wasm/types/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, client
UpdateState: &UpdateStateMsg{ClientMessage: clientMessage},
}

result, err := wasmSudo[UpdateStateResult](ctx, cdc, payload, clientStore, &cs)
result, err := wasmSudo[UpdateStateResult](ctx, cdc, clientStore, &cs, payload)
if err != nil {
panic(err)
}
Expand All @@ -68,7 +68,7 @@ func (cs ClientState) UpdateStateOnMisbehaviour(ctx sdk.Context, cdc codec.Binar
UpdateStateOnMisbehaviour: &UpdateStateOnMisbehaviourMsg{ClientMessage: clientMessage},
}

_, err := wasmSudo[EmptyResult](ctx, cdc, payload, clientStore, &cs)
_, err := wasmSudo[EmptyResult](ctx, cdc, clientStore, &cs, payload)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/light-clients/08-wasm/types/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ func (cs ClientState) VerifyUpgradeAndUpdateState(
},
}

_, err := wasmSudo[EmptyResult](ctx, cdc, payload, clientStore, &cs)
_, err := wasmSudo[EmptyResult](ctx, cdc, clientStore, &cs, payload)
return err
}
2 changes: 1 addition & 1 deletion modules/light-clients/08-wasm/types/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func wasmInstantiate(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storety
// - the response of the contract call contains non-empty events
// - the response of the contract call contains non-empty attributes
// - the data bytes of the response cannot be unmarshaled into the result type
func wasmSudo[T ContractResult](ctx sdk.Context, cdc codec.BinaryCodec, payload SudoMsg, clientStore storetypes.KVStore, cs *ClientState) (T, error) {
func wasmSudo[T ContractResult](ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, cs *ClientState, payload SudoMsg) (T, error) {
var result T

encodedData, err := json.Marshal(payload)
Expand Down
Loading