Skip to content

Commit

Permalink
imp(e2e): added contract query types
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Jun 20, 2023
1 parent 5d3888d commit 5f242c3
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions e2e/interchaintest/types/contract_query.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package types

import (
"encoding/json"
)

// NewGetChannelQueryMsg creates a new GetChannelQueryMsg.
func NewGetChannelQueryMsg() []byte {
return []byte(`{"get_channel":{}}`)
}

// NewGetContractStateQueryMsg creates a new GetContractStateQueryMsg.
func NewGetContractStateQueryMsg() []byte {
return []byte(`{"get_contract_state":{}}`)
}

// NewGetCallbackCounterQueryMsg creates a new GetCallbackCounterQueryMsg.
func NewGetCallbackCounterQueryMsg() []byte {
return []byte(`{"get_callback_counter":{}}`)
}

// UnmarshalGetChannelResp unmarshals the response to a GetChannelQueryMsg.
func UnmarshalGetChannelResp(bz []byte) (ContractChannelState, error) {
var msg ContractChannelState
err := json.Unmarshal(bz, &msg)
return msg, err
}

// UnmarshalGetContractStateResp unmarshals the response to a GetContractStateQueryMsg.
func UnmarshalGetContractStateResp(bz []byte) (ContractState, error) {
var msg ContractState
err := json.Unmarshal(bz, &msg)
return msg, err
}

// UnmarshalGetCallbackCounterResp unmarshals the response to a GetCallbackCounterQueryMsg.
func UnmarshalGetCallbackCounterResp(bz []byte) (ContractCallbackCounter, error) {
var msg ContractCallbackCounter
err := json.Unmarshal(bz, &msg)
return msg, err
}

0 comments on commit 5f242c3

Please sign in to comment.