diff --git a/Makefile b/Makefile index b384d44..9312743 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,11 @@ compile: .PHONY: abigen abigen: compile @mkdir -p ./build/abi ./pkg/contract/ibchandler + @mkdir -p ./pkg/contract/mockapp @jq -r '.abi' ./yui-ibc-solidity/out/IBCHandler.sol/IBCHandler.json > ./build/abi/IBCHandler.abi + @jq -r '.abi' ./yui-ibc-solidity/out/TestIBCChannelUpgradableMockApp.t.sol/TestIBCChannelUpgradableMockApp.json > ./build/abi/TestIBCChannelUpgradableMockApp.abi @$(ABIGEN) --abi ./build/abi/IBCHandler.abi --pkg ibchandler --out ./pkg/contract/ibchandler/ibchandler.go + @$(ABIGEN) --abi ./build/abi/TestIBCChannelUpgradableMockApp.abi --pkg mockapp -out ./pkg/contract/mockapp/mockapp.go .PHONY: proto-gen proto-update-deps proto-gen: diff --git a/pkg/contract/mockapp/mockapp.go b/pkg/contract/mockapp/mockapp.go new file mode 100644 index 0000000..da08663 --- /dev/null +++ b/pkg/contract/mockapp/mockapp.go @@ -0,0 +1,1178 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package mockapp + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// ChannelCounterpartyData is an auto generated low-level Go binding around an user-defined struct. +type ChannelCounterpartyData struct { + PortId string + ChannelId string +} + +// HeightData is an auto generated low-level Go binding around an user-defined struct. +type HeightData struct { + RevisionNumber uint64 + RevisionHeight uint64 +} + +// IIBCChannelUpgradableModuleUpgradeProposal is an auto generated low-level Go binding around an user-defined struct. +type IIBCChannelUpgradableModuleUpgradeProposal struct { + Fields UpgradeFieldsData + Timeout TimeoutData +} + +// IIBCModuleMsgOnChanCloseConfirm is an auto generated low-level Go binding around an user-defined struct. +type IIBCModuleMsgOnChanCloseConfirm struct { + PortId string + ChannelId string +} + +// IIBCModuleMsgOnChanCloseInit is an auto generated low-level Go binding around an user-defined struct. +type IIBCModuleMsgOnChanCloseInit struct { + PortId string + ChannelId string +} + +// IIBCModuleMsgOnChanOpenAck is an auto generated low-level Go binding around an user-defined struct. +type IIBCModuleMsgOnChanOpenAck struct { + PortId string + ChannelId string + CounterpartyVersion string +} + +// IIBCModuleMsgOnChanOpenConfirm is an auto generated low-level Go binding around an user-defined struct. +type IIBCModuleMsgOnChanOpenConfirm struct { + PortId string + ChannelId string +} + +// IIBCModuleMsgOnChanOpenInit is an auto generated low-level Go binding around an user-defined struct. +type IIBCModuleMsgOnChanOpenInit struct { + Order uint8 + ConnectionHops []string + PortId string + ChannelId string + Counterparty ChannelCounterpartyData + Version string +} + +// IIBCModuleMsgOnChanOpenTry is an auto generated low-level Go binding around an user-defined struct. +type IIBCModuleMsgOnChanOpenTry struct { + Order uint8 + ConnectionHops []string + PortId string + ChannelId string + Counterparty ChannelCounterpartyData + CounterpartyVersion string +} + +// Packet is an auto generated low-level Go binding around an user-defined struct. +type Packet struct { + Sequence uint64 + SourcePort string + SourceChannel string + DestinationPort string + DestinationChannel string + Data []byte + TimeoutHeight HeightData + TimeoutTimestamp uint64 +} + +// TimeoutData is an auto generated low-level Go binding around an user-defined struct. +type TimeoutData struct { + Height HeightData + Timestamp uint64 +} + +// UpgradeFieldsData is an auto generated low-level Go binding around an user-defined struct. +type UpgradeFieldsData struct { + Ordering uint8 + ConnectionHops []string + Version string +} + +// MockappMetaData contains all meta data concerning the Mockapp contract. +var MockappMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"ibcHandler_\",\"type\":\"address\",\"internalType\":\"contractIIBCHandler\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MOCKAPP_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"allowCloseChannel\",\"inputs\":[{\"name\":\"allow\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"allowTransitionToFlushComplete\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"canTransitionToFlushComplete\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"closeChannelAllowed\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getUpgradeProposal\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCChannelUpgradableModule.UpgradeProposal\",\"components\":[{\"name\":\"fields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getUpgradeTimeout\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ibcAddress\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isAuthorizedUpgrader\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"msgSender\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"onAcknowledgementPacket\",\"inputs\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"acknowledgement\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"onChanCloseConfirm\",\"inputs\":[{\"name\":\"msg_\",\"type\":\"tuple\",\"internalType\":\"structIIBCModule.MsgOnChanCloseConfirm\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"onChanCloseInit\",\"inputs\":[{\"name\":\"msg_\",\"type\":\"tuple\",\"internalType\":\"structIIBCModule.MsgOnChanCloseInit\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"onChanOpenAck\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCModule.MsgOnChanOpenAck\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterpartyVersion\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"onChanOpenConfirm\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIIBCModule.MsgOnChanOpenConfirm\",\"components\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"onChanOpenInit\",\"inputs\":[{\"name\":\"msg_\",\"type\":\"tuple\",\"internalType\":\"structIIBCModule.MsgOnChanOpenInit\",\"components\":[{\"name\":\"order\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connectionHops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"onChanOpenTry\",\"inputs\":[{\"name\":\"msg_\",\"type\":\"tuple\",\"internalType\":\"structIIBCModule.MsgOnChanOpenTry\",\"components\":[{\"name\":\"order\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connectionHops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"counterparty\",\"type\":\"tuple\",\"internalType\":\"structChannelCounterparty.Data\",\"components\":[{\"name\":\"port_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channel_id\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"counterpartyVersion\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"onChanUpgradeAck\",\"inputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"counterpartyVersion\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"onChanUpgradeInit\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"proposedUpgradeFields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"onChanUpgradeOpen\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgradeSequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"onChanUpgradeTry\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"proposedUpgradeFields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]}],\"outputs\":[{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"onRecvPacket\",\"inputs\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"acknowledgement\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"onTimeoutPacket\",\"inputs\":[{\"name\":\"packet\",\"type\":\"tuple\",\"internalType\":\"structPacket\",\"components\":[{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proposeAndInitUpgrade\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"proposedUpgradeFields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"proposeUpgrade\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"upgradeFields\",\"type\":\"tuple\",\"internalType\":\"structUpgradeFields.Data\",\"components\":[{\"name\":\"ordering\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"},{\"name\":\"connection_hops\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"version\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"name\":\"timeout\",\"type\":\"tuple\",\"internalType\":\"structTimeout.Data\",\"components\":[{\"name\":\"height\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"removeUpgradeProposal\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"sendPacket\",\"inputs\":[{\"name\":\"message\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"sourcePort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sourceChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"timeoutHeight\",\"type\":\"tuple\",\"internalType\":\"structHeight.Data\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"revision_height\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"timeoutTimestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"writeAcknowledgement\",\"inputs\":[{\"name\":\"destinationPort\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"destinationChannel\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"sequence\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleCannotOverwriteUpgrade\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleCannotRemoveInProgressUpgrade\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleChannelNotFlushingState\",\"inputs\":[{\"name\":\"state\",\"type\":\"uint8\",\"internalType\":\"enumChannel.State\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleChannelNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleInvalidConnectionHops\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleInvalidTimeout\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleInvalidUpgrade\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleSequenceMismatch\",\"inputs\":[{\"name\":\"actual\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleUnauthorizedUpgrader\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleUpgradeAlreadyExists\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCChannelUpgradableModuleUpgradeNotFound\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IBCMockUnexpectedAcknowledgement\",\"inputs\":[{\"name\":\"actual\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expected\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"IBCMockUnexpectedPacket\",\"inputs\":[{\"name\":\"actual\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"IBCMockUnexpectedVersion\",\"inputs\":[{\"name\":\"actual\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"expected\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCModuleChannelCloseNotAllowed\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"IBCModuleChannelOrderNotAllowed\",\"inputs\":[{\"name\":\"portId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"channelId\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"order\",\"type\":\"uint8\",\"internalType\":\"enumChannel.Order\"}]},{\"type\":\"error\",\"name\":\"IBCModuleInvalidSender\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", +} + +// MockappABI is the input ABI used to generate the binding from. +// Deprecated: Use MockappMetaData.ABI instead. +var MockappABI = MockappMetaData.ABI + +// Mockapp is an auto generated Go binding around an Ethereum contract. +type Mockapp struct { + MockappCaller // Read-only binding to the contract + MockappTransactor // Write-only binding to the contract + MockappFilterer // Log filterer for contract events +} + +// MockappCaller is an auto generated read-only Go binding around an Ethereum contract. +type MockappCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MockappTransactor is an auto generated write-only Go binding around an Ethereum contract. +type MockappTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MockappFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MockappFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MockappSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MockappSession struct { + Contract *Mockapp // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MockappCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MockappCallerSession struct { + Contract *MockappCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MockappTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MockappTransactorSession struct { + Contract *MockappTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MockappRaw is an auto generated low-level Go binding around an Ethereum contract. +type MockappRaw struct { + Contract *Mockapp // Generic contract binding to access the raw methods on +} + +// MockappCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MockappCallerRaw struct { + Contract *MockappCaller // Generic read-only contract binding to access the raw methods on +} + +// MockappTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MockappTransactorRaw struct { + Contract *MockappTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewMockapp creates a new instance of Mockapp, bound to a specific deployed contract. +func NewMockapp(address common.Address, backend bind.ContractBackend) (*Mockapp, error) { + contract, err := bindMockapp(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Mockapp{MockappCaller: MockappCaller{contract: contract}, MockappTransactor: MockappTransactor{contract: contract}, MockappFilterer: MockappFilterer{contract: contract}}, nil +} + +// NewMockappCaller creates a new read-only instance of Mockapp, bound to a specific deployed contract. +func NewMockappCaller(address common.Address, caller bind.ContractCaller) (*MockappCaller, error) { + contract, err := bindMockapp(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MockappCaller{contract: contract}, nil +} + +// NewMockappTransactor creates a new write-only instance of Mockapp, bound to a specific deployed contract. +func NewMockappTransactor(address common.Address, transactor bind.ContractTransactor) (*MockappTransactor, error) { + contract, err := bindMockapp(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MockappTransactor{contract: contract}, nil +} + +// NewMockappFilterer creates a new log filterer instance of Mockapp, bound to a specific deployed contract. +func NewMockappFilterer(address common.Address, filterer bind.ContractFilterer) (*MockappFilterer, error) { + contract, err := bindMockapp(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MockappFilterer{contract: contract}, nil +} + +// bindMockapp binds a generic wrapper to an already deployed contract. +func bindMockapp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MockappMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Mockapp *MockappRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Mockapp.Contract.MockappCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Mockapp *MockappRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Mockapp.Contract.MockappTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Mockapp *MockappRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Mockapp.Contract.MockappTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Mockapp *MockappCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Mockapp.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Mockapp *MockappTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Mockapp.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Mockapp *MockappTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Mockapp.Contract.contract.Transact(opts, method, params...) +} + +// MOCKAPPVERSION is a free data retrieval call binding the contract method 0x7ef15d45. +// +// Solidity: function MOCKAPP_VERSION() view returns(string) +func (_Mockapp *MockappCaller) MOCKAPPVERSION(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "MOCKAPP_VERSION") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// MOCKAPPVERSION is a free data retrieval call binding the contract method 0x7ef15d45. +// +// Solidity: function MOCKAPP_VERSION() view returns(string) +func (_Mockapp *MockappSession) MOCKAPPVERSION() (string, error) { + return _Mockapp.Contract.MOCKAPPVERSION(&_Mockapp.CallOpts) +} + +// MOCKAPPVERSION is a free data retrieval call binding the contract method 0x7ef15d45. +// +// Solidity: function MOCKAPP_VERSION() view returns(string) +func (_Mockapp *MockappCallerSession) MOCKAPPVERSION() (string, error) { + return _Mockapp.Contract.MOCKAPPVERSION(&_Mockapp.CallOpts) +} + +// CanTransitionToFlushComplete is a free data retrieval call binding the contract method 0x4c707d97. +// +// Solidity: function canTransitionToFlushComplete(string portId, string channelId, uint64 upgradeSequence, address ) view returns(bool) +func (_Mockapp *MockappCaller) CanTransitionToFlushComplete(opts *bind.CallOpts, portId string, channelId string, upgradeSequence uint64, arg3 common.Address) (bool, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "canTransitionToFlushComplete", portId, channelId, upgradeSequence, arg3) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// CanTransitionToFlushComplete is a free data retrieval call binding the contract method 0x4c707d97. +// +// Solidity: function canTransitionToFlushComplete(string portId, string channelId, uint64 upgradeSequence, address ) view returns(bool) +func (_Mockapp *MockappSession) CanTransitionToFlushComplete(portId string, channelId string, upgradeSequence uint64, arg3 common.Address) (bool, error) { + return _Mockapp.Contract.CanTransitionToFlushComplete(&_Mockapp.CallOpts, portId, channelId, upgradeSequence, arg3) +} + +// CanTransitionToFlushComplete is a free data retrieval call binding the contract method 0x4c707d97. +// +// Solidity: function canTransitionToFlushComplete(string portId, string channelId, uint64 upgradeSequence, address ) view returns(bool) +func (_Mockapp *MockappCallerSession) CanTransitionToFlushComplete(portId string, channelId string, upgradeSequence uint64, arg3 common.Address) (bool, error) { + return _Mockapp.Contract.CanTransitionToFlushComplete(&_Mockapp.CallOpts, portId, channelId, upgradeSequence, arg3) +} + +// CloseChannelAllowed is a free data retrieval call binding the contract method 0x5a42d326. +// +// Solidity: function closeChannelAllowed() view returns(bool) +func (_Mockapp *MockappCaller) CloseChannelAllowed(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "closeChannelAllowed") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// CloseChannelAllowed is a free data retrieval call binding the contract method 0x5a42d326. +// +// Solidity: function closeChannelAllowed() view returns(bool) +func (_Mockapp *MockappSession) CloseChannelAllowed() (bool, error) { + return _Mockapp.Contract.CloseChannelAllowed(&_Mockapp.CallOpts) +} + +// CloseChannelAllowed is a free data retrieval call binding the contract method 0x5a42d326. +// +// Solidity: function closeChannelAllowed() view returns(bool) +func (_Mockapp *MockappCallerSession) CloseChannelAllowed() (bool, error) { + return _Mockapp.Contract.CloseChannelAllowed(&_Mockapp.CallOpts) +} + +// GetUpgradeProposal is a free data retrieval call binding the contract method 0x6df5433b. +// +// Solidity: function getUpgradeProposal(string portId, string channelId) view returns(((uint8,string[],string),((uint64,uint64),uint64))) +func (_Mockapp *MockappCaller) GetUpgradeProposal(opts *bind.CallOpts, portId string, channelId string) (IIBCChannelUpgradableModuleUpgradeProposal, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "getUpgradeProposal", portId, channelId) + + if err != nil { + return *new(IIBCChannelUpgradableModuleUpgradeProposal), err + } + + out0 := *abi.ConvertType(out[0], new(IIBCChannelUpgradableModuleUpgradeProposal)).(*IIBCChannelUpgradableModuleUpgradeProposal) + + return out0, err + +} + +// GetUpgradeProposal is a free data retrieval call binding the contract method 0x6df5433b. +// +// Solidity: function getUpgradeProposal(string portId, string channelId) view returns(((uint8,string[],string),((uint64,uint64),uint64))) +func (_Mockapp *MockappSession) GetUpgradeProposal(portId string, channelId string) (IIBCChannelUpgradableModuleUpgradeProposal, error) { + return _Mockapp.Contract.GetUpgradeProposal(&_Mockapp.CallOpts, portId, channelId) +} + +// GetUpgradeProposal is a free data retrieval call binding the contract method 0x6df5433b. +// +// Solidity: function getUpgradeProposal(string portId, string channelId) view returns(((uint8,string[],string),((uint64,uint64),uint64))) +func (_Mockapp *MockappCallerSession) GetUpgradeProposal(portId string, channelId string) (IIBCChannelUpgradableModuleUpgradeProposal, error) { + return _Mockapp.Contract.GetUpgradeProposal(&_Mockapp.CallOpts, portId, channelId) +} + +// GetUpgradeTimeout is a free data retrieval call binding the contract method 0x7fb38388. +// +// Solidity: function getUpgradeTimeout(string portId, string channelId) view returns(((uint64,uint64),uint64)) +func (_Mockapp *MockappCaller) GetUpgradeTimeout(opts *bind.CallOpts, portId string, channelId string) (TimeoutData, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "getUpgradeTimeout", portId, channelId) + + if err != nil { + return *new(TimeoutData), err + } + + out0 := *abi.ConvertType(out[0], new(TimeoutData)).(*TimeoutData) + + return out0, err + +} + +// GetUpgradeTimeout is a free data retrieval call binding the contract method 0x7fb38388. +// +// Solidity: function getUpgradeTimeout(string portId, string channelId) view returns(((uint64,uint64),uint64)) +func (_Mockapp *MockappSession) GetUpgradeTimeout(portId string, channelId string) (TimeoutData, error) { + return _Mockapp.Contract.GetUpgradeTimeout(&_Mockapp.CallOpts, portId, channelId) +} + +// GetUpgradeTimeout is a free data retrieval call binding the contract method 0x7fb38388. +// +// Solidity: function getUpgradeTimeout(string portId, string channelId) view returns(((uint64,uint64),uint64)) +func (_Mockapp *MockappCallerSession) GetUpgradeTimeout(portId string, channelId string) (TimeoutData, error) { + return _Mockapp.Contract.GetUpgradeTimeout(&_Mockapp.CallOpts, portId, channelId) +} + +// IbcAddress is a free data retrieval call binding the contract method 0x696a9bf4. +// +// Solidity: function ibcAddress() view returns(address) +func (_Mockapp *MockappCaller) IbcAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "ibcAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// IbcAddress is a free data retrieval call binding the contract method 0x696a9bf4. +// +// Solidity: function ibcAddress() view returns(address) +func (_Mockapp *MockappSession) IbcAddress() (common.Address, error) { + return _Mockapp.Contract.IbcAddress(&_Mockapp.CallOpts) +} + +// IbcAddress is a free data retrieval call binding the contract method 0x696a9bf4. +// +// Solidity: function ibcAddress() view returns(address) +func (_Mockapp *MockappCallerSession) IbcAddress() (common.Address, error) { + return _Mockapp.Contract.IbcAddress(&_Mockapp.CallOpts) +} + +// IsAuthorizedUpgrader is a free data retrieval call binding the contract method 0xce7d0a3b. +// +// Solidity: function isAuthorizedUpgrader(string portId, string channelId, address msgSender) view returns(bool) +func (_Mockapp *MockappCaller) IsAuthorizedUpgrader(opts *bind.CallOpts, portId string, channelId string, msgSender common.Address) (bool, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "isAuthorizedUpgrader", portId, channelId, msgSender) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsAuthorizedUpgrader is a free data retrieval call binding the contract method 0xce7d0a3b. +// +// Solidity: function isAuthorizedUpgrader(string portId, string channelId, address msgSender) view returns(bool) +func (_Mockapp *MockappSession) IsAuthorizedUpgrader(portId string, channelId string, msgSender common.Address) (bool, error) { + return _Mockapp.Contract.IsAuthorizedUpgrader(&_Mockapp.CallOpts, portId, channelId, msgSender) +} + +// IsAuthorizedUpgrader is a free data retrieval call binding the contract method 0xce7d0a3b. +// +// Solidity: function isAuthorizedUpgrader(string portId, string channelId, address msgSender) view returns(bool) +func (_Mockapp *MockappCallerSession) IsAuthorizedUpgrader(portId string, channelId string, msgSender common.Address) (bool, error) { + return _Mockapp.Contract.IsAuthorizedUpgrader(&_Mockapp.CallOpts, portId, channelId, msgSender) +} + +// OnChanUpgradeAck is a free data retrieval call binding the contract method 0x8527279f. +// +// Solidity: function onChanUpgradeAck(string , string , uint64 , string counterpartyVersion) view returns() +func (_Mockapp *MockappCaller) OnChanUpgradeAck(opts *bind.CallOpts, arg0 string, arg1 string, arg2 uint64, counterpartyVersion string) error { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "onChanUpgradeAck", arg0, arg1, arg2, counterpartyVersion) + + if err != nil { + return err + } + + return err + +} + +// OnChanUpgradeAck is a free data retrieval call binding the contract method 0x8527279f. +// +// Solidity: function onChanUpgradeAck(string , string , uint64 , string counterpartyVersion) view returns() +func (_Mockapp *MockappSession) OnChanUpgradeAck(arg0 string, arg1 string, arg2 uint64, counterpartyVersion string) error { + return _Mockapp.Contract.OnChanUpgradeAck(&_Mockapp.CallOpts, arg0, arg1, arg2, counterpartyVersion) +} + +// OnChanUpgradeAck is a free data retrieval call binding the contract method 0x8527279f. +// +// Solidity: function onChanUpgradeAck(string , string , uint64 , string counterpartyVersion) view returns() +func (_Mockapp *MockappCallerSession) OnChanUpgradeAck(arg0 string, arg1 string, arg2 uint64, counterpartyVersion string) error { + return _Mockapp.Contract.OnChanUpgradeAck(&_Mockapp.CallOpts, arg0, arg1, arg2, counterpartyVersion) +} + +// OnChanUpgradeInit is a free data retrieval call binding the contract method 0x5e716835. +// +// Solidity: function onChanUpgradeInit(string portId, string channelId, uint64 , (uint8,string[],string) proposedUpgradeFields) view returns(string version) +func (_Mockapp *MockappCaller) OnChanUpgradeInit(opts *bind.CallOpts, portId string, channelId string, arg2 uint64, proposedUpgradeFields UpgradeFieldsData) (string, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "onChanUpgradeInit", portId, channelId, arg2, proposedUpgradeFields) + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// OnChanUpgradeInit is a free data retrieval call binding the contract method 0x5e716835. +// +// Solidity: function onChanUpgradeInit(string portId, string channelId, uint64 , (uint8,string[],string) proposedUpgradeFields) view returns(string version) +func (_Mockapp *MockappSession) OnChanUpgradeInit(portId string, channelId string, arg2 uint64, proposedUpgradeFields UpgradeFieldsData) (string, error) { + return _Mockapp.Contract.OnChanUpgradeInit(&_Mockapp.CallOpts, portId, channelId, arg2, proposedUpgradeFields) +} + +// OnChanUpgradeInit is a free data retrieval call binding the contract method 0x5e716835. +// +// Solidity: function onChanUpgradeInit(string portId, string channelId, uint64 , (uint8,string[],string) proposedUpgradeFields) view returns(string version) +func (_Mockapp *MockappCallerSession) OnChanUpgradeInit(portId string, channelId string, arg2 uint64, proposedUpgradeFields UpgradeFieldsData) (string, error) { + return _Mockapp.Contract.OnChanUpgradeInit(&_Mockapp.CallOpts, portId, channelId, arg2, proposedUpgradeFields) +} + +// OnChanUpgradeTry is a free data retrieval call binding the contract method 0x4e8ec93f. +// +// Solidity: function onChanUpgradeTry(string portId, string channelId, uint64 , (uint8,string[],string) proposedUpgradeFields) view returns(string version) +func (_Mockapp *MockappCaller) OnChanUpgradeTry(opts *bind.CallOpts, portId string, channelId string, arg2 uint64, proposedUpgradeFields UpgradeFieldsData) (string, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "onChanUpgradeTry", portId, channelId, arg2, proposedUpgradeFields) + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// OnChanUpgradeTry is a free data retrieval call binding the contract method 0x4e8ec93f. +// +// Solidity: function onChanUpgradeTry(string portId, string channelId, uint64 , (uint8,string[],string) proposedUpgradeFields) view returns(string version) +func (_Mockapp *MockappSession) OnChanUpgradeTry(portId string, channelId string, arg2 uint64, proposedUpgradeFields UpgradeFieldsData) (string, error) { + return _Mockapp.Contract.OnChanUpgradeTry(&_Mockapp.CallOpts, portId, channelId, arg2, proposedUpgradeFields) +} + +// OnChanUpgradeTry is a free data retrieval call binding the contract method 0x4e8ec93f. +// +// Solidity: function onChanUpgradeTry(string portId, string channelId, uint64 , (uint8,string[],string) proposedUpgradeFields) view returns(string version) +func (_Mockapp *MockappCallerSession) OnChanUpgradeTry(portId string, channelId string, arg2 uint64, proposedUpgradeFields UpgradeFieldsData) (string, error) { + return _Mockapp.Contract.OnChanUpgradeTry(&_Mockapp.CallOpts, portId, channelId, arg2, proposedUpgradeFields) +} + +// OnRecvPacket is a free data retrieval call binding the contract method 0x2301c6f5. +// +// Solidity: function onRecvPacket((uint64,string,string,string,string,bytes,(uint64,uint64),uint64) packet, address ) view returns(bytes acknowledgement) +func (_Mockapp *MockappCaller) OnRecvPacket(opts *bind.CallOpts, packet Packet, arg1 common.Address) ([]byte, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "onRecvPacket", packet, arg1) + + if err != nil { + return *new([]byte), err + } + + out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) + + return out0, err + +} + +// OnRecvPacket is a free data retrieval call binding the contract method 0x2301c6f5. +// +// Solidity: function onRecvPacket((uint64,string,string,string,string,bytes,(uint64,uint64),uint64) packet, address ) view returns(bytes acknowledgement) +func (_Mockapp *MockappSession) OnRecvPacket(packet Packet, arg1 common.Address) ([]byte, error) { + return _Mockapp.Contract.OnRecvPacket(&_Mockapp.CallOpts, packet, arg1) +} + +// OnRecvPacket is a free data retrieval call binding the contract method 0x2301c6f5. +// +// Solidity: function onRecvPacket((uint64,string,string,string,string,bytes,(uint64,uint64),uint64) packet, address ) view returns(bytes acknowledgement) +func (_Mockapp *MockappCallerSession) OnRecvPacket(packet Packet, arg1 common.Address) ([]byte, error) { + return _Mockapp.Contract.OnRecvPacket(&_Mockapp.CallOpts, packet, arg1) +} + +// OnTimeoutPacket is a free data retrieval call binding the contract method 0x52c7157d. +// +// Solidity: function onTimeoutPacket((uint64,string,string,string,string,bytes,(uint64,uint64),uint64) packet, address ) view returns() +func (_Mockapp *MockappCaller) OnTimeoutPacket(opts *bind.CallOpts, packet Packet, arg1 common.Address) error { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "onTimeoutPacket", packet, arg1) + + if err != nil { + return err + } + + return err + +} + +// OnTimeoutPacket is a free data retrieval call binding the contract method 0x52c7157d. +// +// Solidity: function onTimeoutPacket((uint64,string,string,string,string,bytes,(uint64,uint64),uint64) packet, address ) view returns() +func (_Mockapp *MockappSession) OnTimeoutPacket(packet Packet, arg1 common.Address) error { + return _Mockapp.Contract.OnTimeoutPacket(&_Mockapp.CallOpts, packet, arg1) +} + +// OnTimeoutPacket is a free data retrieval call binding the contract method 0x52c7157d. +// +// Solidity: function onTimeoutPacket((uint64,string,string,string,string,bytes,(uint64,uint64),uint64) packet, address ) view returns() +func (_Mockapp *MockappCallerSession) OnTimeoutPacket(packet Packet, arg1 common.Address) error { + return _Mockapp.Contract.OnTimeoutPacket(&_Mockapp.CallOpts, packet, arg1) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Mockapp *MockappCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Mockapp.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Mockapp *MockappSession) Owner() (common.Address, error) { + return _Mockapp.Contract.Owner(&_Mockapp.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_Mockapp *MockappCallerSession) Owner() (common.Address, error) { + return _Mockapp.Contract.Owner(&_Mockapp.CallOpts) +} + +// AllowCloseChannel is a paid mutator transaction binding the contract method 0x9cc3ca73. +// +// Solidity: function allowCloseChannel(bool allow) returns() +func (_Mockapp *MockappTransactor) AllowCloseChannel(opts *bind.TransactOpts, allow bool) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "allowCloseChannel", allow) +} + +// AllowCloseChannel is a paid mutator transaction binding the contract method 0x9cc3ca73. +// +// Solidity: function allowCloseChannel(bool allow) returns() +func (_Mockapp *MockappSession) AllowCloseChannel(allow bool) (*types.Transaction, error) { + return _Mockapp.Contract.AllowCloseChannel(&_Mockapp.TransactOpts, allow) +} + +// AllowCloseChannel is a paid mutator transaction binding the contract method 0x9cc3ca73. +// +// Solidity: function allowCloseChannel(bool allow) returns() +func (_Mockapp *MockappTransactorSession) AllowCloseChannel(allow bool) (*types.Transaction, error) { + return _Mockapp.Contract.AllowCloseChannel(&_Mockapp.TransactOpts, allow) +} + +// AllowTransitionToFlushComplete is a paid mutator transaction binding the contract method 0x8680841e. +// +// Solidity: function allowTransitionToFlushComplete(string portId, string channelId, uint64 upgradeSequence) returns() +func (_Mockapp *MockappTransactor) AllowTransitionToFlushComplete(opts *bind.TransactOpts, portId string, channelId string, upgradeSequence uint64) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "allowTransitionToFlushComplete", portId, channelId, upgradeSequence) +} + +// AllowTransitionToFlushComplete is a paid mutator transaction binding the contract method 0x8680841e. +// +// Solidity: function allowTransitionToFlushComplete(string portId, string channelId, uint64 upgradeSequence) returns() +func (_Mockapp *MockappSession) AllowTransitionToFlushComplete(portId string, channelId string, upgradeSequence uint64) (*types.Transaction, error) { + return _Mockapp.Contract.AllowTransitionToFlushComplete(&_Mockapp.TransactOpts, portId, channelId, upgradeSequence) +} + +// AllowTransitionToFlushComplete is a paid mutator transaction binding the contract method 0x8680841e. +// +// Solidity: function allowTransitionToFlushComplete(string portId, string channelId, uint64 upgradeSequence) returns() +func (_Mockapp *MockappTransactorSession) AllowTransitionToFlushComplete(portId string, channelId string, upgradeSequence uint64) (*types.Transaction, error) { + return _Mockapp.Contract.AllowTransitionToFlushComplete(&_Mockapp.TransactOpts, portId, channelId, upgradeSequence) +} + +// OnAcknowledgementPacket is a paid mutator transaction binding the contract method 0xfb8b532e. +// +// Solidity: function onAcknowledgementPacket((uint64,string,string,string,string,bytes,(uint64,uint64),uint64) packet, bytes acknowledgement, address ) returns() +func (_Mockapp *MockappTransactor) OnAcknowledgementPacket(opts *bind.TransactOpts, packet Packet, acknowledgement []byte, arg2 common.Address) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "onAcknowledgementPacket", packet, acknowledgement, arg2) +} + +// OnAcknowledgementPacket is a paid mutator transaction binding the contract method 0xfb8b532e. +// +// Solidity: function onAcknowledgementPacket((uint64,string,string,string,string,bytes,(uint64,uint64),uint64) packet, bytes acknowledgement, address ) returns() +func (_Mockapp *MockappSession) OnAcknowledgementPacket(packet Packet, acknowledgement []byte, arg2 common.Address) (*types.Transaction, error) { + return _Mockapp.Contract.OnAcknowledgementPacket(&_Mockapp.TransactOpts, packet, acknowledgement, arg2) +} + +// OnAcknowledgementPacket is a paid mutator transaction binding the contract method 0xfb8b532e. +// +// Solidity: function onAcknowledgementPacket((uint64,string,string,string,string,bytes,(uint64,uint64),uint64) packet, bytes acknowledgement, address ) returns() +func (_Mockapp *MockappTransactorSession) OnAcknowledgementPacket(packet Packet, acknowledgement []byte, arg2 common.Address) (*types.Transaction, error) { + return _Mockapp.Contract.OnAcknowledgementPacket(&_Mockapp.TransactOpts, packet, acknowledgement, arg2) +} + +// OnChanCloseConfirm is a paid mutator transaction binding the contract method 0x38c858bc. +// +// Solidity: function onChanCloseConfirm((string,string) msg_) returns() +func (_Mockapp *MockappTransactor) OnChanCloseConfirm(opts *bind.TransactOpts, msg_ IIBCModuleMsgOnChanCloseConfirm) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "onChanCloseConfirm", msg_) +} + +// OnChanCloseConfirm is a paid mutator transaction binding the contract method 0x38c858bc. +// +// Solidity: function onChanCloseConfirm((string,string) msg_) returns() +func (_Mockapp *MockappSession) OnChanCloseConfirm(msg_ IIBCModuleMsgOnChanCloseConfirm) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanCloseConfirm(&_Mockapp.TransactOpts, msg_) +} + +// OnChanCloseConfirm is a paid mutator transaction binding the contract method 0x38c858bc. +// +// Solidity: function onChanCloseConfirm((string,string) msg_) returns() +func (_Mockapp *MockappTransactorSession) OnChanCloseConfirm(msg_ IIBCModuleMsgOnChanCloseConfirm) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanCloseConfirm(&_Mockapp.TransactOpts, msg_) +} + +// OnChanCloseInit is a paid mutator transaction binding the contract method 0x3c7df3fb. +// +// Solidity: function onChanCloseInit((string,string) msg_) returns() +func (_Mockapp *MockappTransactor) OnChanCloseInit(opts *bind.TransactOpts, msg_ IIBCModuleMsgOnChanCloseInit) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "onChanCloseInit", msg_) +} + +// OnChanCloseInit is a paid mutator transaction binding the contract method 0x3c7df3fb. +// +// Solidity: function onChanCloseInit((string,string) msg_) returns() +func (_Mockapp *MockappSession) OnChanCloseInit(msg_ IIBCModuleMsgOnChanCloseInit) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanCloseInit(&_Mockapp.TransactOpts, msg_) +} + +// OnChanCloseInit is a paid mutator transaction binding the contract method 0x3c7df3fb. +// +// Solidity: function onChanCloseInit((string,string) msg_) returns() +func (_Mockapp *MockappTransactorSession) OnChanCloseInit(msg_ IIBCModuleMsgOnChanCloseInit) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanCloseInit(&_Mockapp.TransactOpts, msg_) +} + +// OnChanOpenAck is a paid mutator transaction binding the contract method 0x12f6ff6f. +// +// Solidity: function onChanOpenAck((string,string,string) ) returns() +func (_Mockapp *MockappTransactor) OnChanOpenAck(opts *bind.TransactOpts, arg0 IIBCModuleMsgOnChanOpenAck) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "onChanOpenAck", arg0) +} + +// OnChanOpenAck is a paid mutator transaction binding the contract method 0x12f6ff6f. +// +// Solidity: function onChanOpenAck((string,string,string) ) returns() +func (_Mockapp *MockappSession) OnChanOpenAck(arg0 IIBCModuleMsgOnChanOpenAck) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanOpenAck(&_Mockapp.TransactOpts, arg0) +} + +// OnChanOpenAck is a paid mutator transaction binding the contract method 0x12f6ff6f. +// +// Solidity: function onChanOpenAck((string,string,string) ) returns() +func (_Mockapp *MockappTransactorSession) OnChanOpenAck(arg0 IIBCModuleMsgOnChanOpenAck) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanOpenAck(&_Mockapp.TransactOpts, arg0) +} + +// OnChanOpenConfirm is a paid mutator transaction binding the contract method 0x81b174dc. +// +// Solidity: function onChanOpenConfirm((string,string) ) returns() +func (_Mockapp *MockappTransactor) OnChanOpenConfirm(opts *bind.TransactOpts, arg0 IIBCModuleMsgOnChanOpenConfirm) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "onChanOpenConfirm", arg0) +} + +// OnChanOpenConfirm is a paid mutator transaction binding the contract method 0x81b174dc. +// +// Solidity: function onChanOpenConfirm((string,string) ) returns() +func (_Mockapp *MockappSession) OnChanOpenConfirm(arg0 IIBCModuleMsgOnChanOpenConfirm) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanOpenConfirm(&_Mockapp.TransactOpts, arg0) +} + +// OnChanOpenConfirm is a paid mutator transaction binding the contract method 0x81b174dc. +// +// Solidity: function onChanOpenConfirm((string,string) ) returns() +func (_Mockapp *MockappTransactorSession) OnChanOpenConfirm(arg0 IIBCModuleMsgOnChanOpenConfirm) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanOpenConfirm(&_Mockapp.TransactOpts, arg0) +} + +// OnChanOpenInit is a paid mutator transaction binding the contract method 0x0b7b4ccb. +// +// Solidity: function onChanOpenInit((uint8,string[],string,string,(string,string),string) msg_) returns(string) +func (_Mockapp *MockappTransactor) OnChanOpenInit(opts *bind.TransactOpts, msg_ IIBCModuleMsgOnChanOpenInit) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "onChanOpenInit", msg_) +} + +// OnChanOpenInit is a paid mutator transaction binding the contract method 0x0b7b4ccb. +// +// Solidity: function onChanOpenInit((uint8,string[],string,string,(string,string),string) msg_) returns(string) +func (_Mockapp *MockappSession) OnChanOpenInit(msg_ IIBCModuleMsgOnChanOpenInit) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanOpenInit(&_Mockapp.TransactOpts, msg_) +} + +// OnChanOpenInit is a paid mutator transaction binding the contract method 0x0b7b4ccb. +// +// Solidity: function onChanOpenInit((uint8,string[],string,string,(string,string),string) msg_) returns(string) +func (_Mockapp *MockappTransactorSession) OnChanOpenInit(msg_ IIBCModuleMsgOnChanOpenInit) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanOpenInit(&_Mockapp.TransactOpts, msg_) +} + +// OnChanOpenTry is a paid mutator transaction binding the contract method 0xa7a61e66. +// +// Solidity: function onChanOpenTry((uint8,string[],string,string,(string,string),string) msg_) returns(string) +func (_Mockapp *MockappTransactor) OnChanOpenTry(opts *bind.TransactOpts, msg_ IIBCModuleMsgOnChanOpenTry) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "onChanOpenTry", msg_) +} + +// OnChanOpenTry is a paid mutator transaction binding the contract method 0xa7a61e66. +// +// Solidity: function onChanOpenTry((uint8,string[],string,string,(string,string),string) msg_) returns(string) +func (_Mockapp *MockappSession) OnChanOpenTry(msg_ IIBCModuleMsgOnChanOpenTry) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanOpenTry(&_Mockapp.TransactOpts, msg_) +} + +// OnChanOpenTry is a paid mutator transaction binding the contract method 0xa7a61e66. +// +// Solidity: function onChanOpenTry((uint8,string[],string,string,(string,string),string) msg_) returns(string) +func (_Mockapp *MockappTransactorSession) OnChanOpenTry(msg_ IIBCModuleMsgOnChanOpenTry) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanOpenTry(&_Mockapp.TransactOpts, msg_) +} + +// OnChanUpgradeOpen is a paid mutator transaction binding the contract method 0x5e11a220. +// +// Solidity: function onChanUpgradeOpen(string portId, string channelId, uint64 upgradeSequence) returns() +func (_Mockapp *MockappTransactor) OnChanUpgradeOpen(opts *bind.TransactOpts, portId string, channelId string, upgradeSequence uint64) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "onChanUpgradeOpen", portId, channelId, upgradeSequence) +} + +// OnChanUpgradeOpen is a paid mutator transaction binding the contract method 0x5e11a220. +// +// Solidity: function onChanUpgradeOpen(string portId, string channelId, uint64 upgradeSequence) returns() +func (_Mockapp *MockappSession) OnChanUpgradeOpen(portId string, channelId string, upgradeSequence uint64) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanUpgradeOpen(&_Mockapp.TransactOpts, portId, channelId, upgradeSequence) +} + +// OnChanUpgradeOpen is a paid mutator transaction binding the contract method 0x5e11a220. +// +// Solidity: function onChanUpgradeOpen(string portId, string channelId, uint64 upgradeSequence) returns() +func (_Mockapp *MockappTransactorSession) OnChanUpgradeOpen(portId string, channelId string, upgradeSequence uint64) (*types.Transaction, error) { + return _Mockapp.Contract.OnChanUpgradeOpen(&_Mockapp.TransactOpts, portId, channelId, upgradeSequence) +} + +// ProposeAndInitUpgrade is a paid mutator transaction binding the contract method 0xbef8680f. +// +// Solidity: function proposeAndInitUpgrade(string portId, string channelId, (uint8,string[],string) proposedUpgradeFields, ((uint64,uint64),uint64) timeout) returns(uint64) +func (_Mockapp *MockappTransactor) ProposeAndInitUpgrade(opts *bind.TransactOpts, portId string, channelId string, proposedUpgradeFields UpgradeFieldsData, timeout TimeoutData) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "proposeAndInitUpgrade", portId, channelId, proposedUpgradeFields, timeout) +} + +// ProposeAndInitUpgrade is a paid mutator transaction binding the contract method 0xbef8680f. +// +// Solidity: function proposeAndInitUpgrade(string portId, string channelId, (uint8,string[],string) proposedUpgradeFields, ((uint64,uint64),uint64) timeout) returns(uint64) +func (_Mockapp *MockappSession) ProposeAndInitUpgrade(portId string, channelId string, proposedUpgradeFields UpgradeFieldsData, timeout TimeoutData) (*types.Transaction, error) { + return _Mockapp.Contract.ProposeAndInitUpgrade(&_Mockapp.TransactOpts, portId, channelId, proposedUpgradeFields, timeout) +} + +// ProposeAndInitUpgrade is a paid mutator transaction binding the contract method 0xbef8680f. +// +// Solidity: function proposeAndInitUpgrade(string portId, string channelId, (uint8,string[],string) proposedUpgradeFields, ((uint64,uint64),uint64) timeout) returns(uint64) +func (_Mockapp *MockappTransactorSession) ProposeAndInitUpgrade(portId string, channelId string, proposedUpgradeFields UpgradeFieldsData, timeout TimeoutData) (*types.Transaction, error) { + return _Mockapp.Contract.ProposeAndInitUpgrade(&_Mockapp.TransactOpts, portId, channelId, proposedUpgradeFields, timeout) +} + +// ProposeUpgrade is a paid mutator transaction binding the contract method 0xd6438586. +// +// Solidity: function proposeUpgrade(string portId, string channelId, (uint8,string[],string) upgradeFields, ((uint64,uint64),uint64) timeout) returns() +func (_Mockapp *MockappTransactor) ProposeUpgrade(opts *bind.TransactOpts, portId string, channelId string, upgradeFields UpgradeFieldsData, timeout TimeoutData) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "proposeUpgrade", portId, channelId, upgradeFields, timeout) +} + +// ProposeUpgrade is a paid mutator transaction binding the contract method 0xd6438586. +// +// Solidity: function proposeUpgrade(string portId, string channelId, (uint8,string[],string) upgradeFields, ((uint64,uint64),uint64) timeout) returns() +func (_Mockapp *MockappSession) ProposeUpgrade(portId string, channelId string, upgradeFields UpgradeFieldsData, timeout TimeoutData) (*types.Transaction, error) { + return _Mockapp.Contract.ProposeUpgrade(&_Mockapp.TransactOpts, portId, channelId, upgradeFields, timeout) +} + +// ProposeUpgrade is a paid mutator transaction binding the contract method 0xd6438586. +// +// Solidity: function proposeUpgrade(string portId, string channelId, (uint8,string[],string) upgradeFields, ((uint64,uint64),uint64) timeout) returns() +func (_Mockapp *MockappTransactorSession) ProposeUpgrade(portId string, channelId string, upgradeFields UpgradeFieldsData, timeout TimeoutData) (*types.Transaction, error) { + return _Mockapp.Contract.ProposeUpgrade(&_Mockapp.TransactOpts, portId, channelId, upgradeFields, timeout) +} + +// RemoveUpgradeProposal is a paid mutator transaction binding the contract method 0x0cc5a7af. +// +// Solidity: function removeUpgradeProposal(string portId, string channelId) returns() +func (_Mockapp *MockappTransactor) RemoveUpgradeProposal(opts *bind.TransactOpts, portId string, channelId string) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "removeUpgradeProposal", portId, channelId) +} + +// RemoveUpgradeProposal is a paid mutator transaction binding the contract method 0x0cc5a7af. +// +// Solidity: function removeUpgradeProposal(string portId, string channelId) returns() +func (_Mockapp *MockappSession) RemoveUpgradeProposal(portId string, channelId string) (*types.Transaction, error) { + return _Mockapp.Contract.RemoveUpgradeProposal(&_Mockapp.TransactOpts, portId, channelId) +} + +// RemoveUpgradeProposal is a paid mutator transaction binding the contract method 0x0cc5a7af. +// +// Solidity: function removeUpgradeProposal(string portId, string channelId) returns() +func (_Mockapp *MockappTransactorSession) RemoveUpgradeProposal(portId string, channelId string) (*types.Transaction, error) { + return _Mockapp.Contract.RemoveUpgradeProposal(&_Mockapp.TransactOpts, portId, channelId) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Mockapp *MockappTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Mockapp *MockappSession) RenounceOwnership() (*types.Transaction, error) { + return _Mockapp.Contract.RenounceOwnership(&_Mockapp.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_Mockapp *MockappTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _Mockapp.Contract.RenounceOwnership(&_Mockapp.TransactOpts) +} + +// SendPacket is a paid mutator transaction binding the contract method 0xd9df74fd. +// +// Solidity: function sendPacket(bytes message, string sourcePort, string sourceChannel, (uint64,uint64) timeoutHeight, uint64 timeoutTimestamp) returns(uint64) +func (_Mockapp *MockappTransactor) SendPacket(opts *bind.TransactOpts, message []byte, sourcePort string, sourceChannel string, timeoutHeight HeightData, timeoutTimestamp uint64) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "sendPacket", message, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp) +} + +// SendPacket is a paid mutator transaction binding the contract method 0xd9df74fd. +// +// Solidity: function sendPacket(bytes message, string sourcePort, string sourceChannel, (uint64,uint64) timeoutHeight, uint64 timeoutTimestamp) returns(uint64) +func (_Mockapp *MockappSession) SendPacket(message []byte, sourcePort string, sourceChannel string, timeoutHeight HeightData, timeoutTimestamp uint64) (*types.Transaction, error) { + return _Mockapp.Contract.SendPacket(&_Mockapp.TransactOpts, message, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp) +} + +// SendPacket is a paid mutator transaction binding the contract method 0xd9df74fd. +// +// Solidity: function sendPacket(bytes message, string sourcePort, string sourceChannel, (uint64,uint64) timeoutHeight, uint64 timeoutTimestamp) returns(uint64) +func (_Mockapp *MockappTransactorSession) SendPacket(message []byte, sourcePort string, sourceChannel string, timeoutHeight HeightData, timeoutTimestamp uint64) (*types.Transaction, error) { + return _Mockapp.Contract.SendPacket(&_Mockapp.TransactOpts, message, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Mockapp *MockappTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Mockapp *MockappSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Mockapp.Contract.TransferOwnership(&_Mockapp.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_Mockapp *MockappTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _Mockapp.Contract.TransferOwnership(&_Mockapp.TransactOpts, newOwner) +} + +// WriteAcknowledgement is a paid mutator transaction binding the contract method 0x62892d7a. +// +// Solidity: function writeAcknowledgement(string destinationPort, string destinationChannel, uint64 sequence) returns() +func (_Mockapp *MockappTransactor) WriteAcknowledgement(opts *bind.TransactOpts, destinationPort string, destinationChannel string, sequence uint64) (*types.Transaction, error) { + return _Mockapp.contract.Transact(opts, "writeAcknowledgement", destinationPort, destinationChannel, sequence) +} + +// WriteAcknowledgement is a paid mutator transaction binding the contract method 0x62892d7a. +// +// Solidity: function writeAcknowledgement(string destinationPort, string destinationChannel, uint64 sequence) returns() +func (_Mockapp *MockappSession) WriteAcknowledgement(destinationPort string, destinationChannel string, sequence uint64) (*types.Transaction, error) { + return _Mockapp.Contract.WriteAcknowledgement(&_Mockapp.TransactOpts, destinationPort, destinationChannel, sequence) +} + +// WriteAcknowledgement is a paid mutator transaction binding the contract method 0x62892d7a. +// +// Solidity: function writeAcknowledgement(string destinationPort, string destinationChannel, uint64 sequence) returns() +func (_Mockapp *MockappTransactorSession) WriteAcknowledgement(destinationPort string, destinationChannel string, sequence uint64) (*types.Transaction, error) { + return _Mockapp.Contract.WriteAcknowledgement(&_Mockapp.TransactOpts, destinationPort, destinationChannel, sequence) +} + +// MockappOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Mockapp contract. +type MockappOwnershipTransferredIterator struct { + Event *MockappOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *MockappOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(MockappOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(MockappOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *MockappOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MockappOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MockappOwnershipTransferred represents a OwnershipTransferred event raised by the Mockapp contract. +type MockappOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_Mockapp *MockappFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*MockappOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _Mockapp.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &MockappOwnershipTransferredIterator{contract: _Mockapp.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_Mockapp *MockappFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MockappOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _Mockapp.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(MockappOwnershipTransferred) + if err := _Mockapp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_Mockapp *MockappFilterer) ParseOwnershipTransferred(log types.Log) (*MockappOwnershipTransferred, error) { + event := new(MockappOwnershipTransferred) + if err := _Mockapp.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/pkg/relay/ethereum/cmd.go b/pkg/relay/ethereum/cmd.go new file mode 100644 index 0000000..95c3fcf --- /dev/null +++ b/pkg/relay/ethereum/cmd.go @@ -0,0 +1,191 @@ +package ethereum + +import ( + "fmt" + + clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" + chantypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" + "github.com/datachainlab/ethereum-ibc-relay-chain/pkg/contract/mockapp" + "github.com/ethereum/go-ethereum/common" + "github.com/hyperledger-labs/yui-relayer/config" + "github.com/spf13/cobra" +) + +func ethereumCmd(ctx *config.Context) *cobra.Command { + cmd := cobra.Command{ + Use: "ethereum", + Aliases: []string{"eth"}, + } + + cmd.AddCommand( + channelUpgradeCmd(ctx), + ) + + return &cmd +} + +func channelUpgradeCmd(ctx *config.Context) *cobra.Command { + cmd := cobra.Command{ + Use: "channel-upgrade", + Aliases: []string{"upgrade"}, + } + + cmd.AddCommand( + proposeUpgradeCmd(ctx), + allowTransitionToFlushCompleteCmd(ctx), + ) + + return &cmd +} + +func proposeUpgradeCmd(ctx *config.Context) *cobra.Command { + const ( + flagAppAddress = "app-address" + flagOrdering = "ordering" + flagConnectionHops = "connection-hops" + flagVersion = "version" + flagTimeoutHeight = "timeout-height" + flagTimeoutTimestamp = "timeout-timestamp" + ) + + cmd := cobra.Command{ + Use: "propose-init", + Aliases: []string{"propose"}, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + pathName := args[0] + chainID := args[1] + + // get app address from flags + var appAddr common.Address + if appAddrHex, err := cmd.Flags().GetString(flagAppAddress); err != nil { + return err + } else { + appAddr = common.HexToAddress(appAddrHex) + } + + // get ordering from flags + var ordering uint8 + if s, err := cmd.Flags().GetString(flagOrdering); err != nil { + return err + } else if n := chantypes.Order_value[s]; n == 0 { + return fmt.Errorf("invalid ordering flag: %s", s) + } else { + ordering = uint8(n) + } + + // get connection hops from flags + connHops, err := cmd.Flags().GetStringSlice(flagConnectionHops) + if err != nil { + return err + } + + // get version from flags + version, err := cmd.Flags().GetString(flagVersion) + if err != nil { + return err + } + + // get timeout height + var timeoutHeight clienttypes.Height + if s, err := cmd.Flags().GetString(flagTimeoutHeight); err != nil { + return err + } else if timeoutHeight, err = clienttypes.ParseHeight(s); err != nil { + return err + } + + // get timeout timestamp + timeoutTimestamp, err := cmd.Flags().GetUint64(flagTimeoutTimestamp) + if err != nil { + return err + } + + var ethChain *Chain + if chains, _, _, err := ctx.Config.ChainsFromPath(pathName); err != nil { + return err + } else if chain, ok := chains[chainID]; !ok { + return fmt.Errorf("chain not found: %s", chainID) + } else if ethChain, ok = chain.Chain.(*Chain); !ok { + return fmt.Errorf("chain is not ethereum: %T", chain.Chain) + } + + return ethChain.ProposeUpgrade( + cmd.Context(), + appAddr, + ethChain.pathEnd.PortID, + ethChain.pathEnd.ChannelID, + mockapp.UpgradeFieldsData{ + Ordering: ordering, + ConnectionHops: connHops, + Version: version, + }, + mockapp.TimeoutData{ + Height: mockapp.HeightData(timeoutHeight), + Timestamp: timeoutTimestamp, + }, + ) + }, + } + + cmd.Flags().String(flagAppAddress, "", "IBC app module address") + cmd.Flags().String(flagOrdering, "", "channel ordering applied for the new channel") + cmd.Flags().StringSlice(flagConnectionHops, []string{}, "connection hops applied for the new channel") + cmd.Flags().String(flagVersion, "", "channel version applied for the new channel") + cmd.Flags().String(flagTimeoutHeight, "", "timeout height") + cmd.Flags().Uint64(flagTimeoutTimestamp, 0, "timeout timestamp") + + return &cmd +} + +func allowTransitionToFlushCompleteCmd(ctx *config.Context) *cobra.Command { + const ( + flagAppAddress = "app-address" + flagUpgradeSequence = "upgrade-sequence" + ) + + cmd := cobra.Command{ + Use: "allow-transition-to-flush-complete", + Aliases: []string{"allow"}, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + pathName := args[0] + chainID := args[1] + + // get app address from flags + var appAddr common.Address + if appAddrHex, err := cmd.Flags().GetString(flagAppAddress); err != nil { + return err + } else { + appAddr = common.HexToAddress(appAddrHex) + } + + // get upgrade sequence from flags + upgradeSequence, err := cmd.Flags().GetUint64(flagUpgradeSequence) + if err != nil { + return err + } + + var ethChain *Chain + if chains, _, _, err := ctx.Config.ChainsFromPath(pathName); err != nil { + return err + } else if chain, ok := chains[chainID]; !ok { + return fmt.Errorf("chain not found: %s", chainID) + } else if ethChain, ok = chain.Chain.(*Chain); !ok { + return fmt.Errorf("chain is not ethereum: %T", chain.Chain) + } + + return ethChain.AllowTransitionToFlushComplete( + cmd.Context(), + appAddr, + ethChain.pathEnd.PortID, + ethChain.pathEnd.ChannelID, + upgradeSequence, + ) + }, + } + + cmd.Flags().String(flagAppAddress, "", "IBC app module address") + cmd.Flags().String(flagUpgradeSequence, "", "upgrade sequence") + + return &cmd +} diff --git a/pkg/relay/ethereum/module.go b/pkg/relay/ethereum/module.go index 6f193b4..e0d8dc7 100644 --- a/pkg/relay/ethereum/module.go +++ b/pkg/relay/ethereum/module.go @@ -25,7 +25,7 @@ func (Module) RegisterInterfaces(registry codectypes.InterfaceRegistry) { // GetCmd returns the command func (Module) GetCmd(ctx *config.Context) *cobra.Command { - return nil + return ethereumCmd(ctx) } func GetModuleLogger() *log.RelayLogger { diff --git a/pkg/relay/ethereum/upgrade.go b/pkg/relay/ethereum/upgrade.go new file mode 100644 index 0000000..aad78e0 --- /dev/null +++ b/pkg/relay/ethereum/upgrade.go @@ -0,0 +1,90 @@ +package ethereum + +import ( + "context" + "fmt" + + "github.com/datachainlab/ethereum-ibc-relay-chain/pkg/contract/mockapp" + "github.com/ethereum/go-ethereum/common" + gethtypes "github.com/ethereum/go-ethereum/core/types" +) + +func (c *Chain) ProposeUpgrade( + ctx context.Context, + appAddr common.Address, + portID string, + channelID string, + upgradeFields mockapp.UpgradeFieldsData, + timeout mockapp.TimeoutData, +) error { + mockApp, err := mockapp.NewMockapp( + appAddr, + c.client.Client, + ) + if err != nil { + return nil + } + + txOpts, err := c.TxOpts(ctx, true) + if err != nil { + return err + } + + tx, err := mockApp.ProposeUpgrade( + txOpts, + portID, + channelID, + upgradeFields, + timeout, + ) + if err != nil { + return err + } + + if receipt, err := c.client.WaitForReceiptAndGet(ctx, tx.Hash()); err != nil { + return err + } else if receipt.Status == gethtypes.ReceiptStatusFailed { + return fmt.Errorf("tx execution reverted") + } + + return nil +} + +func (c *Chain) AllowTransitionToFlushComplete( + ctx context.Context, + appAddr common.Address, + portID string, + channelID string, + upgradeSequence uint64, +) error { + mockApp, err := mockapp.NewMockapp( + appAddr, + c.client.Client, + ) + if err != nil { + return nil + } + + txOpts, err := c.TxOpts(ctx, true) + if err != nil { + return err + } + + tx, err := mockApp.AllowTransitionToFlushComplete( + txOpts, + portID, + channelID, + upgradeSequence, + ) + if err != nil { + return err + } + + if receipt, err := c.client.WaitForReceiptAndGet(ctx, tx.Hash()); err != nil { + return err + } else if receipt.Status == gethtypes.ReceiptStatusFailed { + return fmt.Errorf("tx execution reverted") + } + + return nil +}