Skip to content

Commit

Permalink
imp(e2e): regenerated message definitions and query clients using go-…
Browse files Browse the repository at this point in the history
…codegen v0.2.5 (#125)

* imp(e2e): regenerated message definitions and query clients using go-codegen

* fix: test
  • Loading branch information
srdtrk authored Jun 22, 2024
1 parent a687ef7 commit 7cc6f87
Show file tree
Hide file tree
Showing 7 changed files with 845 additions and 845 deletions.
460 changes: 230 additions & 230 deletions e2e/interchaintestv8/types/callbackcounter/msgs.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion e2e/interchaintestv8/types/callbackcounter/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (q *queryClient) queryContract(ctx context.Context, rawQueryData []byte, op
}

func (q *queryClient) GetCallbackCounter(ctx context.Context, req *QueryMsg_GetCallbackCounter, opts ...grpc.CallOption) (*CallbackCounter, error) {
rawQueryData, err := json.Marshal(&QueryMsg{GetCallbackCounter: req})
rawQueryData, err := json.Marshal(map[string]any{"get_callback_counter": req})
if err != nil {
return nil, err
}
Expand Down
970 changes: 485 additions & 485 deletions e2e/interchaintestv8/types/cwicacontroller/msgs.go

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions e2e/interchaintestv8/types/cwicacontroller/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type QueryClient interface {
// GetContractState is the client API for the QueryMsg_GetContractState query message
GetContractState(ctx context.Context, req *QueryMsg_GetContractState, opts ...grpc.CallOption) (*State, error)
// Ownership is the client API for the QueryMsg_Ownership query message
Ownership(ctx context.Context, req *QueryMsg_Ownership, opts ...grpc.CallOption) (*Ownership_for_String, error)
// GetChannel is the client API for the QueryMsg_GetChannel query message
GetChannel(ctx context.Context, req *QueryMsg_GetChannel, opts ...grpc.CallOption) (*ChannelState, error)
// GetContractState is the client API for the QueryMsg_GetContractState query message
GetContractState(ctx context.Context, req *QueryMsg_GetContractState, opts ...grpc.CallOption) (*State, error)
}

type queryClient struct {
Expand Down Expand Up @@ -65,8 +65,8 @@ func (q *queryClient) queryContract(ctx context.Context, rawQueryData []byte, op
return out.Data, nil
}

func (q *queryClient) Ownership(ctx context.Context, req *QueryMsg_Ownership, opts ...grpc.CallOption) (*Ownership_for_String, error) {
rawQueryData, err := json.Marshal(&QueryMsg{Ownership: req})
func (q *queryClient) GetContractState(ctx context.Context, req *QueryMsg_GetContractState, opts ...grpc.CallOption) (*State, error) {
rawQueryData, err := json.Marshal(map[string]any{"get_contract_state": req})
if err != nil {
return nil, err
}
Expand All @@ -76,16 +76,16 @@ func (q *queryClient) Ownership(ctx context.Context, req *QueryMsg_Ownership, op
return nil, err
}

var response Ownership_for_String
var response State
if err := json.Unmarshal(rawResponseData, &response); err != nil {
return nil, err
}

return &response, nil
}

func (q *queryClient) GetChannel(ctx context.Context, req *QueryMsg_GetChannel, opts ...grpc.CallOption) (*ChannelState, error) {
rawQueryData, err := json.Marshal(&QueryMsg{GetChannel: req})
func (q *queryClient) Ownership(ctx context.Context, req *QueryMsg_Ownership, opts ...grpc.CallOption) (*Ownership_for_String, error) {
rawQueryData, err := json.Marshal(map[string]any{"ownership": req})
if err != nil {
return nil, err
}
Expand All @@ -95,16 +95,16 @@ func (q *queryClient) GetChannel(ctx context.Context, req *QueryMsg_GetChannel,
return nil, err
}

var response ChannelState
var response Ownership_for_String
if err := json.Unmarshal(rawResponseData, &response); err != nil {
return nil, err
}

return &response, nil
}

func (q *queryClient) GetContractState(ctx context.Context, req *QueryMsg_GetContractState, opts ...grpc.CallOption) (*State, error) {
rawQueryData, err := json.Marshal(&QueryMsg{GetContractState: req})
func (q *queryClient) GetChannel(ctx context.Context, req *QueryMsg_GetChannel, opts ...grpc.CallOption) (*ChannelState, error) {
rawQueryData, err := json.Marshal(map[string]any{"get_channel": req})
if err != nil {
return nil, err
}
Expand All @@ -114,7 +114,7 @@ func (q *queryClient) GetContractState(ctx context.Context, req *QueryMsg_GetCon
return nil, err
}

var response State
var response ChannelState
if err := json.Unmarshal(rawResponseData, &response); err != nil {
return nil, err
}
Expand Down
216 changes: 108 additions & 108 deletions e2e/interchaintestv8/types/cwicaowner/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,32 @@ type QueryMsg struct {
GetIcaCount *QueryMsg_GetIcaCount `json:"get_ica_count,omitempty"`
}

type IbcPacket struct {
Timeout IbcTimeout `json:"timeout"`
// The raw data sent from the other side in the packet
Data Binary `json:"data"`
// identifies the channel and port on the receiving chain.
Dest IbcEndpoint `json:"dest"`
// The sequence number of the packet on the given channel
Sequence int `json:"sequence"`
// identifies the channel and port on the sending chain.
Src IbcEndpoint `json:"src"`
}

// In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.
type IbcTimeout struct {
Timestamp *Timestamp `json:"timestamp,omitempty"`
Block *IbcTimeoutBlock `json:"block,omitempty"`
}

// IcaState is the state of the ICA.
type IcaState struct {
IcaAddr string `json:"ica_addr"`
type ExecuteMsg_SendPredefinedAction struct {
// The ICA ID.
IcaId int `json:"ica_id"`
TxEncoding TxEncoding `json:"tx_encoding"`
ChannelState ChannelState `json:"channel_state"`
// The recipient's address, on the counterparty chain, to send the tokens to from ICA host.
ToAddress string `json:"to_address"`
}
type ExecuteMsg_ReceiveIcaCallback IcaControllerCallbackMsg

// IbcOrder defines if a channel is ORDERED or UNORDERED Values come from https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80 Naming comes from the protobuf files and go translations.
type IbcOrder string

const (
IbcOrder_OrderUnordered IbcOrder = "ORDER_UNORDERED"
IbcOrder_OrderOrdered IbcOrder = "ORDER_ORDERED"
)

// `TxEncoding` is the encoding of the transactions sent to the ICA host.
type TxEncoding string

const (
// `Protobuf` is the protobuf serialization of the CosmosSDK's Any.
TxEncoding_Proto3 TxEncoding = "proto3"
// `Proto3Json` is the json serialization of the CosmosSDK's Any.
TxEncoding_Proto3Json TxEncoding = "proto3json"
)

// The options needed to initialize the IBC channel.
type ChannelOpenInitOptions struct {
// The counterparty connection id on the counterparty chain.
Expand All @@ -66,22 +65,6 @@ type ChannelOpenInitOptions struct {
ConnectionId string `json:"connection_id"`
}

// IbcOrder defines if a channel is ORDERED or UNORDERED Values come from https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80 Naming comes from the protobuf files and go translations.
type IbcOrder string

const (
IbcOrder_OrderUnordered IbcOrder = "ORDER_UNORDERED"
IbcOrder_OrderOrdered IbcOrder = "ORDER_ORDERED"
)

// State is the state of the IBC application's channel. This application only supports one channel.
type ChannelState struct {
// The IBC channel, as defined by cosmwasm.
Channel IbcChannel `json:"channel"`
// The status of the channel.
ChannelStatus ChannelStatus `json:"channel_status"`
}

// `Data` is the response to an ibc packet. It either contains a result or an error.
type Data struct {
// Result is the result of a successful transaction.
Expand All @@ -90,16 +73,41 @@ type Data struct {
Error *Data_Error `json:"error,omitempty"`
}

type QueryMsg_GetIcaCount struct{}
/*
A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.
// ContractState is the state of the IBC application.
type ContractState struct {
// The admin of this contract.
Admin Addr `json:"admin"`
// The code ID of the cw-ica-controller contract.
IcaControllerCodeId int `json:"ica_controller_code_id"`
# Examples
Use `from` to create instances of this and `u64` to get the value out:
``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);
let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```
*/
type Uint64 string

type QueryMsg_GetIcaContractState struct {
IcaId int `json:"ica_id"`
}

type ExecuteMsg_CreateIcaContract struct {
ChannelOpenInitOptions ChannelOpenInitOptions `json:"channel_open_init_options"`
Salt *string `json:"salt,omitempty"`
}

/*
A point in time in nanosecond precision.
This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.
## Examples
``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);
let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```
*/
type Timestamp Uint64

type QueryMsg_GetContractState struct{}

// Status is the status of an IBC channel.
Expand All @@ -122,9 +130,20 @@ const (
ChannelStatus_StateFlushcomplete ChannelStatus = "STATE_FLUSHCOMPLETE"
)

type ExecuteMsg_CreateIcaContract struct {
ChannelOpenInitOptions ChannelOpenInitOptions `json:"channel_open_init_options"`
Salt *string `json:"salt,omitempty"`
// `IcaControllerCallbackMsg` is the type of message that this contract can send to other contracts.
type IcaControllerCallbackMsg struct {
// `OnAcknowledgementPacketCallback` is the callback that this contract makes to other contracts when it receives an acknowledgement packet.
OnAcknowledgementPacketCallback *IcaControllerCallbackMsg_OnAcknowledgementPacketCallback `json:"on_acknowledgement_packet_callback,omitempty"`
// `OnTimeoutPacketCallback` is the callback that this contract makes to other contracts when it receives a timeout packet.
OnTimeoutPacketCallback *IcaControllerCallbackMsg_OnTimeoutPacketCallback `json:"on_timeout_packet_callback,omitempty"`
// `OnChannelOpenAckCallback` is the callback that this contract makes to other contracts when it receives a channel open acknowledgement.
OnChannelOpenAckCallback *IcaControllerCallbackMsg_OnChannelOpenAckCallback `json:"on_channel_open_ack_callback,omitempty"`
}

// In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.
type IbcTimeout struct {
Block *IbcTimeoutBlock `json:"block,omitempty"`
Timestamp *Timestamp `json:"timestamp,omitempty"`
}

/*
Expand All @@ -145,38 +164,41 @@ This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8
*/
type Binary string

// IcaControllerCallbackMsg is the type of message that this contract can send to other contracts.
type IcaControllerCallbackMsg struct {
// OnAcknowledgementPacketCallback is the callback that this contract makes to other contracts when it receives an acknowledgement packet.
OnAcknowledgementPacketCallback *IcaControllerCallbackMsg_OnAcknowledgementPacketCallback `json:"on_acknowledgement_packet_callback,omitempty"`
// OnTimeoutPacketCallback is the callback that this contract makes to other contracts when it receives a timeout packet.
OnTimeoutPacketCallback *IcaControllerCallbackMsg_OnTimeoutPacketCallback `json:"on_timeout_packet_callback,omitempty"`
// OnChannelOpenAckCallback is the callback that this contract makes to other contracts when it receives a channel open acknowledgement.
OnChannelOpenAckCallback *IcaControllerCallbackMsg_OnChannelOpenAckCallback `json:"on_channel_open_ack_callback,omitempty"`
// IcaContractState is the state of the cw-ica-controller contract.
type IcaContractState struct {
ContractAddr Addr `json:"contract_addr"`
IcaState *IcaState `json:"ica_state,omitempty"`
}

/*
A point in time in nanosecond precision.
This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.
## Examples
``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);
let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```
*/
type Timestamp Uint64
// ContractState is the state of the IBC application.
type ContractState struct {
// The admin of this contract.
Admin Addr `json:"admin"`
// The code ID of the cw-ica-controller contract.
IcaControllerCodeId int `json:"ica_controller_code_id"`
}

// IbcChannel defines all information on a channel. This is generally used in the hand-shake process, but can be queried directly.
type IbcChannel struct {
// Note: in ibcv3 this may be "", in the IbcOpenChannel handshake messages
Version string `json:"version"`
// The connection upon which this channel was created. If this is a multi-hop channel, we only expose the first hop.
ConnectionId string `json:"connection_id"`
CounterpartyEndpoint IbcEndpoint `json:"counterparty_endpoint"`
Endpoint IbcEndpoint `json:"endpoint"`
Order IbcOrder `json:"order"`
// Note: in ibcv3 this may be "", in the IbcOpenChannel handshake messages
Version string `json:"version"`
}

type IbcPacket struct {
// identifies the channel and port on the receiving chain.
Dest IbcEndpoint `json:"dest"`
// The sequence number of the packet on the given channel
Sequence int `json:"sequence"`
// identifies the channel and port on the sending chain.
Src IbcEndpoint `json:"src"`
Timeout IbcTimeout `json:"timeout"`
// The raw data sent from the other side in the packet
Data Binary `json:"data"`
}

// IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)
Expand All @@ -187,60 +209,39 @@ type IbcTimeoutBlock struct {
Revision int `json:"revision"`
}

// `TxEncoding` is the encoding of the transactions sent to the ICA host.
type TxEncoding string

const (
// `Protobuf` is the protobuf serialization of the CosmosSDK's Any.
TxEncoding_Proto3 TxEncoding = "proto3"
// `Proto3Json` is the json serialization of the CosmosSDK's Any.
TxEncoding_Proto3Json TxEncoding = "proto3json"
)

type ExecuteMsg_SendPredefinedAction struct {
// The ICA ID.
IcaId int `json:"ica_id"`
// The recipient's address, on the counterparty chain, to send the tokens to from ICA host.
ToAddress string `json:"to_address"`
}

type IbcEndpoint struct {
ChannelId string `json:"channel_id"`
PortId string `json:"port_id"`
}

/*
A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.
# Examples
Use `from` to create instances of this and `u64` to get the value out:
``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);
let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```
*/
type Uint64 string
type QueryMsg_GetIcaCount struct{}

type QueryMsg_GetIcaContractState struct {
// IcaState is the state of the ICA.
type IcaState struct {
TxEncoding TxEncoding `json:"tx_encoding"`
ChannelState ChannelState `json:"channel_state"`
IcaAddr string `json:"ica_addr"`
IcaId int `json:"ica_id"`
}

// IcaContractState is the state of the cw-ica-controller contract.
type IcaContractState struct {
ContractAddr Addr `json:"contract_addr"`
IcaState *IcaState `json:"ica_state,omitempty"`
// State is the state of the IBC application's channel. This application only supports one channel.
type ChannelState struct {
// The IBC channel, as defined by cosmwasm.
Channel IbcChannel `json:"channel"`
// The status of the channel.
ChannelStatus ChannelStatus `json:"channel_status"`
}
type Data_Result Binary

type Data_Error string

type IcaControllerCallbackMsg_OnAcknowledgementPacketCallback struct {
// The deserialized ICA acknowledgement data
IcaAcknowledgement Data `json:"ica_acknowledgement"`
// The original packet that was sent
OriginalPacket IbcPacket `json:"original_packet"`
// The relayer that submitted acknowledgement packet
Relayer Addr `json:"relayer"`
// The deserialized ICA acknowledgement data
IcaAcknowledgement Data `json:"ica_acknowledgement"`
}

type IcaControllerCallbackMsg_OnTimeoutPacketCallback struct {
Expand All @@ -258,4 +259,3 @@ type IcaControllerCallbackMsg_OnChannelOpenAckCallback struct {
// The tx encoding this ICA channel uses.
TxEncoding TxEncoding `json:"tx_encoding"`
}
type Data_Result Binary
Loading

0 comments on commit 7cc6f87

Please sign in to comment.