Skip to content

Commit

Permalink
refactor: improve empty struct
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk committed Jan 22, 2024
1 parent fa440e0 commit 7d1812e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
8 changes: 4 additions & 4 deletions e2e/interchaintest/types/icacontroller/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package icacontroller

var (
// Query request for contract state
GetContractStateRequest = QueryMsg{GetContractState: &EmptyMsg{}}
GetContractStateRequest = QueryMsg{GetContractState: &struct{}{}}
// Query request for channel state
GetChannelRequest = QueryMsg{GetChannel: &EmptyMsg{}}
GetChannelRequest = QueryMsg{GetChannel: &struct{}{}}
// Query request for callback counter
GetCallbackCounterRequest = QueryMsg{GetCallbackCounter: &EmptyMsg{}}
GetCallbackCounterRequest = QueryMsg{GetCallbackCounter: &struct{}{}}
// Query request for contract ownership
OwnershipRequest = QueryMsg{Ownership: &EmptyMsg{}}
OwnershipRequest = QueryMsg{Ownership: &struct{}{}}
)
13 changes: 5 additions & 8 deletions e2e/interchaintest/types/icacontroller/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@ type ExecuteMsg struct {

// QueryMsg is the message to query cw-ica-controller
type QueryMsg struct {
GetChannel *EmptyMsg `json:"get_channel,omitempty"`
GetContractState *EmptyMsg `json:"get_contract_state,omitempty"`
GetCallbackCounter *EmptyMsg `json:"get_callback_counter,omitempty"`
Ownership *EmptyMsg `json:"ownership,omitempty"`
GetChannel *struct{} `json:"get_channel,omitempty"`
GetContractState *struct{} `json:"get_contract_state,omitempty"`
GetCallbackCounter *struct{} `json:"get_callback_counter,omitempty"`
Ownership *struct{} `json:"ownership,omitempty"`
}

// MigrateMsg is the message to migrate cw-ica-controller
type MigrateMsg = EmptyMsg

// EmptyMsg is an empty message
type EmptyMsg struct{}
type MigrateMsg = struct{}

// `CreateChannel` makes the contract submit a stargate MsgChannelOpenInit to the chain.
// This is a wrapper around [`options::ChannelOpenInitOptions`] and thus requires the
Expand Down

0 comments on commit 7d1812e

Please sign in to comment.