github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/x/wasm/keeper/testdata/reflect.go (about) 1 package testdata 2 3 import ( 4 _ "embed" 5 6 typwasmvmtypes "github.com/CosmWasm/wasmvm/types" 7 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types" 8 ) 9 10 //go:embed reflect.wasm 11 var reflectContract []byte 12 13 func ReflectContractWasm() []byte { 14 return reflectContract 15 } 16 17 // ReflectHandleMsg is used to encode handle messages 18 type ReflectHandleMsg struct { 19 Reflect *ReflectPayload `json:"reflect_msg,omitempty"` 20 ReflectSubMsg *ReflectSubPayload `json:"reflect_sub_msg,omitempty"` 21 ChangeOwner *OwnerPayload `json:"change_owner,omitempty"` 22 } 23 24 type OwnerPayload struct { 25 Owner types.Address `json:"owner"` 26 } 27 28 type ReflectPayload struct { 29 Msgs []typwasmvmtypes.CosmosMsg `json:"msgs"` 30 } 31 32 type ReflectSubPayload struct { 33 Msgs []typwasmvmtypes.SubMsg `json:"msgs"` 34 } 35 36 // ReflectQueryMsg is used to encode query messages 37 type ReflectQueryMsg struct { 38 Owner *struct{} `json:"owner,omitempty"` 39 Capitalized *Text `json:"capitalized,omitempty"` 40 Chain *ChainQuery `json:"chain,omitempty"` 41 SubMsgResult *SubCall `json:"sub_msg_result,omitempty"` 42 } 43 44 type ChainQuery struct { 45 Request *typwasmvmtypes.QueryRequest `json:"request,omitempty"` 46 } 47 48 type Text struct { 49 Text string `json:"text"` 50 } 51 52 type SubCall struct { 53 ID uint64 `json:"id"` 54 } 55 56 type OwnerResponse struct { 57 Owner string `json:"owner,omitempty"` 58 } 59 60 type ChainResponse struct { 61 Data []byte `json:"data,omitempty"` 62 }