Skip to content

Commit

Permalink
Consistent argument order in entrypoint wrappers. (backport #5134) (#…
Browse files Browse the repository at this point in the history
…5247)

* Consistent argument order in entrypoint wrappers. (#5134)

(cherry picked from commit 482b6b2)

# Conflicts:
#	modules/light-clients/08-wasm/types/export_test.go
#	modules/light-clients/08-wasm/types/vm.go

* Fix conflicts.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
  • Loading branch information
mergify[bot] and DimitrisJim authored Nov 29, 2023
1 parent 4a08ef9 commit 55f3b8f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
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 @@ -168,7 +168,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 @@ -211,6 +211,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 @@ -46,7 +46,7 @@ func WasmQuery[T ContractResult](ctx sdk.Context, clientStore sdk.KVStore, cs *C

// WasmSudo wraps wasmCall and is used solely for testing.
func WasmSudo[T ContractResult](ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.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 @@ -36,6 +36,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 @@ -42,7 +42,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 @@ -67,7 +67,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 @@ -51,6 +51,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 sdk.KVS
// - 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 sdk.KVStore, cs *ClientState) (T, error) {
func wasmSudo[T ContractResult](ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, cs *ClientState, payload SudoMsg) (T, error) {
var result T

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

0 comments on commit 55f3b8f

Please sign in to comment.