Skip to content

Commit

Permalink
Consistent argument order in entrypoint wrappers. (#5134)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim authored Nov 20, 2023
1 parent 336bf2c commit 482b6b2
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 @@ -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 @@ -43,6 +43,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

0 comments on commit 482b6b2

Please sign in to comment.