diff --git a/.golangci.yml b/.golangci.yml index 7b272a58..6dc7ed49 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,7 +8,7 @@ linters: enable: - bodyclose - deadcode - - depguard + # - depguard - dogsled # - errcheck - goconst diff --git a/app/app.go b/app/app.go index 3853fcbb..efb8d2e9 100644 --- a/app/app.go +++ b/app/app.go @@ -103,6 +103,10 @@ import ( auctionclient "github.com/peggyjv/sommelier/v7/x/auction/client" auctionkeeper "github.com/peggyjv/sommelier/v7/x/auction/keeper" auctiontypes "github.com/peggyjv/sommelier/v7/x/auction/types" + "github.com/peggyjv/sommelier/v7/x/axelarcork" + axelarcorkclient "github.com/peggyjv/sommelier/v7/x/axelarcork/client" + axelarcorkkeeper "github.com/peggyjv/sommelier/v7/x/axelarcork/keeper" + axelarcorktypes "github.com/peggyjv/sommelier/v7/x/axelarcork/types" "github.com/peggyjv/sommelier/v7/x/cellarfees" cellarfeeskeeper "github.com/peggyjv/sommelier/v7/x/cellarfees/keeper" cellarfeestypes "github.com/peggyjv/sommelier/v7/x/cellarfees/types" @@ -159,6 +163,14 @@ var ( gravityclient.ProposalHandler, corkclient.AddProposalHandler, corkclient.RemoveProposalHandler, + axelarcorkclient.AddProposalHandler, + axelarcorkclient.RemoveProposalHandler, + axelarcorkclient.AddChainConfigurationHandler, + axelarcorkclient.RemoveChainConfigurationHandler, + axelarcorkclient.ScheduledCorkProposalHandler, + axelarcorkclient.CommunityPoolEthereumSpendProposalHandler, + axelarcorkclient.UpgradeAxelarProxyContractHandler, + axelarcorkclient.CancelAxelarProxyContractUpgradeHandler, corkclient.ScheduledCorkProposalHandler, auctionclient.SetProposalHandler, pubsubclient.AddPublisherProposalHandler, @@ -179,6 +191,7 @@ var ( authzmodule.AppModuleBasic{}, gravity.AppModuleBasic{}, cork.AppModuleBasic{}, + axelarcork.AppModuleBasic{}, cellarfees.AppModuleBasic{}, incentives.AppModuleBasic{}, auction.AppModuleBasic{}, @@ -198,6 +211,7 @@ var ( gravitytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, cellarfeestypes.ModuleName: nil, incentivestypes.ModuleName: nil, + axelarcorktypes.ModuleName: nil, auctiontypes.ModuleName: nil, pubsubtypes.ModuleName: nil, } @@ -247,15 +261,17 @@ type SommelierApp struct { // Sommelier keepers CorkKeeper corkkeeper.Keeper + AxelarCorkKeeper axelarcorkkeeper.Keeper CellarFeesKeeper cellarfeeskeeper.Keeper IncentivesKeeper incentiveskeeper.Keeper AuctionKeeper auctionkeeper.Keeper PubsubKeeper pubsubkeeper.Keeper // make capability scoped keepers public for test purposes (IBC only) - ScopedIBCKeeper capabilitykeeper.ScopedKeeper - ScopedTransferKeeper capabilitykeeper.ScopedKeeper - ScopedICAHostKeeper capabilitykeeper.ScopedKeeper + ScopedAxelarCorkKeeper capabilitykeeper.ScopedKeeper + ScopedIBCKeeper capabilitykeeper.ScopedKeeper + ScopedTransferKeeper capabilitykeeper.ScopedKeeper + ScopedICAHostKeeper capabilitykeeper.ScopedKeeper // the module manager mm *module.Manager @@ -309,6 +325,7 @@ func NewSommelierApp( feegrant.StoreKey, authzkeeper.StoreKey, corktypes.StoreKey, + axelarcorktypes.StoreKey, incentivestypes.StoreKey, auctiontypes.StoreKey, cellarfeestypes.StoreKey, @@ -337,6 +354,7 @@ func NewSommelierApp( scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + scopedAxelarCorkKeeper := app.CapabilityKeeper.ScopeToModule(axelarcorktypes.ModuleName) app.CapabilityKeeper.Seal() // add keepers @@ -394,8 +412,23 @@ func NewSommelierApp( app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, ) + + // create axelar cork keeper + app.AxelarCorkKeeper = axelarcorkkeeper.NewKeeper( + appCodec, + keys[axelarcorktypes.StoreKey], + app.GetSubspace(axelarcorktypes.ModuleName), + app.AccountKeeper, + app.StakingKeeper, + app.TransferKeeper, + app.DistrKeeper, + app.IBCKeeper.ChannelKeeper, + app.GravityKeeper, + ) transferModule := ibctransfer.NewAppModule(app.TransferKeeper) transferIBCModule := ibctransfer.NewIBCModule(app.TransferKeeper) + var transferStack ibcporttypes.IBCModule = transferIBCModule + transferStack = axelarcork.NewIBCMiddleware(app.AxelarCorkKeeper, transferStack) // Create the ICAHost Keeper app.ICAHostKeeper = icahostkeeper.NewKeeper( @@ -462,6 +495,7 @@ func NewSommelierApp( AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). AddRoute(corktypes.RouterKey, cork.NewProposalHandler(app.CorkKeeper)). + AddRoute(axelarcorktypes.RouterKey, axelarcork.NewProposalHandler(app.AxelarCorkKeeper)). AddRoute(gravitytypes.RouterKey, gravity.NewCommunityPoolEthereumSpendProposalHandler(app.GravityKeeper)). AddRoute(auctiontypes.RouterKey, auction.NewSetTokenPricesProposalHandler(app.AuctionKeeper)). AddRoute(pubsubtypes.RouterKey, pubsub.NewPubsubProposalHandler(app.PubsubKeeper)) @@ -473,7 +507,7 @@ func NewSommelierApp( // Create static IBC router, add transfer route, then set and seal it ibcRouter := ibcporttypes.NewRouter() ibcRouter. - AddRoute(ibctransfertypes.ModuleName, transferIBCModule). + AddRoute(ibctransfertypes.ModuleName, transferStack). AddRoute(icahosttypes.SubModuleName, icaHostIBCModule) app.IBCKeeper.SetRouter(ibcRouter) @@ -517,6 +551,7 @@ func NewSommelierApp( ica.NewAppModule(nil, &app.ICAHostKeeper), params.NewAppModule(app.ParamsKeeper), transferModule, + axelarcork.NewAppModule(app.AxelarCorkKeeper, appCodec), gravity.NewAppModule(app.GravityKeeper, app.BankKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), cork.NewAppModule(app.CorkKeeper, appCodec), @@ -554,6 +589,7 @@ func NewSommelierApp( incentivestypes.ModuleName, gravitytypes.ModuleName, corktypes.ModuleName, + axelarcorktypes.ModuleName, cellarfeestypes.ModuleName, auctiontypes.ModuleName, pubsubtypes.ModuleName, @@ -583,6 +619,7 @@ func NewSommelierApp( incentivestypes.ModuleName, gravitytypes.ModuleName, corktypes.ModuleName, + axelarcorktypes.ModuleName, cellarfeestypes.ModuleName, auctiontypes.ModuleName, pubsubtypes.ModuleName, @@ -620,6 +657,7 @@ func NewSommelierApp( gravitytypes.ModuleName, incentivestypes.ModuleName, corktypes.ModuleName, + axelarcorktypes.ModuleName, cellarfeestypes.ModuleName, auctiontypes.ModuleName, pubsubtypes.ModuleName, @@ -651,6 +689,7 @@ func NewSommelierApp( ibc.NewAppModule(app.IBCKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), cork.NewAppModule(app.CorkKeeper, appCodec), + axelarcork.NewAppModule(app.AxelarCorkKeeper, appCodec), incentives.NewAppModule(app.IncentivesKeeper, app.DistrKeeper, app.BankKeeper, app.MintKeeper, appCodec), cellarfees.NewAppModule(app.CellarFeesKeeper, appCodec, app.AccountKeeper, app.BankKeeper, app.MintKeeper, app.CorkKeeper, app.GravityKeeper, app.AuctionKeeper), auction.NewAppModule(app.AuctionKeeper, app.BankKeeper, app.AccountKeeper, appCodec), @@ -691,6 +730,7 @@ func NewSommelierApp( app.ScopedIBCKeeper = scopedIBCKeeper app.ScopedTransferKeeper = scopedTransferKeeper app.ScopedICAHostKeeper = scopedICAHostKeeper + app.ScopedAxelarCorkKeeper = scopedAxelarCorkKeeper return app } @@ -887,6 +927,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(icahosttypes.SubModuleName) paramsKeeper.Subspace(gravitytypes.ModuleName) paramsKeeper.Subspace(corktypes.ModuleName) + paramsKeeper.Subspace(axelarcorktypes.ModuleName) paramsKeeper.Subspace(cellarfeestypes.ModuleName) paramsKeeper.Subspace(incentivestypes.ModuleName) paramsKeeper.Subspace(auctiontypes.ModuleName) diff --git a/app/upgrades/v4/upgrades_test.go b/app/upgrades/v4/upgrades_test.go deleted file mode 100644 index 001211e7..00000000 --- a/app/upgrades/v4/upgrades_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package v4 - -import ( - "strings" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ethereum/go-ethereum/common" - "github.com/peggyjv/gravity-bridge/module/v3/x/gravity/keeper" - "github.com/peggyjv/gravity-bridge/module/v3/x/gravity/types" - "github.com/stretchr/testify/require" -) - -func TestV4UpgradeDenomNormalization(t *testing.T) { - input := keeper.CreateTestEnv(t) - ctx := input.Context - - addr, _ := sdk.AccAddressFromBech32("cosmos1ahx7f8wyertuus9r20284ej0asrs085case3kn") - erc20contract := common.HexToAddress("0x429881672B9AE42b8EbA0E26cD9C73711b891Ca5") - amount := sdk.NewInt(1000) - - // mint some tokens - incorrectDenom := strings.ToLower(types.GravityDenom(erc20contract)) - gravityCoins := sdk.NewCoins(sdk.NewCoin(incorrectDenom, amount)) - err := input.BankKeeper.MintCoins(ctx, types.ModuleName, gravityCoins) - require.NoError(t, err) - - // set account's balance - input.AccountKeeper.NewAccountWithAddress(ctx, addr) - require.NoError(t, input.BankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, addr, gravityCoins)) - oldBalance := input.BankKeeper.GetAllBalances(ctx, addr) - require.Equal(t, oldBalance, gravityCoins) - - normalizeGravityDenoms(ctx, input.BankKeeper) - - normalizedDenom := types.NormalizeDenom(incorrectDenom) - newBalance := input.BankKeeper.GetAllBalances(ctx, addr) - require.Equal(t, newBalance, sdk.NewCoins(sdk.NewCoin(normalizedDenom, amount))) -} diff --git a/app/upgrades/v7/constants.go b/app/upgrades/v7/constants.go index 2e7bd2dd..4ae9b740 100644 --- a/app/upgrades/v7/constants.go +++ b/app/upgrades/v7/constants.go @@ -4,12 +4,13 @@ package v7 const UpgradeName = "v7" // 7seas domain -const SevenSeasDomain = "7seas.capital" +const SevenSeasDomain = "sevenseas.capital" -// TODO(bolten): update this // CA certificate literals // See source data at: https://github.com/PeggyJV/steward-registry -// data captured at commit cdee05a8bf97f264353e10ab65752710bfb85dc9 +// data captured at commit ecdb7f386e7e573edb5d8f6ad22a1a67cfa21863 +// leaving out made_in_block because I can't find their validator on-chain +// blockhunters hadn't been merged, but verified and added here // Publisher CA certificate const SevenSeasPublisherCA = `-----BEGIN CERTIFICATE----- @@ -499,3 +500,157 @@ N6juZKqdOw03MA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIwc7wP +8beG8Zyz8+MC8geQT/pOBFjYMo+zS0/WqxiuXWCHGLDedOApOWAv3xwiuaHfvRX -----END CERTIFICATE----- ` + +const GoldenRatioSubscriberCA = `-----BEGIN CERTIFICATE----- +MIICwjCCAkigAwIBAgIUTmlbzxXN7lCSmCmeYsW5BHpbDmUwCgYIKoZIzj0EAwMw +gZcxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJ +bnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxKTAnBgNVBAMMIHNvbW1lbGllci5nb2xk +ZW5yYXRpb3N0YWtpbmcubmV0MSUwIwYJKoZIhvcNAQkBFhZpbmZvQGdvbGRlbnN0 +YWtpbmcuY29tMB4XDTIzMDYxNTE3NDg0NloXDTI1MDYxNDE3NDg0NlowgZcxCzAJ +BgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5l +dCBXaWRnaXRzIFB0eSBMdGQxKTAnBgNVBAMMIHNvbW1lbGllci5nb2xkZW5yYXRp +b3N0YWtpbmcubmV0MSUwIwYJKoZIhvcNAQkBFhZpbmZvQGdvbGRlbnN0YWtpbmcu +Y29tMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEoOPN2wIe3BxLKHkfPgSfqndnpSIC +Cjb6eapS9zWzWE3BSm8PkqFX5ilIdQFre7vC5kdkx+wcP4K1ENKrG8mJiNwsfPME +tYr0dt9yTA0u5XWcH4nhim4fuq4dixrmWFCco1MwUTAdBgNVHQ4EFgQUEZOE8j2w +J7JFu9/Fn7SBIjf1N7AwHwYDVR0jBBgwFoAUEZOE8j2wJ7JFu9/Fn7SBIjf1N7Aw +DwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjBDlZ/sXQ+yiu3uzCpN +Y8sgQ+yFCuutwnC0LkmVwYybw9gtdQE79JOpwgb4vZUgX7QCMQCvA9wfEoS3LDhW +E+m4CKm4jME2S9VYpmHN656R5mX8CQQ7Wy1G+IUcOX/QBCHLl1g= +-----END CERTIFICATE----- +` + +const CryptoCrewSubscriberCA = `-----BEGIN CERTIFICATE----- +MIIDCDCCAo6gAwIBAgIUNUTiLAvawlgyAdvdGlYsTGmLw8kwCgYIKoZIzj0EAwMw +gboxCzAJBgNVBAYTAkFUMRMwEQYDVQQIDApTb21lLVN0YXRlMSgwJgYDVQQKDB9T +T0xWQSBCbG9ja2NoYWluIFNvbHV0aW9ucyBHbWJIMR4wHAYDVQQLDBVDcnlwdG9D +cmV3IFZhbGlkYXRvcnMxJjAkBgNVBAMMHXN0ZXdhcmQtc29tbS5jY3ZhbGlkYXRv +cnMuY29tMSQwIgYJKoZIhvcNAQkBFhVpbmZvQGNjdmFsaWRhdG9ycy5jb20wHhcN +MjMwNDEzMDQ0NTI2WhcNMjUwNDEyMDQ0NTI2WjCBujELMAkGA1UEBhMCQVQxEzAR +BgNVBAgMClNvbWUtU3RhdGUxKDAmBgNVBAoMH1NPTFZBIEJsb2NrY2hhaW4gU29s +dXRpb25zIEdtYkgxHjAcBgNVBAsMFUNyeXB0b0NyZXcgVmFsaWRhdG9yczEmMCQG +A1UEAwwdc3Rld2FyZC1zb21tLmNjdmFsaWRhdG9ycy5jb20xJDAiBgkqhkiG9w0B +CQEWFWluZm9AY2N2YWxpZGF0b3JzLmNvbTB2MBAGByqGSM49AgEGBSuBBAAiA2IA +BNUprvPRhwB864jaknavI4RPzgXv9BfWOdl8oIVwggpNH0w8KbsKq9nIZ9J4Viqk +UsY+kS8hJzR2jjEK9763T40BYhEruZ+4RkiuCb/hxICI1tcB8T4Y0CFYe37YDab6 +XaNTMFEwHQYDVR0OBBYEFOuGYuXRFowcT1ZHB43fGDxeHeJMMB8GA1UdIwQYMBaA +FOuGYuXRFowcT1ZHB43fGDxeHeJMMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0E +AwMDaAAwZQIweTKXQJ463bUH3DhJuLfpCGrewq5GwSQMcc0DXS01OTh4UbXjod+J +G/ksdyOwZqMGAjEA4nwkWotwVMu988zgOl/w5n+NmdH9b/qybqujnqY8VFvEk5lH +utjI6FZqrPdhiQDw +-----END CERTIFICATE----- +` + +const DoraFactorySubscriberCA = `-----BEGIN CERTIFICATE----- +MIICNzCCAbygAwIBAgIUYKbPgbWEtiNqgB4bao3JR5Xzgt4wCgYIKoZIzj0EAwMw +UjEVMBMGA1UECgwMRG9yYSBGYWN0b3J5MRUwEwYDVQQLDAxEb3JhIEZhY3Rvcnkx +IjAgBgNVBAMMGXNvbW1lbGllci5kb3JhZmFjdG9yeS5vcmcwHhcNMjMxMDMxMDkw +MjUzWhcNMjUxMDMwMDkwMjUzWjBSMRUwEwYDVQQKDAxEb3JhIEZhY3RvcnkxFTAT +BgNVBAsMDERvcmEgRmFjdG9yeTEiMCAGA1UEAwwZc29tbWVsaWVyLmRvcmFmYWN0 +b3J5Lm9yZzB2MBAGByqGSM49AgEGBSuBBAAiA2IABFe7uMCjv2jFQD+WmRbZZ2IF +20JW935FImH2t1ZLny5KMTyBpcqnUdYKR8ZkJBTPZk6Uv58mKr1nXVY6f9PTmaZx +OulptPgcZqjN3vbYWqeQ7RPqHA6uRxv+e4MLYdD7mqNTMFEwHQYDVR0OBBYEFMWX +BT8YThoH4Ay50Psdeqx5no4uMB8GA1UdIwQYMBaAFMWXBT8YThoH4Ay50Psdeqx5 +no4uMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaQAwZgIxAK/znJs5LblZ +Pz7OaQM+T3ODVMmKo/5twhd4XUZsENQgIoev6vogu1LBY/hHnQoQ7gIxAJ1qqxMt +RscyQImrpQQiNAI8oLxTQOeKYmjZDzKAYt6aRtuDtuq07mJISbLo64J8Ug== +-----END CERTIFICATE----- +` + +const FrenchChocolatineSubscriberCA = `-----BEGIN CERTIFICATE----- +MIICYjCCAeigAwIBAgIUXFbtefdxA1Iiv/MyYZODseX/AP4wCgYIKoZIzj0EAwMw +aDELMAkGA1UEBhMCRlIxEzARBgNVBAgMClNvbWUtU3RhdGUxGjAYBgNVBAoMEWZy +ZW5jaGNob2NvbGF0aW5lMSgwJgYDVQQDDB9zb21tZWxpZXIuZnJlbmNoY2hvY29s +YXRpbmUuY29tMB4XDTIzMDkxMDE0NDEyOVoXDTI1MDkwOTE0NDEyOVowaDELMAkG +A1UEBhMCRlIxEzARBgNVBAgMClNvbWUtU3RhdGUxGjAYBgNVBAoMEWZyZW5jaGNo +b2NvbGF0aW5lMSgwJgYDVQQDDB9zb21tZWxpZXIuZnJlbmNoY2hvY29sYXRpbmUu +Y29tMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE5z4t7/q0dkwuvX9pV+bgjQbKADed +iaVpHPTJkfdvYKdokxXh+cIQXqdlObVDf55Cwaj1PnMo3gbSRgpYzbdjdQ72HeYv ++k036fJkxuEk8fELAHhISBr/tPSb8Uc4YHFPo1MwUTAdBgNVHQ4EFgQUxWDtaeP9 +5ja/24RfDVrWeW542bkwHwYDVR0jBBgwFoAUxWDtaeP95ja/24RfDVrWeW542bkw +DwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEAxW8CtSO2ksGMbagp +CfxZqZJFoGyksz1NC9AoTE3hjsoK0Mzneyfg6VOnC5+Vc0z8AjBwHDWLkggPUs5f +GxXeMxoqZLNzIZ1BnMsMTrdId+jQnvzwI1zRBG1NiKvS4RnpIEI= +-----END CERTIFICATE----- +` +const FreshStakingSubscriberCA = `-----BEGIN CERTIFICATE----- +MIICBDCCAYqgAwIBAgIUKwEbgwfVTJ2Dwro3dVQR3oblUHIwCgYIKoZIzj0EAwMw +OTEVMBMGA1UECwwMRnJlc2hTVEFLSU5HMSAwHgYDVQQDDBdzb21tLXN0ZXdhcmQu +bWl0ZXJhLm5ldDAeFw0yMzAyMjcwMjU2MzlaFw0yNTAyMjYwMjU2MzlaMDkxFTAT +BgNVBAsMDEZyZXNoU1RBS0lORzEgMB4GA1UEAwwXc29tbS1zdGV3YXJkLm1pdGVy +YS5uZXQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAR4aTg3HyOXG2lVgYNjEN9fVBx9 +Mdbc/pH6IB1Mquz6zZ0L6X0DjynOls9V0Mc5ip1iXIM/+LUD95wp4C0uFQg9zPzH +9BtKYSbpvyGToMDeLfC3JGBKP0KdwAx3pIxae+ujUzBRMB0GA1UdDgQWBBTPyFz7 +9C4ye4m6YnR7cM9z6ngInTAfBgNVHSMEGDAWgBTPyFz79C4ye4m6YnR7cM9z6ngI +nTAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMDA2gAMGUCMFYHsqLWfD23WnCW +qrNyTdccEgcRkC1879tfI/+siPXOqi4FM1XY2PdIXgW5ibO+bwIxAPpX/Vskfclr +JCq5Apxw0R+f3wZxca4/oUGbNzzXSog6VBjaL8EjBGVELhTu1IL28w== +-----END CERTIFICATE----- +` + +const KleomedesSubscriberCA = `-----BEGIN CERTIFICATE----- +MIICnDCCAiKgAwIBAgIUb7tPRyrYNpfSekDia+U2/OLFjtEwCgYIKoZIzj0EAwMw +gYQxCzAJBgNVBAYTAklUMQswCQYDVQQIDAJOQTEPMA0GA1UEBwwGTmFwb2xpMRIw +EAYDVQQKDAlLbGVvbWVkZXMxIjAgBgNVBAMMGXN0ZXdhcmQua2xlb21lZGVzLm5l +dHdvcmsxHzAdBgkqhkiG9w0BCQEWEG1hcmNvQGtsZW9tZWQuZXMwHhcNMjMwNTA5 +MTQ1NDM5WhcNMjUwNTA4MTQ1NDM5WjCBhDELMAkGA1UEBhMCSVQxCzAJBgNVBAgM +Ak5BMQ8wDQYDVQQHDAZOYXBvbGkxEjAQBgNVBAoMCUtsZW9tZWRlczEiMCAGA1UE +AwwZc3Rld2FyZC5rbGVvbWVkZXMubmV0d29yazEfMB0GCSqGSIb3DQEJARYQbWFy +Y29Aa2xlb21lZC5lczB2MBAGByqGSM49AgEGBSuBBAAiA2IABLn0Q1D1K6wBY2ZI +MaA8GwMtLbMvnXTpKmTv/Eo+KKcI0Sb+LEYRZNjXWi2cF7k0vHi2zfynu5elfITj +5tRiOtNdSZDSzitjlzRoRRMhr+L8TigAOm2wu3eifLrejqBzfqNTMFEwHQYDVR0O +BBYEFLaeB97GB2b5cS4O+cumy+WCDxyrMB8GA1UdIwQYMBaAFLaeB97GB2b5cS4O ++cumy+WCDxyrMA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwMDaAAwZQIxALEO +BOo3c6ZXDwGgY36mi/xPb49yzvNxpMZpf0pyPwHXSrTG3KIfyL+aQ5Pf6Xjy2gIw +OWa00eoN0gQOaWmjGn8mJVcyNqI8T9nYO5XElE3EOfrmO11yYCPcVH17siYmKad6 +-----END CERTIFICATE----- +` + +const MeriaSubscriberCA = `-----BEGIN CERTIFICATE----- +MIICMzCCAbigAwIBAgIUDgDLT0raIVX67OkmtJmwyR6ABPEwCgYIKoZIzj0EAwMw +UDELMAkGA1UEBhMCRlIxEzARBgNVBAgMClNvbWUtU3RhdGUxDjAMBgNVBAoMBU1l +cmlhMRwwGgYDVQQDDBNzb21tZWxpZXIubWVyaWEuY29tMB4XDTIzMDQyNzE1MDcy +NloXDTI1MDQyNjE1MDcyNlowUDELMAkGA1UEBhMCRlIxEzARBgNVBAgMClNvbWUt +U3RhdGUxDjAMBgNVBAoMBU1lcmlhMRwwGgYDVQQDDBNzb21tZWxpZXIubWVyaWEu +Y29tMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE+aqP3x5uJRWbmicyoPQ/5/fp4AJU +ipiZ7KU6oLHV2vNvAVorBvnzE090ySUZ8Kac5tp6amxltJGQ5K3bWOYip5xJ9EqF +VS/ey12Lq7PUrr28p8RT6DTIB8RZYat+SDk3o1MwUTAdBgNVHQ4EFgQU+s3IFOYw +j+yPSH96D4+xlqBcbBkwHwYDVR0jBBgwFoAU+s3IFOYwj+yPSH96D4+xlqBcbBkw +DwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNpADBmAjEA0qB3CcN/R5ud3wGh +zP2Q8bM26FMgaaa09gyybk4drtzVXXHFKHDbbkh4zDH56oP+AjEA5ZpzvOScWlFB +M5BSLEfX2TIRLnEXeDUuT9eqYnLuoSADDJYbrxeTsVmRBZrR/wZs +-----END CERTIFICATE----- +` + +const RorcualSubscriberCA = `-----BEGIN CERTIFICATE----- +MIICWTCCAeCgAwIBAgIUKZU8T1uBzNoJYC3GMSAOYLbJk0MwCgYIKoZIzj0EAwMw +ZDETMBEGA1UECAwKU29tZS1TdGF0ZTEWMBQGA1UECgwNUm9yY3VhbCBOb2RlczES +MBAGA1UECwwJU29tbWVsaWVyMSEwHwYDVQQDDBhzdGV3YXJkLnJvcmN1YWxub2Rl +cy5jb20wHhcNMjMwOTA3MTAzMzA3WhcNMjUwOTA2MTAzMzA3WjBkMRMwEQYDVQQI +DApTb21lLVN0YXRlMRYwFAYDVQQKDA1Sb3JjdWFsIE5vZGVzMRIwEAYDVQQLDAlT +b21tZWxpZXIxITAfBgNVBAMMGHN0ZXdhcmQucm9yY3VhbG5vZGVzLmNvbTB2MBAG +ByqGSM49AgEGBSuBBAAiA2IABAMDRP48Wyz7MDSToorAUlqaAuyG1WB064Z5zJyf +o3h//kOKVeztdQUykt8ofuD8wk62dMT4tBcnkg+w3/7Ongo2igleEfG05ll7AMB5 +ncOZsWn4vTYqw1mlI1/begCYdKNTMFEwHQYDVR0OBBYEFMLkt17TGgsW+kPft8Ni +yZJFZ2esMB8GA1UdIwQYMBaAFMLkt17TGgsW+kPft8NiyZJFZ2esMA8GA1UdEwEB +/wQFMAMBAf8wCgYIKoZIzj0EAwMDZwAwZAIwJ+h9jQXvgpDc6sX53MSSe8tI7Aen +MVLx2wBAhdYsVvNtjVqVOBtCGo1gzR2wihrWAjABbD66jIHchtaEr8aBD0bSvKz/ +aRst4l0zNFMLLfOf6tFbWpKDwINgPBV9z9gqAyE= +-----END CERTIFICATE----- +` + +const BlockHuntersSubscriberCA = `-----BEGIN CERTIFICATE----- +MIICHTCCAaKgAwIBAgIUWz0AydVEseLf+oVwtnduqyomJJwwCgYIKoZIzj0EAwMw +RTELMAkGA1UEBhMCUk8xEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGElu +dGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMzA5MjgxNDMwNTNaFw0yNTA5Mjcx +NDMwNTNaMEUxCzAJBgNVBAYTAlJPMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYD +VQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAATJS/2WwSqTFKWap02Wch4HAJvBxHNf6LvAowuLdwgyTB1LdWf48q6hpynj +LxCFJ1DmaHVHFDm1pK4l2qkkUGc7u2VUd8tJry0gF1L5BYK0X9P+KfRjjEteX2oL +5MnofQKjUzBRMB0GA1UdDgQWBBRlRlgWuQhgOUwVPsRnNfNIpBSg9zAfBgNVHSME +GDAWgBRlRlgWuQhgOUwVPsRnNfNIpBSg9zAPBgNVHRMBAf8EBTADAQH/MAoGCCqG +SM49BAMDA2kAMGYCMQCOY65+yHeBu4U06IvUSBsVZnmI9uMl6hLzimBaScbCCk+q +g/Le+wXH+HmRtFjTsQACMQCwD7aYZ6EFwDiPsyARB8FnO5tTn5+C8b44FXnDU8Fv +nPXK16h1kHHF7cNSPQKkXFg= +-----END CERTIFICATE----- +` diff --git a/app/upgrades/v7/upgrades.go b/app/upgrades/v7/upgrades.go index d6cb898b..c3340503 100644 --- a/app/upgrades/v7/upgrades.go +++ b/app/upgrades/v7/upgrades.go @@ -22,7 +22,7 @@ func CreateUpgradeHandler( return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info("v7 upgrade: entering handler") - // We must manually run InitGenesis for incentives, pubsub, and auctions so we can adjust their values + // We must manually run InitGenesis for pubsub and auctions so we can adjust their values // during the upgrade process. RunMigrations will migrate to the new cork version. Setting the consensus // version to 1 prevents RunMigrations from running InitGenesis itself. fromVM[auctiontypes.ModuleName] = mm.Modules[auctiontypes.ModuleName].ConsensusVersion() @@ -49,13 +49,18 @@ func auctionInitGenesis(ctx sdk.Context, auctionKeeper auctionkeeper.Keeper) { genesisState := auctiontypes.DefaultGenesisState() usomm52WeekLow := sdk.MustNewDecFromStr("0.079151") + eth52WeekHigh := sdk.MustNewDecFromStr("2359.89") + btc52WeekHigh := sdk.MustNewDecFromStr("44202.18") oneDollar := sdk.MustNewDecFromStr("1.0") + // TODO(bolten): update LastUpdatedBlock to the upgrade height when finalized + var lastUpdatedBlock uint64 = 1 + usommPrice := auctiontypes.TokenPrice{ Denom: "usomm", UsdPrice: usomm52WeekLow, Exponent: 6, - LastUpdatedBlock: 1, + LastUpdatedBlock: lastUpdatedBlock, } // setting stables to 1 dollar @@ -63,24 +68,54 @@ func auctionInitGenesis(ctx sdk.Context, auctionKeeper auctionkeeper.Keeper) { Denom: "gravity0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", UsdPrice: oneDollar, Exponent: 6, - LastUpdatedBlock: 1, + LastUpdatedBlock: lastUpdatedBlock, } usdtPrice := auctiontypes.TokenPrice{ Denom: "gravity0xdAC17F958D2ee523a2206206994597C13D831ec7", UsdPrice: oneDollar, Exponent: 6, - LastUpdatedBlock: 1, + LastUpdatedBlock: lastUpdatedBlock, } daiPrice := auctiontypes.TokenPrice{ Denom: "gravity0x6B175474E89094C44Da98b954EedeAC495271d0F", UsdPrice: oneDollar, Exponent: 18, - LastUpdatedBlock: 1, + LastUpdatedBlock: lastUpdatedBlock, } - genesisState.TokenPrices = []*auctiontypes.TokenPrice{&usommPrice, &usdcPrice, &usdtPrice, &daiPrice} + fraxPrice := auctiontypes.TokenPrice{ + Denom: "gravity0x853d955aCEf822Db058eb8505911ED77F175b99e", + UsdPrice: oneDollar, + Exponent: 18, + LastUpdatedBlock: lastUpdatedBlock, + } + + // setting non-stables + wethPrice := auctiontypes.TokenPrice{ + Denom: "gravity0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + UsdPrice: eth52WeekHigh, + Exponent: 18, + LastUpdatedBlock: lastUpdatedBlock, + } + + wbtcPrice := auctiontypes.TokenPrice{ + Denom: "gravity0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", + UsdPrice: btc52WeekHigh, + Exponent: 8, + LastUpdatedBlock: lastUpdatedBlock, + } + + genesisState.TokenPrices = []*auctiontypes.TokenPrice{ + &usommPrice, + &usdcPrice, + &usdtPrice, + &daiPrice, + &fraxPrice, + &wethPrice, + &wbtcPrice, + } auctionkeeper.InitGenesis(ctx, auctionKeeper, genesisState) } @@ -99,20 +134,34 @@ func pubsubInitGenesis(ctx sdk.Context, pubsubKeeper pubsubkeeper.Keeper) { } publishers := []*pubsubtypes.Publisher{&publisher} - // TODO(bolten): update the cellars list with the current total cellars cellars := []string{ "0x7bAD5DF5E11151Dc5Ee1a648800057C5c934c0d5", // Aave V2 + "0x03df2A53Cbed19B824347D6a45d09016C2D1676a", // DeFi Stars + "0x6c51041A91C91C86f3F08a72cB4D3F67f1208897", // ETH Trend Growth "0x6b7f87279982d919bbf85182ddeab179b366d8f2", // ETH-BTC Trend "0x6e2dac3b9e9adc0cbbae2d0b9fd81952a8d33872", // ETH-BTC Momentum + "0xDBe19d1c3F21b1bB250ca7BDaE0687A97B5f77e6", // Fraximal + "0xC7b69E15D86C5c1581dacce3caCaF5b68cd6596F", // Real Yield 1INCH + "0x0274a704a6D9129F90A62dDC6f6024b33EcDad36", // Real Yield BTC + "0x18ea937aba6053bC232d9Ae2C42abE7a8a2Be440", // Real Yield ENS + "0xb5b29320d2Dde5BA5BAFA1EbcD270052070483ec", // Real Yield ETH + "0x4068BDD217a45F8F668EF19F1E3A1f043e4c4934", // Real Yield LINK + "0xcBf2250F33c4161e18D4A2FA47464520Af5216b5", // Real Yield SNX + "0x6A6AF5393DC23D7e3dB28D28Ef422DB7c40932B6", // Real Yield UNI + "0x97e6E0a40a3D02F12d1cEC30ebfbAE04e37C119E", // Real Yield USD "0x3F07A84eCdf494310D397d24c1C78B041D2fa622", // Steady ETH "0x4986fD36b6b16f49b43282Ee2e24C5cF90ed166d", // Steady BTC "0x05641a27C82799AaF22b436F20A3110410f29652", // Steady MATIC "0x6f069f711281618467dae7873541ecc082761b33", // Steady UNI - "0x97e6E0a40a3D02F12d1cEC30ebfbAE04e37C119E", // Real Yield USD + "0x0C190DEd9Be5f512Bd72827bdaD4003e9Cc7975C", // Turbo GHO + "0x5195222f69c5821f8095ec565E71e18aB6A2298f", // Turbo SOMM + "0xc7372Ab5dd315606dB799246E8aA112405abAeFf", // Turbo stETH (stETH deposit) + "0xfd6db5011b171B05E1Ea3b92f9EAcaEEb055e971", // Turbo stETH (WETH deposit) + "0xd33dAd974b938744dAC81fE00ac67cb5AA13958E", // Turbo swETH } // Set 7seas publisher intents for existing cellars - publisherIntents := make([]*pubsubtypes.PublisherIntent, 8) + publisherIntents := make([]*pubsubtypes.PublisherIntent, 23) for _, cellar := range cellars { publisherIntents = append(publisherIntents, &pubsubtypes.PublisherIntent{ SubscriptionId: cellar, @@ -123,7 +172,7 @@ func pubsubInitGenesis(ctx sdk.Context, pubsubKeeper pubsubkeeper.Keeper) { } // Set default subscriptions for 7seas as the publisher for existing cellars - defaultSubscriptions := make([]*pubsubtypes.DefaultSubscription, 8) + defaultSubscriptions := make([]*pubsubtypes.DefaultSubscription, 23) for _, cellar := range cellars { defaultSubscriptions = append(defaultSubscriptions, &pubsubtypes.DefaultSubscription{ SubscriptionId: cellar, @@ -133,7 +182,7 @@ func pubsubInitGenesis(ctx sdk.Context, pubsubKeeper pubsubkeeper.Keeper) { // Create subscribers and intents for existing validators subscribers := createSubscribers() - subscriberIntents := make([]*pubsubtypes.SubscriberIntent, 208) + subscriberIntents := make([]*pubsubtypes.SubscriberIntent, 805) for _, subscriber := range subscribers { for _, cellar := range cellars { subscriberIntents = append(subscriberIntents, &pubsubtypes.SubscriberIntent{ @@ -153,14 +202,15 @@ func pubsubInitGenesis(ctx sdk.Context, pubsubKeeper pubsubkeeper.Keeper) { pubsubkeeper.InitGenesis(ctx, pubsubKeeper, genesisState) } -// TODO(bolten): update the validators in the registry // Addresses are from the validator's delegate orchestrator key and certs/URLs captured from the // steward-registry repo. // query to get orchestrator key: sommelier query gravity delegate-keys-by-validator sommvaloper // See source data at: https://github.com/PeggyJV/steward-registry -// data captured at commit cdee05a8bf97f264353e10ab65752710bfb85dc9 +// data captured at commit ecdb7f386e7e573edb5d8f6ad22a1a67cfa21863 +// leaving out made_in_block because I can't find their validator on-chain +// blockhunters hadn't been merged, but verified and added here func createSubscribers() []*pubsubtypes.Subscriber { - subscribers := make([]*pubsubtypes.Subscriber, 26) + subscribers := make([]*pubsubtypes.Subscriber, 35) subscribers = append(subscribers, &pubsubtypes.Subscriber{ Address: "somm1s2q8avjykkztudpl8k60f0ns4v5mvnjp5t366c", @@ -279,7 +329,7 @@ func createSubscribers() []*pubsubtypes.Subscriber { subscribers = append(subscribers, &pubsubtypes.Subscriber{ Address: "somm1xvfdclzyw03ye5mfskw6lvvmervexx8hx58823", CaCert: CosmostationSubscriberCA, - PushUrl: "steward.sommelier.cosmostation.io:5734", + PushUrl: "steward.sommelier.cosmostation.io:15413", }) subscribers = append(subscribers, &pubsubtypes.Subscriber{ @@ -318,5 +368,59 @@ func createSubscribers() []*pubsubtypes.Subscriber { PushUrl: "steward.sommelier.7seas.capital:5734", }) + subscribers = append(subscribers, &pubsubtypes.Subscriber{ + Address: "somm1xlg9tu8nwyratwhppkmen62putwf3dltkeqvl9", + CaCert: GoldenRatioSubscriberCA, + PushUrl: "sommelier.goldenratiostaking.net:5734", + }) + + subscribers = append(subscribers, &pubsubtypes.Subscriber{ + Address: "somm1kdq2pwdnn5225y0fjk7nzd93errzxmj2ncp60z", + CaCert: CryptoCrewSubscriberCA, + PushUrl: "steward-somm.ccvalidators.com:5734", + }) + + subscribers = append(subscribers, &pubsubtypes.Subscriber{ + Address: "somm1cfdkpueekdxgax0gu5fwq30nfwd2h0mg3kwtqq", + CaCert: DoraFactorySubscriberCA, + PushUrl: "sommelier.dorafactory.org:5734", + }) + + subscribers = append(subscribers, &pubsubtypes.Subscriber{ + Address: "somm1p0d4cg70pk9x49xzrg9dllvj6wxkvtqxfc8490", + CaCert: FrenchChocolatineSubscriberCA, + PushUrl: "sommelier.frenchchocolatine.com:5734", + }) + + subscribers = append(subscribers, &pubsubtypes.Subscriber{ + Address: "somm1ye5qdw92yjj0a2fvpgwgmxh9yymrcmaxn8ed3u", + CaCert: FreshStakingSubscriberCA, + PushUrl: "somm-steward.mitera.net:5734", + }) + + subscribers = append(subscribers, &pubsubtypes.Subscriber{ + Address: "somm1fmw3y7heca7qhfkt5uu3u65mk8gj5tx24k9x68", + CaCert: KleomedesSubscriberCA, + PushUrl: "steward.kleomedes.network:5734", + }) + + subscribers = append(subscribers, &pubsubtypes.Subscriber{ + Address: "somm1q9k53u4fu2v0ksgs84ek4c0xrh269haykxuqrk", + CaCert: MeriaSubscriberCA, + PushUrl: "sommelier.meria.com:5734", + }) + + subscribers = append(subscribers, &pubsubtypes.Subscriber{ + Address: "somm1s70pr2uyct7jtjc69kpkwm3ajysmfgzpwl32vj", + CaCert: RorcualSubscriberCA, + PushUrl: "steward.rorcualnodes.com:5734", + }) + + subscribers = append(subscribers, &pubsubtypes.Subscriber{ + Address: "somm1u7n35gtu85qrtu92ws5fsgs6ea4ay32nach7q7", + CaCert: BlockHuntersSubscriberCA, + PushUrl: "somm.blockhunters.sbs:5734", + }) + return subscribers } diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 0419e978..8ea88bd2 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -4,45 +4,84 @@ ## Table of Contents -- [allocation/v1/allocation.proto](#allocation/v1/allocation.proto) - - [AddManagedCellarsProposal](#allocation.v1.AddManagedCellarsProposal) - - [Allocation](#allocation.v1.Allocation) - - [AllocationPrecommit](#allocation.v1.AllocationPrecommit) - - [Cellar](#allocation.v1.Cellar) - - [CellarUpdate](#allocation.v1.CellarUpdate) - - [RebalanceVote](#allocation.v1.RebalanceVote) - - [RemoveManagedCellarsProposal](#allocation.v1.RemoveManagedCellarsProposal) - - [TickRange](#allocation.v1.TickRange) +- [axelarcork/v1/axelarcork.proto](#axelarcork/v1/axelarcork.proto) + - [AxelarContractCallNonce](#axelarcork.v1.AxelarContractCallNonce) + - [AxelarCork](#axelarcork.v1.AxelarCork) + - [AxelarCorkResult](#axelarcork.v1.AxelarCorkResult) + - [AxelarCorkResults](#axelarcork.v1.AxelarCorkResults) + - [AxelarUpgradeData](#axelarcork.v1.AxelarUpgradeData) + - [CellarIDSet](#axelarcork.v1.CellarIDSet) + - [ChainConfiguration](#axelarcork.v1.ChainConfiguration) + - [ChainConfigurations](#axelarcork.v1.ChainConfigurations) + - [ScheduledAxelarCork](#axelarcork.v1.ScheduledAxelarCork) + - [ScheduledAxelarCorks](#axelarcork.v1.ScheduledAxelarCorks) -- [allocation/v1/tx.proto](#allocation/v1/tx.proto) - - [MsgAllocationCommit](#allocation.v1.MsgAllocationCommit) - - [MsgAllocationCommitResponse](#allocation.v1.MsgAllocationCommitResponse) - - [MsgAllocationPrecommit](#allocation.v1.MsgAllocationPrecommit) - - [MsgAllocationPrecommitResponse](#allocation.v1.MsgAllocationPrecommitResponse) +- [axelarcork/v1/event.proto](#axelarcork/v1/event.proto) + - [ScheduleCorkEvent](#axelarcork.v1.ScheduleCorkEvent) - - [Msg](#allocation.v1.Msg) +- [axelarcork/v1/genesis.proto](#axelarcork/v1/genesis.proto) + - [GenesisState](#axelarcork.v1.GenesisState) + - [Params](#axelarcork.v1.Params) -- [allocation/v1/genesis.proto](#allocation/v1/genesis.proto) - - [GenesisState](#allocation.v1.GenesisState) - - [Params](#allocation.v1.Params) +- [axelarcork/v1/proposal.proto](#axelarcork/v1/proposal.proto) + - [AddAxelarManagedCellarIDsProposal](#axelarcork.v1.AddAxelarManagedCellarIDsProposal) + - [AddAxelarManagedCellarIDsProposalWithDeposit](#axelarcork.v1.AddAxelarManagedCellarIDsProposalWithDeposit) + - [AddChainConfigurationProposal](#axelarcork.v1.AddChainConfigurationProposal) + - [AddChainConfigurationProposalWithDeposit](#axelarcork.v1.AddChainConfigurationProposalWithDeposit) + - [AxelarCommunityPoolSpendProposal](#axelarcork.v1.AxelarCommunityPoolSpendProposal) + - [AxelarCommunityPoolSpendProposalForCLI](#axelarcork.v1.AxelarCommunityPoolSpendProposalForCLI) + - [AxelarScheduledCorkProposal](#axelarcork.v1.AxelarScheduledCorkProposal) + - [AxelarScheduledCorkProposalWithDeposit](#axelarcork.v1.AxelarScheduledCorkProposalWithDeposit) + - [CancelAxelarProxyContractUpgradeProposal](#axelarcork.v1.CancelAxelarProxyContractUpgradeProposal) + - [CancelAxelarProxyContractUpgradeProposalWithDeposit](#axelarcork.v1.CancelAxelarProxyContractUpgradeProposalWithDeposit) + - [RemoveAxelarManagedCellarIDsProposal](#axelarcork.v1.RemoveAxelarManagedCellarIDsProposal) + - [RemoveAxelarManagedCellarIDsProposalWithDeposit](#axelarcork.v1.RemoveAxelarManagedCellarIDsProposalWithDeposit) + - [RemoveChainConfigurationProposal](#axelarcork.v1.RemoveChainConfigurationProposal) + - [RemoveChainConfigurationProposalWithDeposit](#axelarcork.v1.RemoveChainConfigurationProposalWithDeposit) + - [UpgradeAxelarProxyContractProposal](#axelarcork.v1.UpgradeAxelarProxyContractProposal) + - [UpgradeAxelarProxyContractProposalWithDeposit](#axelarcork.v1.UpgradeAxelarProxyContractProposalWithDeposit) -- [allocation/v1/query.proto](#allocation/v1/query.proto) - - [QueryAllocationCommitRequest](#allocation.v1.QueryAllocationCommitRequest) - - [QueryAllocationCommitResponse](#allocation.v1.QueryAllocationCommitResponse) - - [QueryAllocationCommitsRequest](#allocation.v1.QueryAllocationCommitsRequest) - - [QueryAllocationCommitsResponse](#allocation.v1.QueryAllocationCommitsResponse) - - [QueryAllocationPrecommitRequest](#allocation.v1.QueryAllocationPrecommitRequest) - - [QueryAllocationPrecommitResponse](#allocation.v1.QueryAllocationPrecommitResponse) - - [QueryAllocationPrecommitsRequest](#allocation.v1.QueryAllocationPrecommitsRequest) - - [QueryAllocationPrecommitsResponse](#allocation.v1.QueryAllocationPrecommitsResponse) - - [QueryCellarsRequest](#allocation.v1.QueryCellarsRequest) - - [QueryCellarsResponse](#allocation.v1.QueryCellarsResponse) - - [QueryCommitPeriodRequest](#allocation.v1.QueryCommitPeriodRequest) - - [QueryCommitPeriodResponse](#allocation.v1.QueryCommitPeriodResponse) - - [QueryParamsRequest](#allocation.v1.QueryParamsRequest) - - [QueryParamsResponse](#allocation.v1.QueryParamsResponse) +- [axelarcork/v1/query.proto](#axelarcork/v1/query.proto) + - [QueryAxelarContractCallNoncesRequest](#axelarcork.v1.QueryAxelarContractCallNoncesRequest) + - [QueryAxelarContractCallNoncesResponse](#axelarcork.v1.QueryAxelarContractCallNoncesResponse) + - [QueryAxelarProxyUpgradeDataRequest](#axelarcork.v1.QueryAxelarProxyUpgradeDataRequest) + - [QueryAxelarProxyUpgradeDataResponse](#axelarcork.v1.QueryAxelarProxyUpgradeDataResponse) + - [QueryCellarIDsByChainIDRequest](#axelarcork.v1.QueryCellarIDsByChainIDRequest) + - [QueryCellarIDsByChainIDResponse](#axelarcork.v1.QueryCellarIDsByChainIDResponse) + - [QueryCellarIDsRequest](#axelarcork.v1.QueryCellarIDsRequest) + - [QueryCellarIDsResponse](#axelarcork.v1.QueryCellarIDsResponse) + - [QueryChainConfigurationsRequest](#axelarcork.v1.QueryChainConfigurationsRequest) + - [QueryChainConfigurationsResponse](#axelarcork.v1.QueryChainConfigurationsResponse) + - [QueryCorkResultRequest](#axelarcork.v1.QueryCorkResultRequest) + - [QueryCorkResultResponse](#axelarcork.v1.QueryCorkResultResponse) + - [QueryCorkResultsRequest](#axelarcork.v1.QueryCorkResultsRequest) + - [QueryCorkResultsResponse](#axelarcork.v1.QueryCorkResultsResponse) + - [QueryParamsRequest](#axelarcork.v1.QueryParamsRequest) + - [QueryParamsResponse](#axelarcork.v1.QueryParamsResponse) + - [QueryScheduledBlockHeightsRequest](#axelarcork.v1.QueryScheduledBlockHeightsRequest) + - [QueryScheduledBlockHeightsResponse](#axelarcork.v1.QueryScheduledBlockHeightsResponse) + - [QueryScheduledCorksByBlockHeightRequest](#axelarcork.v1.QueryScheduledCorksByBlockHeightRequest) + - [QueryScheduledCorksByBlockHeightResponse](#axelarcork.v1.QueryScheduledCorksByBlockHeightResponse) + - [QueryScheduledCorksByIDRequest](#axelarcork.v1.QueryScheduledCorksByIDRequest) + - [QueryScheduledCorksByIDResponse](#axelarcork.v1.QueryScheduledCorksByIDResponse) + - [QueryScheduledCorksRequest](#axelarcork.v1.QueryScheduledCorksRequest) + - [QueryScheduledCorksResponse](#axelarcork.v1.QueryScheduledCorksResponse) - - [Query](#allocation.v1.Query) + - [Query](#axelarcork.v1.Query) + +- [axelarcork/v1/tx.proto](#axelarcork/v1/tx.proto) + - [MsgBumpAxelarCorkGasRequest](#axelarcork.v1.MsgBumpAxelarCorkGasRequest) + - [MsgBumpAxelarCorkGasResponse](#axelarcork.v1.MsgBumpAxelarCorkGasResponse) + - [MsgCancelAxelarCorkRequest](#axelarcork.v1.MsgCancelAxelarCorkRequest) + - [MsgCancelAxelarCorkResponse](#axelarcork.v1.MsgCancelAxelarCorkResponse) + - [MsgRelayAxelarCorkRequest](#axelarcork.v1.MsgRelayAxelarCorkRequest) + - [MsgRelayAxelarCorkResponse](#axelarcork.v1.MsgRelayAxelarCorkResponse) + - [MsgRelayAxelarProxyUpgradeRequest](#axelarcork.v1.MsgRelayAxelarProxyUpgradeRequest) + - [MsgRelayAxelarProxyUpgradeResponse](#axelarcork.v1.MsgRelayAxelarProxyUpgradeResponse) + - [MsgScheduleAxelarCorkRequest](#axelarcork.v1.MsgScheduleAxelarCorkRequest) + - [MsgScheduleAxelarCorkResponse](#axelarcork.v1.MsgScheduleAxelarCorkResponse) + + - [Msg](#axelarcork.v1.Msg) - [cellarfees/v1/params.proto](#cellarfees/v1/params.proto) - [Params](#cellarfees.v1.Params) @@ -100,477 +139,1140 @@ - [Query](#cork.v1.Query) +- [incentives/v1/genesis.proto](#incentives/v1/genesis.proto) + - [GenesisState](#incentives.v1.GenesisState) + - [Params](#incentives.v1.Params) + +- [incentives/v1/query.proto](#incentives/v1/query.proto) + - [QueryAPYRequest](#incentives.v1.QueryAPYRequest) + - [QueryAPYResponse](#incentives.v1.QueryAPYResponse) + - [QueryParamsRequest](#incentives.v1.QueryParamsRequest) + - [QueryParamsResponse](#incentives.v1.QueryParamsResponse) + + - [Query](#incentives.v1.Query) + - [Scalar Value Types](#scalar-value-types) - + +

Top

+ +## axelarcork/v1/axelarcork.proto + + + + + +### AxelarContractCallNonce +Used to enforce strictly newer call ordering per contract + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `chain_id` | [uint64](#uint64) | | | +| `contract_address` | [string](#string) | | | +| `nonce` | [uint64](#uint64) | | | + + + + + + + + +### AxelarCork + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `encoded_contract_call` | [bytes](#bytes) | | call body containing the ABI encoded bytes to send to the contract | +| `chain_id` | [uint64](#uint64) | | the chain ID of the evm target chain | +| `target_contract_address` | [string](#string) | | address of the contract to send the call | +| `deadline` | [uint64](#uint64) | | unix timestamp before which the contract call must be executed. enforced by the proxy contract. | + + + + + + + + +### AxelarCorkResult + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `cork` | [AxelarCork](#axelarcork.v1.AxelarCork) | | | +| `block_height` | [uint64](#uint64) | | | +| `approved` | [bool](#bool) | | | +| `approval_percentage` | [string](#string) | | | + + + + + + + + +### AxelarCorkResults + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `cork_results` | [AxelarCorkResult](#axelarcork.v1.AxelarCorkResult) | repeated | | + + + + + + + + +### AxelarUpgradeData +Represents a proxy contract upgrade approved by governance with a delay in +execution in case of an error. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `chain_id` | [uint64](#uint64) | | | +| `payload` | [bytes](#bytes) | | | +| `executable_height_threshold` | [int64](#int64) | | | + + + + + + + + +### CellarIDSet + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `chain` | [ChainConfiguration](#axelarcork.v1.ChainConfiguration) | | | +| `ids` | [string](#string) | repeated | | + + + + + + + + +### ChainConfiguration + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | +| `id` | [uint64](#uint64) | | | +| `proxy_address` | [string](#string) | | | + + + + + + + + +### ChainConfigurations + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `configurations` | [ChainConfiguration](#axelarcork.v1.ChainConfiguration) | repeated | | + + + + + + + + +### ScheduledAxelarCork + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `cork` | [AxelarCork](#axelarcork.v1.AxelarCork) | | | +| `block_height` | [uint64](#uint64) | | | +| `validator` | [string](#string) | | | +| `id` | [string](#string) | | | + + + + + + + + +### ScheduledAxelarCorks + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `scheduled_corks` | [ScheduledAxelarCork](#axelarcork.v1.ScheduledAxelarCork) | repeated | | + + + + + + + + + + + + + + + + +

Top

+ +## axelarcork/v1/event.proto + + + + + +### ScheduleCorkEvent + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signer` | [string](#string) | | | +| `validator` | [string](#string) | | | +| `cork` | [string](#string) | | | +| `block_height` | [uint64](#uint64) | | | +| `chain_id` | [uint64](#uint64) | | | + + + + + + + + + + + + + + + + +

Top

+ +## axelarcork/v1/genesis.proto + + + + + +### GenesisState +GenesisState - all cork state that must be provided at genesis + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#axelarcork.v1.Params) | | | +| `chain_configurations` | [ChainConfigurations](#axelarcork.v1.ChainConfigurations) | | | +| `cellar_ids` | [CellarIDSet](#axelarcork.v1.CellarIDSet) | repeated | | +| `scheduled_corks` | [ScheduledAxelarCorks](#axelarcork.v1.ScheduledAxelarCorks) | | | +| `cork_results` | [AxelarCorkResults](#axelarcork.v1.AxelarCorkResults) | | | +| `axelar_contract_call_nonces` | [AxelarContractCallNonce](#axelarcork.v1.AxelarContractCallNonce) | repeated | | +| `axelar_upgrade_data` | [AxelarUpgradeData](#axelarcork.v1.AxelarUpgradeData) | repeated | | + + + + + + + + +### Params + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `enabled` | [bool](#bool) | | | +| `ibc_channel` | [string](#string) | | | +| `ibc_port` | [string](#string) | | | +| `gmp_account` | [string](#string) | | | +| `executor_account` | [string](#string) | | | +| `timeout_duration` | [uint64](#uint64) | | | +| `cork_timeout_blocks` | [uint64](#uint64) | | | + + + + + + + + + + + + + + + + +

Top

+ +## axelarcork/v1/proposal.proto + + + + + +### AddAxelarManagedCellarIDsProposal + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `cellar_ids` | [CellarIDSet](#axelarcork.v1.CellarIDSet) | | | + + + + + + + + +### AddAxelarManagedCellarIDsProposalWithDeposit +AddManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `cellar_ids` | [CellarIDSet](#axelarcork.v1.CellarIDSet) | | | +| `deposit` | [string](#string) | | | + + + + + + + + +### AddChainConfigurationProposal + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_configuration` | [ChainConfiguration](#axelarcork.v1.ChainConfiguration) | | | + + + + + + + + +### AddChainConfigurationProposalWithDeposit + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_configuration` | [ChainConfiguration](#axelarcork.v1.ChainConfiguration) | | | +| `deposit` | [string](#string) | | | + + + + + + + + +### AxelarCommunityPoolSpendProposal + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `recipient` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | + + + + + + + + +### AxelarCommunityPoolSpendProposalForCLI +This format of the community spend Ethereum proposal is specifically for +the CLI to allow simple text serialization. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `recipient` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `chain_name` | [string](#string) | | | +| `amount` | [string](#string) | | | +| `deposit` | [string](#string) | | | + + + + + + + + +### AxelarScheduledCorkProposal + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `block_height` | [uint64](#uint64) | | | +| `chain_id` | [uint64](#uint64) | | | +| `target_contract_address` | [string](#string) | | | +| `contract_call_proto_json` | [string](#string) | | The JSON representation of a ScheduleRequest defined in the Steward protos + +Example: The following is the JSON form of a ScheduleRequest containing a steward.v2.cellar_v1.TrustPosition message, which maps to the `trustPosition(address)` function of the the V1 Cellar contract. + +{ "cellar_id": "0x1234567890000000000000000000000000000000", "cellar_v1": { "trust_position": { "erc20_address": "0x1234567890000000000000000000000000000000" } }, "block_height": 1000000 } + +You can use the Steward CLI to generate the required JSON rather than constructing it by hand https://github.com/peggyjv/steward | +| `deadline` | [uint64](#uint64) | | unix timestamp before which the contract call must be executed. enforced by the Axelar proxy contract | + + + + + + + + +### AxelarScheduledCorkProposalWithDeposit +ScheduledCorkProposalWithDeposit is a specific definition for CLI commands + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `block_height` | [uint64](#uint64) | | | +| `chain_id` | [uint64](#uint64) | | | +| `target_contract_address` | [string](#string) | | | +| `contract_call_proto_json` | [string](#string) | | | +| `deadline` | [uint64](#uint64) | | | +| `deposit` | [string](#string) | | | + + + + + + + + +### CancelAxelarProxyContractUpgradeProposal + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | + + + + + + + + +### CancelAxelarProxyContractUpgradeProposalWithDeposit + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `deposit` | [string](#string) | | | + + + + + + + + +### RemoveAxelarManagedCellarIDsProposal + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `cellar_ids` | [CellarIDSet](#axelarcork.v1.CellarIDSet) | | | + + + + + + + + +### RemoveAxelarManagedCellarIDsProposalWithDeposit +RemoveManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `cellar_ids` | [CellarIDSet](#axelarcork.v1.CellarIDSet) | | | +| `deposit` | [string](#string) | | | + + + + + + + + +### RemoveChainConfigurationProposal + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | + + + + + + + + +### RemoveChainConfigurationProposalWithDeposit + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `deposit` | [string](#string) | | | + + + + + + + + +### UpgradeAxelarProxyContractProposal + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `new_proxy_address` | [string](#string) | | | + + + + + + + + +### UpgradeAxelarProxyContractProposalWithDeposit + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `new_proxy_address` | [string](#string) | | | +| `deposit` | [string](#string) | | | + + + + + + + + + + + + + + + +

Top

-## allocation/v1/allocation.proto +## axelarcork/v1/query.proto + + + + + +### QueryAxelarContractCallNoncesRequest + + + + - + -### AddManagedCellarsProposal +### QueryAxelarContractCallNoncesResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `cellar_ids` | [string](#string) | repeated | | +| `contract_call_nonces` | [AxelarContractCallNonce](#axelarcork.v1.AxelarContractCallNonce) | repeated | | - + -### Allocation -Allocation is the commit for all allocations for a cellar by a validator +### QueryAxelarProxyUpgradeDataRequest -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `vote` | [RebalanceVote](#allocation.v1.RebalanceVote) | | | -| `salt` | [string](#string) | | | + - +### QueryAxelarProxyUpgradeDataResponse -### AllocationPrecommit -AllocationPrecommit defines an array of hashed data to be used for the precommit phase -of allocation | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `hash` | [bytes](#bytes) | | bytes hash = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"]; | -| `cellar_id` | [string](#string) | | | +| `proxy_upgrade_data` | [AxelarUpgradeData](#axelarcork.v1.AxelarUpgradeData) | repeated | | - + -### Cellar -Cellar is a collection of pools for a token pair +### QueryCellarIDsByChainIDRequest +QueryCellarIDsByChainIDRequest is the request type for Query/QueryCellarIDsByChainID gRPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `id` | [string](#string) | | | -| `tick_ranges` | [TickRange](#allocation.v1.TickRange) | repeated | | +| `chain_id` | [uint64](#uint64) | | | - - -### CellarUpdate + +### QueryCellarIDsByChainIDResponse +QueryCellarIDsByChainIDResponse is the response type for Query/QueryCellarIDsByChainID gRPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `invalidation_nonce` | [uint64](#uint64) | | | -| `vote` | [RebalanceVote](#allocation.v1.RebalanceVote) | | | +| `cellar_ids` | [string](#string) | repeated | | + + + + + +### QueryCellarIDsRequest +QueryCellarIDs is the request type for Query/QueryCellarIDs gRPC method. + + - -### RebalanceVote + +### QueryCellarIDsResponse +QueryCellarIDsResponse is the response type for Query/QueryCellarIDs gRPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `cellar` | [Cellar](#allocation.v1.Cellar) | | | -| `current_price` | [uint64](#uint64) | | | +| `cellar_ids` | [CellarIDSet](#axelarcork.v1.CellarIDSet) | repeated | | + + + + + + + + +### QueryChainConfigurationsRequest - -### RemoveManagedCellarsProposal + + +### QueryChainConfigurationsResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `cellar_ids` | [string](#string) | repeated | | +| `configurations` | [ChainConfiguration](#axelarcork.v1.ChainConfiguration) | repeated | | - + -### TickRange +### QueryCorkResultRequest | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `upper` | [int32](#int32) | | | -| `lower` | [int32](#int32) | | | -| `weight` | [uint32](#uint32) | | | +| `id` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | - - + - +### QueryCorkResultResponse - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `corkResult` | [AxelarCorkResult](#axelarcork.v1.AxelarCorkResult) | | | - -

Top

-## allocation/v1/tx.proto - -### MsgAllocationCommit -MsgAllocationCommit - sdk.Msg for submitting arbitrary oracle data that has been prevoted on + + +### QueryCorkResultsRequest + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `commit` | [Allocation](#allocation.v1.Allocation) | repeated | vote containing the oracle data feed | -| `signer` | [string](#string) | | signer (i.e feeder) account address | +| `chain_id` | [uint64](#uint64) | | | - - -### MsgAllocationCommitResponse -MsgAllocationCommitResponse is the response type for the Msg/AllocationCommit gRPC method. + +### QueryCorkResultsResponse +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `corkResults` | [AxelarCorkResult](#axelarcork.v1.AxelarCorkResult) | repeated | | - -### MsgAllocationPrecommit -MsgAllocationPrecommit - sdk.Msg for prevoting on an array of oracle data types. -The purpose of the prevote is to hide vote for data with hashes formatted as hex string: -SHA256("{salt}:{data_cannonical_json}:{voter}") -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `precommit` | [AllocationPrecommit](#allocation.v1.AllocationPrecommit) | repeated | precommit containing the hash of the allocation precommit contents | -| `signer` | [string](#string) | | signer (i.e feeder) account address | + +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params gRPC method. - -### MsgAllocationPrecommitResponse -MsgAllocationPrecommitResponse is the response type for the Msg/AllocationPrecommitResponse gRPC method. + +### QueryParamsResponse +QueryParamsRequest is the response type for the Query/Params gRPC method. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#axelarcork.v1.Params) | | allocation parameters | - - - - -### Msg -MsgService defines the msgs that the allocation module handles. + -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `AllocationPrecommit` | [MsgAllocationPrecommit](#allocation.v1.MsgAllocationPrecommit) | [MsgAllocationPrecommitResponse](#allocation.v1.MsgAllocationPrecommitResponse) | AllocationPrecommit defines a message that commits a hash of allocation data feed before the data is actually submitted. | | -| `AllocationCommit` | [MsgAllocationCommit](#allocation.v1.MsgAllocationCommit) | [MsgAllocationCommitResponse](#allocation.v1.MsgAllocationCommitResponse) | AllocationCommit defines a message to submit the actual allocation data that was committed by the feeder through the pre-commit. | | +### QueryScheduledBlockHeightsRequest +QueryScheduledBlockHeightsRequest - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `chain_id` | [uint64](#uint64) | | | - -

Top

-## allocation/v1/genesis.proto - + -### GenesisState -GenesisState - all allocation state that must be provided at genesis +### QueryScheduledBlockHeightsResponse +QueryScheduledBlockHeightsResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#allocation.v1.Params) | | | -| `cellars` | [Cellar](#allocation.v1.Cellar) | repeated | | +| `block_heights` | [uint64](#uint64) | repeated | | - + -### Params -Params allocation parameters +### QueryScheduledCorksByBlockHeightRequest +QueryScheduledCorksByBlockHeightRequest | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `vote_period` | [int64](#int64) | | VotePeriod defines the number of blocks to wait for votes before attempting to tally | -| `vote_threshold` | [string](#string) | | VoteThreshold defines the percentage of bonded stake required to vote each period | +| `block_height` | [uint64](#uint64) | | | +| `chain_id` | [uint64](#uint64) | | | - - + - +### QueryScheduledCorksByBlockHeightResponse +QueryScheduledCorksByBlockHeightResponse - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `corks` | [ScheduledAxelarCork](#axelarcork.v1.ScheduledAxelarCork) | repeated | | - -

Top

-## allocation/v1/query.proto - + -### QueryAllocationCommitRequest -QueryAllocationCommitRequest is the request type for the Query/QueryallocationDataVote gRPC method. +### QueryScheduledCorksByIDRequest +QueryScheduledCorksByIDRequest | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `validator` | [string](#string) | | validator operator address | -| `cellar` | [string](#string) | | cellar contract address | +| `id` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | - + -### QueryAllocationCommitResponse -QueryAllocationCommitResponse is the response type for the Query/QueryallocationDataVote gRPC method. +### QueryScheduledCorksByIDResponse +QueryScheduledCorksByIDResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `commit` | [Allocation](#allocation.v1.Allocation) | | vote containing the allocation feed submitted within the latest voting period | +| `corks` | [ScheduledAxelarCork](#axelarcork.v1.ScheduledAxelarCork) | repeated | | + + + +### QueryScheduledCorksRequest +QueryScheduledCorksRequest - -### QueryAllocationCommitsRequest -QueryAllocationCommitsRequest is the request type for the Query/QueryAllocationCommits gRPC method. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `chain_id` | [uint64](#uint64) | | | - + -### QueryAllocationCommitsResponse -QueryAllocationCommitsResponse is the response type for the Query/QueryAllocationCommits gRPC method. +### QueryScheduledCorksResponse +QueryScheduledCorksResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `commits` | [Allocation](#allocation.v1.Allocation) | repeated | votes containing the allocation feed submitted within the latest voting period | +| `corks` | [ScheduledAxelarCork](#axelarcork.v1.ScheduledAxelarCork) | repeated | | + + + - + -### QueryAllocationPrecommitRequest -QueryAllocationPrecommitRequest is the request type for the Query/AllocationPrecommit gRPC method. + + + +### Query +Query defines the gRPC query service for the cork module. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `QueryParams` | [QueryParamsRequest](#axelarcork.v1.QueryParamsRequest) | [QueryParamsResponse](#axelarcork.v1.QueryParamsResponse) | QueryParams queries the axelar cork module parameters. | GET|/sommelier/cork/v1/params| +| `QueryCellarIDs` | [QueryCellarIDsRequest](#axelarcork.v1.QueryCellarIDsRequest) | [QueryCellarIDsResponse](#axelarcork.v1.QueryCellarIDsResponse) | QueryCellarIDs queries approved cellar ids of all supported chains | GET|/sommelier/axelarcork/v1/cellar_ids| +| `QueryCellarIDsByChainID` | [QueryCellarIDsByChainIDRequest](#axelarcork.v1.QueryCellarIDsByChainIDRequest) | [QueryCellarIDsByChainIDResponse](#axelarcork.v1.QueryCellarIDsByChainIDResponse) | QueryCellarIDsByChainID returns all cellars and current tick ranges | GET|/sommelier/axelarcork/v1/cellar_ids_by_chain_id| +| `QueryScheduledCorks` | [QueryScheduledCorksRequest](#axelarcork.v1.QueryScheduledCorksRequest) | [QueryScheduledCorksResponse](#axelarcork.v1.QueryScheduledCorksResponse) | QueryScheduledCorks returns all scheduled corks | GET|/sommelier/axelarcork/v1/scheduled_corks| +| `QueryScheduledBlockHeights` | [QueryScheduledBlockHeightsRequest](#axelarcork.v1.QueryScheduledBlockHeightsRequest) | [QueryScheduledBlockHeightsResponse](#axelarcork.v1.QueryScheduledBlockHeightsResponse) | QueryScheduledBlockHeights returns all scheduled block heights | GET|/sommelier/axelarcork/v1/scheduled_block_heights| +| `QueryScheduledCorksByBlockHeight` | [QueryScheduledCorksByBlockHeightRequest](#axelarcork.v1.QueryScheduledCorksByBlockHeightRequest) | [QueryScheduledCorksByBlockHeightResponse](#axelarcork.v1.QueryScheduledCorksByBlockHeightResponse) | QueryScheduledCorks returns all scheduled corks at a block height | GET|/sommelier/axelarcork/v1/scheduled_corks_by_block_height/{block_height}| +| `QueryScheduledCorksByID` | [QueryScheduledCorksByIDRequest](#axelarcork.v1.QueryScheduledCorksByIDRequest) | [QueryScheduledCorksByIDResponse](#axelarcork.v1.QueryScheduledCorksByIDResponse) | QueryScheduledCorks returns all scheduled corks with the specified ID | GET|/sommelier/axelarcork/v1/scheduled_corks_by_id/{id}| +| `QueryCorkResult` | [QueryCorkResultRequest](#axelarcork.v1.QueryCorkResultRequest) | [QueryCorkResultResponse](#axelarcork.v1.QueryCorkResultResponse) | | GET|/sommelier/axelarcork/v1/cork_results/{id}| +| `QueryCorkResults` | [QueryCorkResultsRequest](#axelarcork.v1.QueryCorkResultsRequest) | [QueryCorkResultsResponse](#axelarcork.v1.QueryCorkResultsResponse) | | GET|/sommelier/axelarcork/v1/cork_results| +| `QueryChainConfigurations` | [QueryChainConfigurationsRequest](#axelarcork.v1.QueryChainConfigurationsRequest) | [QueryChainConfigurationsResponse](#axelarcork.v1.QueryChainConfigurationsResponse) | | GET|/sommelier/axelarcork/v1/chain_configurations| +| `QueryAxelarContractCallNonces` | [QueryAxelarContractCallNoncesRequest](#axelarcork.v1.QueryAxelarContractCallNoncesRequest) | [QueryAxelarContractCallNoncesResponse](#axelarcork.v1.QueryAxelarContractCallNoncesResponse) | | GET|/sommelier/axelarcork/v1/contract_call_nonces| +| `QueryAxelarProxyUpgradeData` | [QueryAxelarProxyUpgradeDataRequest](#axelarcork.v1.QueryAxelarProxyUpgradeDataRequest) | [QueryAxelarProxyUpgradeDataResponse](#axelarcork.v1.QueryAxelarProxyUpgradeDataResponse) | | GET|/sommelier/axelarcork/v1/proxy_upgrade_data| + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator` | [string](#string) | | validator operator address | -| `cellar` | [string](#string) | | cellar contract address | + +

Top

+## axelarcork/v1/tx.proto + - +### MsgBumpAxelarCorkGasRequest -### QueryAllocationPrecommitResponse -QueryAllocationPrecommitResponse is the response type for the Query/AllocationPrecommit gRPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `precommit` | [AllocationPrecommit](#allocation.v1.AllocationPrecommit) | | prevote submitted within the latest voting period | +| `signer` | [string](#string) | | | +| `token` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | +| `message_id` | [string](#string) | | | + + - +### MsgBumpAxelarCorkGasResponse -### QueryAllocationPrecommitsRequest -QueryAllocationPrecommitsRequest is the request type for the Query/AllocationPrecommits gRPC method. - + + +### MsgCancelAxelarCorkRequest -### QueryAllocationPrecommitsResponse -QueryAllocationPrecommitResponse is the response type for the Query/AllocationPrecommits gRPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `precommits` | [AllocationPrecommit](#allocation.v1.AllocationPrecommit) | repeated | prevote submitted within the latest voting period | +| `signer` | [string](#string) | | | +| `chain_id` | [uint64](#uint64) | | | +| `target_contract_address` | [string](#string) | | | + + - +### MsgCancelAxelarCorkResponse -### QueryCellarsRequest -QueryCellarsRequest is the request type for Query/QueryCellars gRPC method. - + + +### MsgRelayAxelarCorkRequest -### QueryCellarsResponse -QueryCellarsResponse is the response type for Query/QueryCellars gRPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `cellars` | [Cellar](#allocation.v1.Cellar) | repeated | | +| `signer` | [string](#string) | | | +| `token` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | +| `fee` | [uint64](#uint64) | | | +| `chain_id` | [uint64](#uint64) | | | +| `target_contract_address` | [string](#string) | | | - + -### QueryCommitPeriodRequest -QueryCommitPeriodRequest is the request type for the Query/QueryCommitPeriod gRPC method. +### MsgRelayAxelarCorkResponse - -### QueryCommitPeriodResponse -QueryCommitPeriodResponse is the response type for the Query/QueryCommitPeriod gRPC method. + + +### MsgRelayAxelarProxyUpgradeRequest + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `current_height` | [int64](#int64) | | block height at which the query was processed | -| `vote_period_start` | [int64](#int64) | | latest vote period start block height | -| `vote_period_end` | [int64](#int64) | | block height at which the current voting period ends | +| `signer` | [string](#string) | | | +| `token` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | +| `fee` | [uint64](#uint64) | | | +| `chain_id` | [uint64](#uint64) | | | - + -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params gRPC method. +### MsgRelayAxelarProxyUpgradeResponse - -### QueryParamsResponse -QueryParamsRequest is the response type for the Query/Params gRPC method. + + +### MsgScheduleAxelarCorkRequest +MsgScheduleCorkRequest - sdk.Msg for scheduling a cork request for on or after a specific block height + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `cork` | [AxelarCork](#axelarcork.v1.AxelarCork) | | the scheduled cork | +| `chain_id` | [uint64](#uint64) | | the chain id | +| `block_height` | [uint64](#uint64) | | the block height that must be reached | +| `signer` | [string](#string) | | signer account address | + + + + + + + + +### MsgScheduleAxelarCorkResponse + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#allocation.v1.Params) | | allocation parameters | +| `id` | [string](#string) | | cork ID | @@ -583,20 +1285,17 @@ QueryParamsRequest is the response type for the Query/Params gRPC method. - + -### Query -Query defines the gRPC querier service for the allocation module. +### Msg +MsgService defines the msgs that the cork module handles | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `QueryParams` | [QueryParamsRequest](#allocation.v1.QueryParamsRequest) | [QueryParamsResponse](#allocation.v1.QueryParamsResponse) | QueryParams queries the allocation module parameters. | GET|/sommelier/allocation/v1/params| -| `QueryAllocationPrecommit` | [QueryAllocationPrecommitRequest](#allocation.v1.QueryAllocationPrecommitRequest) | [QueryAllocationPrecommitResponse](#allocation.v1.QueryAllocationPrecommitResponse) | QueryAllocationPrecommit queries the validator prevote in the current voting period | GET|/sommelier/allocation/v1/precommits/{validator}/{cellar}| -| `QueryAllocationPrecommits` | [QueryAllocationPrecommitsRequest](#allocation.v1.QueryAllocationPrecommitsRequest) | [QueryAllocationPrecommitsResponse](#allocation.v1.QueryAllocationPrecommitsResponse) | QueryAllocationPrecommits queries all allocation precommits in the voting period | GET|/sommelier/allocation/v1/precommits| -| `QueryAllocationCommit` | [QueryAllocationCommitRequest](#allocation.v1.QueryAllocationCommitRequest) | [QueryAllocationCommitResponse](#allocation.v1.QueryAllocationCommitResponse) | QueryAllocationCommit queries the validator vote in the current voting period | GET|/sommelier/allocation/v1/commits/{validator}/{cellar}| -| `QueryAllocationCommits` | [QueryAllocationCommitsRequest](#allocation.v1.QueryAllocationCommitsRequest) | [QueryAllocationCommitsResponse](#allocation.v1.QueryAllocationCommitsResponse) | QueryAllocationCommits queries all validator allocation commits | GET|/sommelier/allocation/v1/commits| -| `QueryCommitPeriod` | [QueryCommitPeriodRequest](#allocation.v1.QueryCommitPeriodRequest) | [QueryCommitPeriodResponse](#allocation.v1.QueryCommitPeriodResponse) | QueryVotePeriod queries the heights for the current voting period (current, start and end) | GET|/sommelier/allocation/v1/commit_period| -| `QueryCellars` | [QueryCellarsRequest](#allocation.v1.QueryCellarsRequest) | [QueryCellarsResponse](#allocation.v1.QueryCellarsResponse) | QueryCellars returns all cellars and current tick ranges | GET|/sommelier/allocation/v1/cellars| +| `ScheduleCork` | [MsgScheduleAxelarCorkRequest](#axelarcork.v1.MsgScheduleAxelarCorkRequest) | [MsgScheduleAxelarCorkResponse](#axelarcork.v1.MsgScheduleAxelarCorkResponse) | | | +| `RelayCork` | [MsgRelayAxelarCorkRequest](#axelarcork.v1.MsgRelayAxelarCorkRequest) | [MsgRelayAxelarCorkResponse](#axelarcork.v1.MsgRelayAxelarCorkResponse) | | | +| `BumpCorkGas` | [MsgBumpAxelarCorkGasRequest](#axelarcork.v1.MsgBumpAxelarCorkGasRequest) | [MsgBumpAxelarCorkGasResponse](#axelarcork.v1.MsgBumpAxelarCorkGasResponse) | | | +| `CancelScheduledCork` | [MsgCancelAxelarCorkRequest](#axelarcork.v1.MsgCancelAxelarCorkRequest) | [MsgCancelAxelarCorkResponse](#axelarcork.v1.MsgCancelAxelarCorkResponse) | | | @@ -1237,7 +1936,7 @@ Query defines the gRPC query service for the cork module. | ----------- | ------------ | ------------- | ------------| ------- | -------- | | `QueryParams` | [QueryParamsRequest](#cork.v1.QueryParamsRequest) | [QueryParamsResponse](#cork.v1.QueryParamsResponse) | QueryParams queries the allocation module parameters. | GET|/sommelier/cork/v1/params| | `QuerySubmittedCorks` | [QuerySubmittedCorksRequest](#cork.v1.QuerySubmittedCorksRequest) | [QuerySubmittedCorksResponse](#cork.v1.QuerySubmittedCorksResponse) | QuerySubmittedCorks queries the submitted corks awaiting vote | GET|/sommelier/cork/v1/submitted| -| `QueryCommitPeriod` | [QueryCommitPeriodRequest](#cork.v1.QueryCommitPeriodRequest) | [QueryCommitPeriodResponse](#cork.v1.QueryCommitPeriodResponse) | QueryVotePeriod queries the heights for the current voting period (current, start and end) | GET|/sommelier/cork/v1/commit_period| +| `QueryCommitPeriod` | [QueryCommitPeriodRequest](#cork.v1.QueryCommitPeriodRequest) | [QueryCommitPeriodResponse](#cork.v1.QueryCommitPeriodResponse) | QueryCommitPeriod queries the heights for the current voting period (current, start and end) | GET|/sommelier/cork/v1/commit_period| | `QueryCellarIDs` | [QueryCellarIDsRequest](#cork.v1.QueryCellarIDsRequest) | [QueryCellarIDsResponse](#cork.v1.QueryCellarIDsResponse) | QueryCellarIDs returns all cellars and current tick ranges | GET|/sommelier/cork/v1/cellar_ids| | `QueryScheduledCorks` | [QueryScheduledCorksRequest](#cork.v1.QueryScheduledCorksRequest) | [QueryScheduledCorksResponse](#cork.v1.QueryScheduledCorksResponse) | QueryScheduledCorks returns all scheduled corks | GET|/sommelier/cork/v1/scheduled_corks| | `QueryScheduledBlockHeights` | [QueryScheduledBlockHeightsRequest](#cork.v1.QueryScheduledBlockHeightsRequest) | [QueryScheduledBlockHeightsResponse](#cork.v1.QueryScheduledBlockHeightsResponse) | QueryScheduledBlockHeights returns all scheduled block heights | GET|/sommelier/cork/v1/scheduled_block_heights| @@ -1247,6 +1946,130 @@ Query defines the gRPC query service for the cork module. + +

Top

+ +## incentives/v1/genesis.proto + + + + + +### GenesisState + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#incentives.v1.Params) | | | + + + + + + + + +### Params +Params incentives parameters + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `distribution_per_block` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | DistributionPerBlock defines the coin to be sent to the distribution module from the community pool every block | +| `incentives_cutoff_height` | [uint64](#uint64) | | IncentivesCutoffHeight defines the block height after which the incentives module will stop sending coins to the distribution module from the community pool | + + + + + + + + + + + + + + + + +

Top

+ +## incentives/v1/query.proto + + + + + +### QueryAPYRequest +QueryAPYRequest is the request type for the QueryAPY gRPC method. + + + + + + + + +### QueryAPYResponse +QueryAPYRequest is the response type for the QueryAPY gRPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `apy` | [string](#string) | | | + + + + + + + + +### QueryParamsRequest +QueryParamsRequest is the request type for the QueryParams gRPC method. + + + + + + + + +### QueryParamsResponse +QueryParamsRequest is the response type for the QueryParams gRPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#incentives.v1.Params) | | allocation parameters | + + + + + + + + + + + + + + +### Query +Query defines the gRPC query service for the cork module. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `QueryParams` | [QueryParamsRequest](#incentives.v1.QueryParamsRequest) | [QueryParamsResponse](#incentives.v1.QueryParamsResponse) | QueryParams queries the allocation module parameters. | GET|/sommelier/incentives/v1/params| +| `QueryAPY` | [QueryAPYRequest](#incentives.v1.QueryAPYRequest) | [QueryAPYResponse](#incentives.v1.QueryAPYResponse) | QueryAPY queries the APY returned from the incentives module. | GET|/sommelier/incentives/v1/apy| + + + + + ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/integration_tests/setup_test.go b/integration_tests/setup_test.go index 738d08d7..edcb7e17 100644 --- a/integration_tests/setup_test.go +++ b/integration_tests/setup_test.go @@ -15,7 +15,6 @@ import ( "time" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/peggyjv/sommelier/v7/app/params" auctiontypes "github.com/peggyjv/sommelier/v7/x/auction/types" @@ -32,6 +31,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/prost_build/src/main.rs b/prost_build/src/main.rs index b3c55219..84ab75ff 100644 --- a/prost_build/src/main.rs +++ b/prost_build/src/main.rs @@ -48,6 +48,8 @@ fn compile_protos(out_dir: &Path, tmp_dir: &Path) { cellarfees_proto_dir.push("proto/cellarfees/v1"); let mut cork_proto_dir = root.clone(); cork_proto_dir.push("proto/cork/v2"); + let mut axelar_cork_proto_dir = root.clone(); + axelar_cork_proto_dir.push("proto/axelarcork/v1"); let mut incentives_proto_dir = root.clone(); incentives_proto_dir.push("proto/incentives/v1"); let mut auction_proto_dir = root.clone(); @@ -64,6 +66,7 @@ fn compile_protos(out_dir: &Path, tmp_dir: &Path) { let proto_paths = [ cellarfees_proto_dir, cork_proto_dir, + axelar_cork_proto_dir, incentives_proto_dir, auction_proto_dir, pubsub_proto_dir, diff --git a/proto/axelarcork/v1/axelarcork.proto b/proto/axelarcork/v1/axelarcork.proto new file mode 100644 index 00000000..061f4b2b --- /dev/null +++ b/proto/axelarcork/v1/axelarcork.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; +package axelarcork.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/peggyjv/sommelier/v7/x/axelarcork/types"; + +message AxelarCork { + // call body containing the ABI encoded bytes to send to the contract + bytes encoded_contract_call = 1; + // the chain ID of the evm target chain + uint64 chain_id = 2; + // address of the contract to send the call + string target_contract_address = 3; + // unix timestamp before which the contract call must be executed. + // enforced by the proxy contract. + uint64 deadline = 4; +} + +message ScheduledAxelarCork { + AxelarCork cork = 1; + uint64 block_height = 2; + string validator = 3; + string id = 4; +} + +message ScheduledAxelarCorks { + repeated ScheduledAxelarCork scheduled_corks = 1; +} + +message AxelarCorkResult { + AxelarCork cork = 1; + uint64 block_height = 2; + bool approved = 3; + string approval_percentage = 4; +} + +message AxelarCorkResults { + repeated AxelarCorkResult cork_results = 1; +} + +message CellarIDSet { + ChainConfiguration chain = 1; + repeated string ids = 2; +} + +message ChainConfiguration { + string name = 1; + uint64 id = 2; + string proxy_address = 3; +} + +message ChainConfigurations { + repeated ChainConfiguration configurations = 1; +} + +// Used to enforce strictly newer call ordering per contract +message AxelarContractCallNonce { + uint64 chain_id = 1; + string contract_address = 2; + uint64 nonce = 3; +} + +// Represents a proxy contract upgrade approved by governance with a delay in +// execution in case of an error. +message AxelarUpgradeData { + uint64 chain_id = 1; + bytes payload = 2; + int64 executable_height_threshold = 3; +} + diff --git a/proto/axelarcork/v1/event.proto b/proto/axelarcork/v1/event.proto new file mode 100644 index 00000000..057b6ab7 --- /dev/null +++ b/proto/axelarcork/v1/event.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package axelarcork.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/peggyjv/sommelier/v7/x/axelarcork/types"; + +message ScheduleCorkEvent { + string signer = 1; + string validator = 2; + string cork = 3; + uint64 block_height = 4; + uint64 chain_id = 5; +} \ No newline at end of file diff --git a/proto/axelarcork/v1/genesis.proto b/proto/axelarcork/v1/genesis.proto new file mode 100644 index 00000000..8ebd7e38 --- /dev/null +++ b/proto/axelarcork/v1/genesis.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package axelarcork.v1; + +import "axelarcork/v1/axelarcork.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/peggyjv/sommelier/v7/x/axelarcork/types"; + +// GenesisState - all cork state that must be provided at genesis +message GenesisState { + Params params = 1; + ChainConfigurations chain_configurations = 2 [(gogoproto.nullable) = false]; + repeated CellarIDSet cellar_ids = 3; + ScheduledAxelarCorks scheduled_corks = 4; + AxelarCorkResults cork_results = 5; + repeated AxelarContractCallNonce axelar_contract_call_nonces = 6; + repeated AxelarUpgradeData axelar_upgrade_data = 7; +} + +message Params { + bool enabled = 1 [(gogoproto.moretags) = "yaml:\"enabled\""]; + string ibc_channel = 2 [(gogoproto.moretags) = "yaml:\"ibc_channel\""]; + string ibc_port = 3 [(gogoproto.moretags) = "yaml:\"ibc_port\""]; + string gmp_account = 4 [(gogoproto.moretags) = "yaml:\"gmp_account\""]; + string executor_account = 5 [(gogoproto.moretags) = "yaml:\"executor_account\""]; + uint64 timeout_duration = 6 [(gogoproto.moretags) = "yaml:\"timeout_duration\""]; + uint64 cork_timeout_blocks = 7 [(gogoproto.moretags) = "yaml:\"cork_timeout_blocks\""]; +} diff --git a/proto/axelarcork/v1/proposal.proto b/proto/axelarcork/v1/proposal.proto new file mode 100644 index 00000000..5d8306d2 --- /dev/null +++ b/proto/axelarcork/v1/proposal.proto @@ -0,0 +1,167 @@ +syntax = "proto3"; +package axelarcork.v1; + +import "axelarcork/v1/axelarcork.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/peggyjv/sommelier/v7/x/axelarcork/types"; + +// note: current plan is to accept either chain name or chain ID. if both and they dont match, error. + +message AddAxelarManagedCellarIDsProposal { + string title = 1; + string description = 2; + uint64 chain_id = 3; + CellarIDSet cellar_ids = 4; +} + +// AddManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands +message AddAxelarManagedCellarIDsProposalWithDeposit { + string title = 1; + string description = 2; + uint64 chain_id = 3; + CellarIDSet cellar_ids = 4; + string deposit = 5; +} + +message RemoveAxelarManagedCellarIDsProposal { + string title = 1; + string description = 2; + uint64 chain_id = 3; + CellarIDSet cellar_ids = 4; +} + +// RemoveManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands +message RemoveAxelarManagedCellarIDsProposalWithDeposit { + string title = 1; + string description = 2; + uint64 chain_id = 3; + CellarIDSet cellar_ids = 4; + string deposit = 5; +} + +message AxelarScheduledCorkProposal { + string title = 1; + string description = 2; + uint64 block_height = 3; + uint64 chain_id = 4; + string target_contract_address = 5; + /* + * The JSON representation of a ScheduleRequest defined in the Steward protos + * + * Example: The following is the JSON form of a ScheduleRequest containing a steward.v2.cellar_v1.TrustPosition + * message, which maps to the `trustPosition(address)` function of the the V1 Cellar contract. + * + * { + * "cellar_id": "0x1234567890000000000000000000000000000000", + * "cellar_v1": { + * "trust_position": { + * "erc20_address": "0x1234567890000000000000000000000000000000" + * } + * }, + * "block_height": 1000000 + * } + * + * You can use the Steward CLI to generate the required JSON rather than constructing it by hand + * https://github.com/peggyjv/steward + */ + string contract_call_proto_json = 6; + // unix timestamp before which the contract call must be executed. + // enforced by the Axelar proxy contract + uint64 deadline = 7; +} + +// ScheduledCorkProposalWithDeposit is a specific definition for CLI commands +message AxelarScheduledCorkProposalWithDeposit { + string title = 1; + string description = 2; + uint64 block_height = 3; + uint64 chain_id = 4; + string target_contract_address = 5; + string contract_call_proto_json = 6; + uint64 deadline = 7; + string deposit = 8; +} + +message AxelarCommunityPoolSpendProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = true; + option (gogoproto.goproto_stringer) = true; + + string title = 1; + string description = 2; + string recipient = 3; + uint64 chain_id = 4; + cosmos.base.v1beta1.Coin amount = 5 [(gogoproto.nullable) = false]; +} + +// This format of the community spend Ethereum proposal is specifically for +// the CLI to allow simple text serialization. +message AxelarCommunityPoolSpendProposalForCLI { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + + string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; + string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; + string recipient = 3 [(gogoproto.moretags) = "yaml:\"recipient\""]; + uint64 chain_id = 4 [(gogoproto.moretags) = "yaml:\"chain_id\""]; + string chain_name = 5 [(gogoproto.moretags) = "yaml:\"chain_name\""]; + string amount = 6 [(gogoproto.moretags) = "yaml:\"amount\""]; + string deposit = 7 [(gogoproto.moretags) = "yaml:\"deposit\""]; +} + +message AddChainConfigurationProposal { + string title = 1; + string description = 2; + ChainConfiguration chain_configuration = 3; +} + +message AddChainConfigurationProposalWithDeposit { + string title = 1; + string description = 2; + ChainConfiguration chain_configuration = 3; + string deposit = 4; +} + +message RemoveChainConfigurationProposal { + string title = 1; + string description = 2; + uint64 chain_id = 3; +} + +message RemoveChainConfigurationProposalWithDeposit { + string title = 1; + string description = 2; + uint64 chain_id = 3; + string deposit = 4; +} + +message UpgradeAxelarProxyContractProposal { + string title = 1; + string description = 2; + uint64 chain_id = 3; + string new_proxy_address = 4; +} + +message UpgradeAxelarProxyContractProposalWithDeposit { + string title = 1; + string description = 2; + uint64 chain_id = 3; + string new_proxy_address = 4; + string deposit = 5; +} + +message CancelAxelarProxyContractUpgradeProposal { + string title = 1; + string description = 2; + uint64 chain_id = 3; +} + +message CancelAxelarProxyContractUpgradeProposalWithDeposit { + string title = 1; + string description = 2; + uint64 chain_id = 3; + string deposit = 4; +} + diff --git a/proto/axelarcork/v1/query.proto b/proto/axelarcork/v1/query.proto new file mode 100644 index 00000000..2cb37f1b --- /dev/null +++ b/proto/axelarcork/v1/query.proto @@ -0,0 +1,169 @@ +syntax = "proto3"; +package axelarcork.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "axelarcork/v1/genesis.proto"; +import "axelarcork/v1/axelarcork.proto"; + +option go_package = "github.com/peggyjv/sommelier/v7/x/axelarcork/types"; + +// Query defines the gRPC query service for the cork module. +service Query { + // QueryParams queries the axelar cork module parameters. + rpc QueryParams(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/sommelier/cork/v1/params"; + } + // QueryCellarIDs queries approved cellar ids of all supported chains + rpc QueryCellarIDs(QueryCellarIDsRequest) returns (QueryCellarIDsResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/cellar_ids"; + } + // QueryCellarIDsByChainID returns all cellars and current tick ranges + rpc QueryCellarIDsByChainID(QueryCellarIDsByChainIDRequest) returns (QueryCellarIDsByChainIDResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/cellar_ids_by_chain_id"; + } + // QueryScheduledCorks returns all scheduled corks + rpc QueryScheduledCorks(QueryScheduledCorksRequest) returns (QueryScheduledCorksResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/scheduled_corks"; + } + // QueryScheduledBlockHeights returns all scheduled block heights + rpc QueryScheduledBlockHeights(QueryScheduledBlockHeightsRequest) returns (QueryScheduledBlockHeightsResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/scheduled_block_heights"; + } + + // QueryScheduledCorks returns all scheduled corks at a block height + rpc QueryScheduledCorksByBlockHeight(QueryScheduledCorksByBlockHeightRequest) + returns (QueryScheduledCorksByBlockHeightResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/scheduled_corks_by_block_height/{block_height}"; + } + + // QueryScheduledCorks returns all scheduled corks with the specified ID + rpc QueryScheduledCorksByID(QueryScheduledCorksByIDRequest) returns (QueryScheduledCorksByIDResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/scheduled_corks_by_id/{id}"; + } + + rpc QueryCorkResult(QueryCorkResultRequest) returns (QueryCorkResultResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/cork_results/{id}"; + } + + rpc QueryCorkResults(QueryCorkResultsRequest) returns (QueryCorkResultsResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/cork_results"; + } + + rpc QueryChainConfigurations(QueryChainConfigurationsRequest) returns (QueryChainConfigurationsResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/chain_configurations"; + } + + rpc QueryAxelarContractCallNonces(QueryAxelarContractCallNoncesRequest) returns (QueryAxelarContractCallNoncesResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/contract_call_nonces"; + } + + rpc QueryAxelarProxyUpgradeData(QueryAxelarProxyUpgradeDataRequest) returns (QueryAxelarProxyUpgradeDataResponse) { + option (google.api.http).get = "/sommelier/axelarcork/v1/proxy_upgrade_data"; + } +} + +// QueryParamsRequest is the request type for the Query/Params gRPC method. +message QueryParamsRequest {} + +// QueryParamsRequest is the response type for the Query/Params gRPC method. +message QueryParamsResponse { + // allocation parameters + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryCellarIDs is the request type for Query/QueryCellarIDs gRPC method. +message QueryCellarIDsRequest {} + +// QueryCellarIDsResponse is the response type for Query/QueryCellarIDs gRPC method. +message QueryCellarIDsResponse { + repeated CellarIDSet cellar_ids = 1; +} + +// QueryCellarIDsByChainIDRequest is the request type for Query/QueryCellarIDsByChainID gRPC method. +message QueryCellarIDsByChainIDRequest { + uint64 chain_id = 1; +} + +// QueryCellarIDsByChainIDResponse is the response type for Query/QueryCellarIDsByChainID gRPC method. +message QueryCellarIDsByChainIDResponse { + repeated string cellar_ids = 1; +} + +// QueryScheduledCorksRequest +message QueryScheduledCorksRequest { + uint64 chain_id = 1; +} + +// QueryScheduledCorksResponse +message QueryScheduledCorksResponse { + repeated ScheduledAxelarCork corks = 1; +} + +// QueryScheduledBlockHeightsRequest +message QueryScheduledBlockHeightsRequest { + uint64 chain_id = 1; +} + +// QueryScheduledBlockHeightsResponse +message QueryScheduledBlockHeightsResponse { + repeated uint64 block_heights = 1; +} + +// QueryScheduledCorksByBlockHeightRequest +message QueryScheduledCorksByBlockHeightRequest { + uint64 block_height = 1; + uint64 chain_id = 2; +} + +// QueryScheduledCorksByBlockHeightResponse +message QueryScheduledCorksByBlockHeightResponse { + repeated ScheduledAxelarCork corks = 1; +} + +// QueryScheduledCorksByIDRequest +message QueryScheduledCorksByIDRequest { + string id = 1; + uint64 chain_id = 2; +} + +// QueryScheduledCorksByIDResponse +message QueryScheduledCorksByIDResponse { + repeated ScheduledAxelarCork corks = 1; +} + +message QueryCorkResultRequest { + string id = 1; + uint64 chain_id = 2; +} + +message QueryCorkResultResponse { + AxelarCorkResult corkResult = 1; +} + +message QueryCorkResultsRequest { + uint64 chain_id = 1; +} + +message QueryCorkResultsResponse { + repeated AxelarCorkResult corkResults = 1; +} + +message QueryChainConfigurationsRequest {} + +message QueryChainConfigurationsResponse { + repeated ChainConfiguration configurations = 1; +} + +message QueryAxelarContractCallNoncesRequest {} + +message QueryAxelarContractCallNoncesResponse { + repeated AxelarContractCallNonce contract_call_nonces = 1; +} + +message QueryAxelarProxyUpgradeDataRequest {} + +message QueryAxelarProxyUpgradeDataResponse { + repeated AxelarUpgradeData proxy_upgrade_data = 1; +} + diff --git a/proto/axelarcork/v1/tx.proto b/proto/axelarcork/v1/tx.proto new file mode 100644 index 00000000..2764c78c --- /dev/null +++ b/proto/axelarcork/v1/tx.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package axelarcork.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "axelarcork/v1/axelarcork.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/peggyjv/sommelier/v7/x/axelarcork/types"; + +// MsgService defines the msgs that the cork module handles +service Msg { + rpc ScheduleCork(MsgScheduleAxelarCorkRequest) returns (MsgScheduleAxelarCorkResponse); + rpc RelayCork(MsgRelayAxelarCorkRequest) returns (MsgRelayAxelarCorkResponse); + rpc BumpCorkGas(MsgBumpAxelarCorkGasRequest) returns (MsgBumpAxelarCorkGasResponse); + rpc CancelScheduledCork(MsgCancelAxelarCorkRequest) returns (MsgCancelAxelarCorkResponse); +} + +// MsgScheduleCorkRequest - sdk.Msg for scheduling a cork request for on or after a specific block height +message MsgScheduleAxelarCorkRequest { + // the scheduled cork + AxelarCork cork = 1; + // the chain id + uint64 chain_id = 2; + // the block height that must be reached + uint64 block_height = 3; + // signer account address + string signer = 4; +} + +message MsgScheduleAxelarCorkResponse { + // cork ID + string id = 1; +} + +message MsgRelayAxelarCorkRequest { + string signer = 1; + cosmos.base.v1beta1.Coin token = 2 [(gogoproto.nullable) = false]; + uint64 fee = 3; + uint64 chain_id = 4; + string target_contract_address = 5; +} + +message MsgRelayAxelarCorkResponse {} + +message MsgRelayAxelarProxyUpgradeRequest { + string signer = 1; + cosmos.base.v1beta1.Coin token = 2 [(gogoproto.nullable) = false]; + uint64 fee = 3; + uint64 chain_id = 4; +} + +message MsgRelayAxelarProxyUpgradeResponse {} + +message MsgBumpAxelarCorkGasRequest { + string signer = 1; + cosmos.base.v1beta1.Coin token = 2 [(gogoproto.nullable) = false]; + string message_id = 3; +} + +message MsgBumpAxelarCorkGasResponse {} + +message MsgCancelAxelarCorkRequest { + string signer = 1; + uint64 chain_id = 2; + string target_contract_address = 3; +} + +message MsgCancelAxelarCorkResponse {} diff --git a/proto/incentives/v1/query.proto b/proto/incentives/v1/query.proto index 05962f12..7ecf4a58 100644 --- a/proto/incentives/v1/query.proto +++ b/proto/incentives/v1/query.proto @@ -31,7 +31,6 @@ message QueryParamsResponse { // QueryAPYRequest is the request type for the QueryAPY gRPC method. message QueryAPYRequest {} - // QueryAPYRequest is the response type for the QueryAPY gRPC method. message QueryAPYResponse { string apy = 1; diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 00000000..c0aba168 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,7 @@ +# Scripts + +These scripts are copied from the [Cosmos-SDK](https://github.com/cosmos/cosmos-sdk/tree/v0.42.1/scripts) respository +with minor modifications. All credits and big thanks go to the original authors. + +Please note that a custom [fork](github.com/regen-network/protobuf) by the Regen network team is used. +See [`go.mod`](../go.mod) for version. \ No newline at end of file diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index eeb10b25..f12f1c9e 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -11,6 +11,7 @@ protoc_gen_gocosmos() { go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest 2>/dev/null } +echo "verifying protoc gocosmos" protoc_gen_gocosmos echo "generating proto and gRPC gateway files..." diff --git a/somm_proto/src/lib.rs b/somm_proto/src/lib.rs index ceaf11a0..fa3f1dcb 100644 --- a/somm_proto/src/lib.rs +++ b/somm_proto/src/lib.rs @@ -7,3 +7,16 @@ pub mod cork { pub mod pubsub { include!("prost/pubsub.v1.rs"); } + +pub mod axelar_cork { + include!("prost/axelarcork.v1.rs"); +} + +pub mod incentives { + include!("prost/incentives.v1.rs"); +} + +pub mod cellarfees { + include!("prost/cellarfees.v1.rs"); +} + diff --git a/somm_proto/src/prost/axelarcork.v1.rs b/somm_proto/src/prost/axelarcork.v1.rs new file mode 100644 index 00000000..1417838a --- /dev/null +++ b/somm_proto/src/prost/axelarcork.v1.rs @@ -0,0 +1,912 @@ +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AxelarCork { + /// call body containing the ABI encoded bytes to send to the contract + #[prost(bytes = "vec", tag = "1")] + pub encoded_contract_call: ::prost::alloc::vec::Vec, + /// the chain ID of the evm target chain + #[prost(uint64, tag = "2")] + pub chain_id: u64, + /// address of the contract to send the call + #[prost(string, tag = "3")] + pub target_contract_address: ::prost::alloc::string::String, + /// unix timestamp before which the contract call must be executed. + /// enforced by the proxy contract. + #[prost(uint64, tag = "4")] + pub deadline: u64, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct ScheduledAxelarCork { + #[prost(message, optional, tag = "1")] + pub cork: ::core::option::Option, + #[prost(uint64, tag = "2")] + pub block_height: u64, + #[prost(string, tag = "3")] + pub validator: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct ScheduledAxelarCorks { + #[prost(message, repeated, tag = "1")] + pub scheduled_corks: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AxelarCorkResult { + #[prost(message, optional, tag = "1")] + pub cork: ::core::option::Option, + #[prost(uint64, tag = "2")] + pub block_height: u64, + #[prost(bool, tag = "3")] + pub approved: bool, + #[prost(string, tag = "4")] + pub approval_percentage: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AxelarCorkResults { + #[prost(message, repeated, tag = "1")] + pub cork_results: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct CellarIdSet { + #[prost(message, optional, tag = "1")] + pub chain: ::core::option::Option, + #[prost(string, repeated, tag = "2")] + pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct ChainConfiguration { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub id: u64, + #[prost(string, tag = "3")] + pub proxy_address: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct ChainConfigurations { + #[prost(message, repeated, tag = "1")] + pub configurations: ::prost::alloc::vec::Vec, +} +/// Used to enforce strictly newer call ordering per contract +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AxelarContractCallNonce { + #[prost(uint64, tag = "1")] + pub chain_id: u64, + #[prost(string, tag = "2")] + pub contract_address: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub nonce: u64, +} +/// Represents a proxy contract upgrade approved by governance with a delay in +/// execution in case of an error. +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AxelarUpgradeData { + #[prost(uint64, tag = "1")] + pub chain_id: u64, + #[prost(bytes = "vec", tag = "2")] + pub payload: ::prost::alloc::vec::Vec, + #[prost(int64, tag = "3")] + pub executable_height_threshold: i64, +} +/// MsgScheduleCorkRequest - sdk.Msg for scheduling a cork request for on or after a specific block height +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgScheduleAxelarCorkRequest { + /// the scheduled cork + #[prost(message, optional, tag = "1")] + pub cork: ::core::option::Option, + /// the chain id + #[prost(uint64, tag = "2")] + pub chain_id: u64, + /// the block height that must be reached + #[prost(uint64, tag = "3")] + pub block_height: u64, + /// signer account address + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgScheduleAxelarCorkResponse { + /// cork ID + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgRelayAxelarCorkRequest { + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub token: ::core::option::Option, + #[prost(uint64, tag = "3")] + pub fee: u64, + #[prost(uint64, tag = "4")] + pub chain_id: u64, + #[prost(string, tag = "5")] + pub target_contract_address: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgRelayAxelarCorkResponse {} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgRelayAxelarProxyUpgradeRequest { + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub token: ::core::option::Option, + #[prost(uint64, tag = "3")] + pub fee: u64, + #[prost(uint64, tag = "4")] + pub chain_id: u64, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgRelayAxelarProxyUpgradeResponse {} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgBumpAxelarCorkGasRequest { + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub token: ::core::option::Option, + #[prost(string, tag = "3")] + pub message_id: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgBumpAxelarCorkGasResponse {} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelAxelarCorkRequest { + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub chain_id: u64, + #[prost(string, tag = "3")] + pub target_contract_address: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelAxelarCorkResponse {} +#[doc = r" Generated client implementations."] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs)] + use tonic::codegen::*; + #[doc = " MsgService defines the msgs that the cork module handles"] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + #[doc = r" Attempt to create a new client by connecting to a given endpoint."] + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::ResponseBody: Body + HttpBody + Send + 'static, + T::Error: Into, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: impl Into) -> Self { + let inner = tonic::client::Grpc::with_interceptor(inner, interceptor); + Self { inner } + } + pub async fn schedule_cork( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/axelarcork.v1.Msg/ScheduleCork"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn relay_cork( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/axelarcork.v1.Msg/RelayCork"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn bump_cork_gas( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/axelarcork.v1.Msg/BumpCorkGas"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn cancel_scheduled_cork( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/axelarcork.v1.Msg/CancelScheduledCork"); + self.inner.unary(request.into_request(), path, codec).await + } + } + impl Clone for MsgClient { + fn clone(&self) -> Self { + Self { + inner: self.inner.clone(), + } + } + } + impl std::fmt::Debug for MsgClient { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "MsgClient {{ ... }}") + } + } +} +/// GenesisState - all cork state that must be provided at genesis +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub chain_configurations: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub cellar_ids: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub scheduled_corks: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub cork_results: ::core::option::Option, + #[prost(message, repeated, tag = "6")] + pub axelar_contract_call_nonces: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub axelar_upgrade_data: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct Params { + #[prost(bool, tag = "1")] + pub enabled: bool, + #[prost(string, tag = "2")] + pub ibc_channel: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub ibc_port: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub gmp_account: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub executor_account: ::prost::alloc::string::String, + #[prost(uint64, tag = "6")] + pub timeout_duration: u64, + #[prost(uint64, tag = "7")] + pub cork_timeout_blocks: u64, +} +/// QueryParamsRequest is the request type for the Query/Params gRPC method. +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsRequest is the response type for the Query/Params gRPC method. +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// allocation parameters + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryCellarIDs is the request type for Query/QueryCellarIDs gRPC method. +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryCellarIDsRequest {} +/// QueryCellarIDsResponse is the response type for Query/QueryCellarIDs gRPC method. +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryCellarIDsResponse { + #[prost(message, repeated, tag = "1")] + pub cellar_ids: ::prost::alloc::vec::Vec, +} +/// QueryCellarIDsByChainIDRequest is the request type for Query/QueryCellarIDsByChainID gRPC method. +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryCellarIDsByChainIdRequest { + #[prost(uint64, tag = "1")] + pub chain_id: u64, +} +/// QueryCellarIDsByChainIDResponse is the response type for Query/QueryCellarIDsByChainID gRPC method. +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryCellarIDsByChainIdResponse { + #[prost(string, repeated, tag = "1")] + pub cellar_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// QueryScheduledCorksRequest +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryScheduledCorksRequest { + #[prost(uint64, tag = "1")] + pub chain_id: u64, +} +/// QueryScheduledCorksResponse +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryScheduledCorksResponse { + #[prost(message, repeated, tag = "1")] + pub corks: ::prost::alloc::vec::Vec, +} +/// QueryScheduledBlockHeightsRequest +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryScheduledBlockHeightsRequest { + #[prost(uint64, tag = "1")] + pub chain_id: u64, +} +/// QueryScheduledBlockHeightsResponse +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryScheduledBlockHeightsResponse { + #[prost(uint64, repeated, tag = "1")] + pub block_heights: ::prost::alloc::vec::Vec, +} +/// QueryScheduledCorksByBlockHeightRequest +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryScheduledCorksByBlockHeightRequest { + #[prost(uint64, tag = "1")] + pub block_height: u64, + #[prost(uint64, tag = "2")] + pub chain_id: u64, +} +/// QueryScheduledCorksByBlockHeightResponse +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryScheduledCorksByBlockHeightResponse { + #[prost(message, repeated, tag = "1")] + pub corks: ::prost::alloc::vec::Vec, +} +/// QueryScheduledCorksByIDRequest +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryScheduledCorksByIdRequest { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub chain_id: u64, +} +/// QueryScheduledCorksByIDResponse +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryScheduledCorksByIdResponse { + #[prost(message, repeated, tag = "1")] + pub corks: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryCorkResultRequest { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub chain_id: u64, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryCorkResultResponse { + #[prost(message, optional, tag = "1")] + pub cork_result: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryCorkResultsRequest { + #[prost(uint64, tag = "1")] + pub chain_id: u64, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryCorkResultsResponse { + #[prost(message, repeated, tag = "1")] + pub cork_results: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryChainConfigurationsRequest {} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryChainConfigurationsResponse { + #[prost(message, repeated, tag = "1")] + pub configurations: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryAxelarContractCallNoncesRequest {} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryAxelarContractCallNoncesResponse { + #[prost(message, repeated, tag = "1")] + pub contract_call_nonces: ::prost::alloc::vec::Vec, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryAxelarProxyUpgradeDataRequest {} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct QueryAxelarProxyUpgradeDataResponse { + #[prost(message, repeated, tag = "1")] + pub proxy_upgrade_data: ::prost::alloc::vec::Vec, +} +#[doc = r" Generated client implementations."] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs)] + use tonic::codegen::*; + #[doc = " Query defines the gRPC query service for the cork module."] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + impl QueryClient { + #[doc = r" Attempt to create a new client by connecting to a given endpoint."] + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::ResponseBody: Body + HttpBody + Send + 'static, + T::Error: Into, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: impl Into) -> Self { + let inner = tonic::client::Grpc::with_interceptor(inner, interceptor); + Self { inner } + } + #[doc = " QueryParams queries the axelar cork module parameters."] + pub async fn query_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/axelarcork.v1.Query/QueryParams"); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " QueryCellarIDs queries approved cellar ids of all supported chains"] + pub async fn query_cellar_i_ds( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/axelarcork.v1.Query/QueryCellarIDs"); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " QueryCellarIDsByChainID returns all cellars and current tick ranges"] + pub async fn query_cellar_i_ds_by_chain_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/axelarcork.v1.Query/QueryCellarIDsByChainID", + ); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " QueryScheduledCorks returns all scheduled corks"] + pub async fn query_scheduled_corks( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/axelarcork.v1.Query/QueryScheduledCorks"); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " QueryScheduledBlockHeights returns all scheduled block heights"] + pub async fn query_scheduled_block_heights( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/axelarcork.v1.Query/QueryScheduledBlockHeights", + ); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " QueryScheduledCorks returns all scheduled corks at a block height"] + pub async fn query_scheduled_corks_by_block_height( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/axelarcork.v1.Query/QueryScheduledCorksByBlockHeight", + ); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " QueryScheduledCorks returns all scheduled corks with the specified ID"] + pub async fn query_scheduled_corks_by_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/axelarcork.v1.Query/QueryScheduledCorksByID", + ); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn query_cork_result( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/axelarcork.v1.Query/QueryCorkResult"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn query_cork_results( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/axelarcork.v1.Query/QueryCorkResults"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn query_chain_configurations( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/axelarcork.v1.Query/QueryChainConfigurations", + ); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn query_axelar_contract_call_nonces( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/axelarcork.v1.Query/QueryAxelarContractCallNonces", + ); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn query_axelar_proxy_upgrade_data( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/axelarcork.v1.Query/QueryAxelarProxyUpgradeData", + ); + self.inner.unary(request.into_request(), path, codec).await + } + } + impl Clone for QueryClient { + fn clone(&self) -> Self { + Self { + inner: self.inner.clone(), + } + } + } + impl std::fmt::Debug for QueryClient { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "QueryClient {{ ... }}") + } + } +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct ScheduleCorkEvent { + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub cork: ::prost::alloc::string::String, + #[prost(uint64, tag = "4")] + pub block_height: u64, + #[prost(uint64, tag = "5")] + pub chain_id: u64, +} +// note: current plan is to accept either chain name or chain ID. if both and they dont match, error. + +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AddAxelarManagedCellarIDsProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, + #[prost(message, optional, tag = "4")] + pub cellar_ids: ::core::option::Option, +} +/// AddManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AddAxelarManagedCellarIDsProposalWithDeposit { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, + #[prost(message, optional, tag = "4")] + pub cellar_ids: ::core::option::Option, + #[prost(string, tag = "5")] + pub deposit: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct RemoveAxelarManagedCellarIDsProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, + #[prost(message, optional, tag = "4")] + pub cellar_ids: ::core::option::Option, +} +/// RemoveManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct RemoveAxelarManagedCellarIDsProposalWithDeposit { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, + #[prost(message, optional, tag = "4")] + pub cellar_ids: ::core::option::Option, + #[prost(string, tag = "5")] + pub deposit: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AxelarScheduledCorkProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub block_height: u64, + #[prost(uint64, tag = "4")] + pub chain_id: u64, + #[prost(string, tag = "5")] + pub target_contract_address: ::prost::alloc::string::String, + /// + /// The JSON representation of a ScheduleRequest defined in the Steward protos + /// + /// Example: The following is the JSON form of a ScheduleRequest containing a steward.v2.cellar_v1.TrustPosition + /// message, which maps to the `trustPosition(address)` function of the the V1 Cellar contract. + /// + /// { + /// "cellar_id": "0x1234567890000000000000000000000000000000", + /// "cellar_v1": { + /// "trust_position": { + /// "erc20_address": "0x1234567890000000000000000000000000000000" + /// } + /// }, + /// "block_height": 1000000 + /// } + /// + /// You can use the Steward CLI to generate the required JSON rather than constructing it by hand + /// https://github.com/peggyjv/steward + #[prost(string, tag = "6")] + pub contract_call_proto_json: ::prost::alloc::string::String, + /// unix timestamp before which the contract call must be executed. + /// enforced by the Axelar proxy contract + #[prost(uint64, tag = "7")] + pub deadline: u64, +} +/// ScheduledCorkProposalWithDeposit is a specific definition for CLI commands +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AxelarScheduledCorkProposalWithDeposit { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub block_height: u64, + #[prost(uint64, tag = "4")] + pub chain_id: u64, + #[prost(string, tag = "5")] + pub target_contract_address: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub contract_call_proto_json: ::prost::alloc::string::String, + #[prost(uint64, tag = "7")] + pub deadline: u64, + #[prost(string, tag = "8")] + pub deposit: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AxelarCommunityPoolSpendProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub recipient: ::prost::alloc::string::String, + #[prost(uint64, tag = "4")] + pub chain_id: u64, + #[prost(message, optional, tag = "5")] + pub amount: ::core::option::Option, +} +/// This format of the community spend Ethereum proposal is specifically for +/// the CLI to allow simple text serialization. +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AxelarCommunityPoolSpendProposalForCli { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub recipient: ::prost::alloc::string::String, + #[prost(uint64, tag = "4")] + pub chain_id: u64, + #[prost(string, tag = "5")] + pub chain_name: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub amount: ::prost::alloc::string::String, + #[prost(string, tag = "7")] + pub deposit: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AddChainConfigurationProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub chain_configuration: ::core::option::Option, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct AddChainConfigurationProposalWithDeposit { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub chain_configuration: ::core::option::Option, + #[prost(string, tag = "4")] + pub deposit: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct RemoveChainConfigurationProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct RemoveChainConfigurationProposalWithDeposit { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, + #[prost(string, tag = "4")] + pub deposit: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct UpgradeAxelarProxyContractProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, + #[prost(string, tag = "4")] + pub new_proxy_address: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct UpgradeAxelarProxyContractProposalWithDeposit { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, + #[prost(string, tag = "4")] + pub new_proxy_address: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub deposit: ::prost::alloc::string::String, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct CancelAxelarProxyContractUpgradeProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, +} +#[derive(serde::Deserialize, serde::Serialize, Clone, PartialEq, ::prost::Message)] +pub struct CancelAxelarProxyContractUpgradeProposalWithDeposit { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub chain_id: u64, + #[prost(string, tag = "4")] + pub deposit: ::prost::alloc::string::String, +} diff --git a/third_party/proto/cosmos_proto/cosmos.proto b/third_party/proto/cosmos_proto/cosmos.proto index 167b1707..15e190df 100644 --- a/third_party/proto/cosmos_proto/cosmos.proto +++ b/third_party/proto/cosmos_proto/cosmos.proto @@ -6,11 +6,11 @@ import "google/protobuf/descriptor.proto"; option go_package = "github.com/regen-network/cosmos-proto"; extend google.protobuf.MessageOptions { - string interface_type = 93001; + string interface_type = 93001; - string implements_interface = 93002; + string implements_interface = 93002; } extend google.protobuf.FieldOptions { - string accepts_interface = 93001; + string accepts_interface = 93001; } diff --git a/third_party/proto/gogoproto/gogo.proto b/third_party/proto/gogoproto/gogo.proto index 49e78f99..6342ee9f 100644 --- a/third_party/proto/gogoproto/gogo.proto +++ b/third_party/proto/gogoproto/gogo.proto @@ -31,115 +31,115 @@ package gogoproto; import "google/protobuf/descriptor.proto"; -option java_package = "com.google.protobuf"; +option java_package = "com.google.protobuf"; option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/gogo/protobuf/gogoproto"; +option go_package = "github.com/gogo/protobuf/gogoproto"; extend google.protobuf.EnumOptions { - optional bool goproto_enum_prefix = 62001; - optional bool goproto_enum_stringer = 62021; - optional bool enum_stringer = 62022; - optional string enum_customname = 62023; - optional bool enumdecl = 62024; + optional bool goproto_enum_prefix = 62001; + optional bool goproto_enum_stringer = 62021; + optional bool enum_stringer = 62022; + optional string enum_customname = 62023; + optional bool enumdecl = 62024; } extend google.protobuf.EnumValueOptions { - optional string enumvalue_customname = 66001; + optional string enumvalue_customname = 66001; } extend google.protobuf.FileOptions { - optional bool goproto_getters_all = 63001; - optional bool goproto_enum_prefix_all = 63002; - optional bool goproto_stringer_all = 63003; - optional bool verbose_equal_all = 63004; - optional bool face_all = 63005; - optional bool gostring_all = 63006; - optional bool populate_all = 63007; - optional bool stringer_all = 63008; - optional bool onlyone_all = 63009; - - optional bool equal_all = 63013; - optional bool description_all = 63014; - optional bool testgen_all = 63015; - optional bool benchgen_all = 63016; - optional bool marshaler_all = 63017; - optional bool unmarshaler_all = 63018; - optional bool stable_marshaler_all = 63019; - - optional bool sizer_all = 63020; - - optional bool goproto_enum_stringer_all = 63021; - optional bool enum_stringer_all = 63022; - - optional bool unsafe_marshaler_all = 63023; - optional bool unsafe_unmarshaler_all = 63024; - - optional bool goproto_extensions_map_all = 63025; - optional bool goproto_unrecognized_all = 63026; - optional bool gogoproto_import = 63027; - optional bool protosizer_all = 63028; - optional bool compare_all = 63029; - optional bool typedecl_all = 63030; - optional bool enumdecl_all = 63031; - - optional bool goproto_registration = 63032; - optional bool messagename_all = 63033; - - optional bool goproto_sizecache_all = 63034; - optional bool goproto_unkeyed_all = 63035; + optional bool goproto_getters_all = 63001; + optional bool goproto_enum_prefix_all = 63002; + optional bool goproto_stringer_all = 63003; + optional bool verbose_equal_all = 63004; + optional bool face_all = 63005; + optional bool gostring_all = 63006; + optional bool populate_all = 63007; + optional bool stringer_all = 63008; + optional bool onlyone_all = 63009; + + optional bool equal_all = 63013; + optional bool description_all = 63014; + optional bool testgen_all = 63015; + optional bool benchgen_all = 63016; + optional bool marshaler_all = 63017; + optional bool unmarshaler_all = 63018; + optional bool stable_marshaler_all = 63019; + + optional bool sizer_all = 63020; + + optional bool goproto_enum_stringer_all = 63021; + optional bool enum_stringer_all = 63022; + + optional bool unsafe_marshaler_all = 63023; + optional bool unsafe_unmarshaler_all = 63024; + + optional bool goproto_extensions_map_all = 63025; + optional bool goproto_unrecognized_all = 63026; + optional bool gogoproto_import = 63027; + optional bool protosizer_all = 63028; + optional bool compare_all = 63029; + optional bool typedecl_all = 63030; + optional bool enumdecl_all = 63031; + + optional bool goproto_registration = 63032; + optional bool messagename_all = 63033; + + optional bool goproto_sizecache_all = 63034; + optional bool goproto_unkeyed_all = 63035; } extend google.protobuf.MessageOptions { - optional bool goproto_getters = 64001; - optional bool goproto_stringer = 64003; - optional bool verbose_equal = 64004; - optional bool face = 64005; - optional bool gostring = 64006; - optional bool populate = 64007; - optional bool stringer = 67008; - optional bool onlyone = 64009; + optional bool goproto_getters = 64001; + optional bool goproto_stringer = 64003; + optional bool verbose_equal = 64004; + optional bool face = 64005; + optional bool gostring = 64006; + optional bool populate = 64007; + optional bool stringer = 67008; + optional bool onlyone = 64009; - optional bool equal = 64013; - optional bool description = 64014; - optional bool testgen = 64015; - optional bool benchgen = 64016; - optional bool marshaler = 64017; - optional bool unmarshaler = 64018; - optional bool stable_marshaler = 64019; + optional bool equal = 64013; + optional bool description = 64014; + optional bool testgen = 64015; + optional bool benchgen = 64016; + optional bool marshaler = 64017; + optional bool unmarshaler = 64018; + optional bool stable_marshaler = 64019; - optional bool sizer = 64020; + optional bool sizer = 64020; - optional bool unsafe_marshaler = 64023; - optional bool unsafe_unmarshaler = 64024; + optional bool unsafe_marshaler = 64023; + optional bool unsafe_unmarshaler = 64024; - optional bool goproto_extensions_map = 64025; - optional bool goproto_unrecognized = 64026; + optional bool goproto_extensions_map = 64025; + optional bool goproto_unrecognized = 64026; - optional bool protosizer = 64028; - optional bool compare = 64029; + optional bool protosizer = 64028; + optional bool compare = 64029; - optional bool typedecl = 64030; + optional bool typedecl = 64030; - optional bool messagename = 64033; + optional bool messagename = 64033; - optional bool goproto_sizecache = 64034; - optional bool goproto_unkeyed = 64035; + optional bool goproto_sizecache = 64034; + optional bool goproto_unkeyed = 64035; } extend google.protobuf.FieldOptions { - optional bool nullable = 65001; - optional bool embed = 65002; - optional string customtype = 65003; - optional string customname = 65004; - optional string jsontag = 65005; - optional string moretags = 65006; - optional string casttype = 65007; - optional string castkey = 65008; - optional string castvalue = 65009; - - optional bool stdtime = 65010; - optional bool stdduration = 65011; - optional bool wktpointer = 65012; - - optional string castrepeated = 65013; + optional bool nullable = 65001; + optional bool embed = 65002; + optional string customtype = 65003; + optional string customname = 65004; + optional string jsontag = 65005; + optional string moretags = 65006; + optional string casttype = 65007; + optional string castkey = 65008; + optional string castvalue = 65009; + + optional bool stdtime = 65010; + optional bool stdduration = 65011; + optional bool wktpointer = 65012; + + optional string castrepeated = 65013; } diff --git a/third_party/proto/google/api/annotations.proto b/third_party/proto/google/api/annotations.proto index efdab3db..1bb61118 100644 --- a/third_party/proto/google/api/annotations.proto +++ b/third_party/proto/google/api/annotations.proto @@ -19,11 +19,11 @@ package google.api; import "google/api/http.proto"; import "google/protobuf/descriptor.proto"; -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; option java_outer_classname = "AnnotationsProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; extend google.protobuf.MethodOptions { // See `HttpRule`. diff --git a/third_party/proto/google/api/http.proto b/third_party/proto/google/api/http.proto index 113fa936..f9d53e08 100644 --- a/third_party/proto/google/api/http.proto +++ b/third_party/proto/google/api/http.proto @@ -16,12 +16,12 @@ syntax = "proto3"; package google.api; -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; option java_outer_classname = "HttpProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; // Defines the HTTP configuration for an API service. It contains a list of // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method diff --git a/third_party/proto/google/api/httpbody.proto b/third_party/proto/google/api/httpbody.proto index 596ba357..e0f2c293 100644 --- a/third_party/proto/google/api/httpbody.proto +++ b/third_party/proto/google/api/httpbody.proto @@ -18,12 +18,12 @@ package google.api; import "google/protobuf/any.proto"; -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; -option java_multiple_files = true; +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; +option java_multiple_files = true; option java_outer_classname = "HttpBodyProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; // Message that represents an arbitrary HTTP body. It should only be used for // payload formats that can't be represented as JSON, such as raw binary or diff --git a/third_party/proto/google/protobuf/any.proto b/third_party/proto/google/protobuf/any.proto index 6ed8a23c..cc1e5a38 100644 --- a/third_party/proto/google/protobuf/any.proto +++ b/third_party/proto/google/protobuf/any.proto @@ -32,12 +32,12 @@ syntax = "proto3"; package google.protobuf; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/anypb"; -option java_package = "com.google.protobuf"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/anypb"; +option java_package = "com.google.protobuf"; option java_outer_classname = "AnyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. diff --git a/third_party/proto/tendermint/abci/types.proto b/third_party/proto/tendermint/abci/types.proto index 2cbcabb2..d41a5226 100644 --- a/third_party/proto/tendermint/abci/types.proto +++ b/third_party/proto/tendermint/abci/types.proto @@ -58,13 +58,12 @@ message RequestSetOption { } message RequestInitChain { - google.protobuf.Timestamp time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - string chain_id = 2; - ConsensusParams consensus_params = 3; - repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; - bytes app_state_bytes = 5; - int64 initial_height = 6; + google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + string chain_id = 2; + ConsensusParams consensus_params = 3; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; + bytes app_state_bytes = 5; + int64 initial_height = 6; } message RequestQuery { @@ -102,13 +101,12 @@ message RequestEndBlock { message RequestCommit {} // lists available snapshots -message RequestListSnapshots { -} +message RequestListSnapshots {} // offers a snapshot to the application message RequestOfferSnapshot { - Snapshot snapshot = 1; // snapshot offered by peers - bytes app_hash = 2; // light client-verified app hash for snapshot height + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height } // loads a snapshot chunk @@ -187,8 +185,8 @@ message ResponseInitChain { message ResponseQuery { uint32 code = 1; // bytes data = 2; // use "value" instead. - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 index = 5; bytes key = 6; bytes value = 7; @@ -198,40 +196,35 @@ message ResponseQuery { } message ResponseBeginBlock { - repeated Event events = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; } message ResponseCheckTx { uint32 code = 1; bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 gas_wanted = 5 [json_name = "gas_wanted"]; int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; - string codespace = 8; + repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; } message ResponseDeliverTx { uint32 code = 1; bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 gas_wanted = 5 [json_name = "gas_wanted"]; int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; - string codespace = 8; + repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; } message ResponseEndBlock { - repeated ValidatorUpdate validator_updates = 1 - [(gogoproto.nullable) = false]; - ConsensusParams consensus_param_updates = 2; - repeated Event events = 3 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false]; + ConsensusParams consensus_param_updates = 2; + repeated Event events = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; } message ResponseCommit { @@ -248,12 +241,12 @@ message ResponseOfferSnapshot { Result result = 1; enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Snapshot accepted, apply chunks - ABORT = 2; // Abort all snapshot restoration - REJECT = 3; // Reject this specific snapshot, try others - REJECT_FORMAT = 4; // Reject all snapshots of this format, try others - REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Snapshot accepted, apply chunks + ABORT = 2; // Abort all snapshot restoration + REJECT = 3; // Reject this specific snapshot, try others + REJECT_FORMAT = 4; // Reject all snapshots of this format, try others + REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others } } @@ -263,16 +256,16 @@ message ResponseLoadSnapshotChunk { message ResponseApplySnapshotChunk { Result result = 1; - repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply - repeated string reject_senders = 3; // Chunk senders to reject and ban + repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply + repeated string reject_senders = 3; // Chunk senders to reject and ban enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Chunk successfully accepted - ABORT = 2; // Abort all snapshot restoration - RETRY = 3; // Retry chunk (combine with refetch and reject) - RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) - REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others } } @@ -306,17 +299,14 @@ message LastCommitInfo { // Later, transactions may be queried using these events. message Event { string type = 1; - repeated EventAttribute attributes = 2 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "attributes,omitempty" - ]; + repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"]; } // EventAttribute is a single key-value pair, associated with an event. message EventAttribute { bytes key = 1; bytes value = 2; - bool index = 3; // nondeterministic + bool index = 3; // nondeterministic } // TxResult contains results of executing the transaction. @@ -334,9 +324,9 @@ message TxResult { // Validator message Validator { - bytes address = 1; // The first 20 bytes of SHA256(public key) + bytes address = 1; // The first 20 bytes of SHA256(public key) // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - int64 power = 3; // The voting power + int64 power = 3; // The voting power } // ValidatorUpdate @@ -364,10 +354,7 @@ message Evidence { // The height when the offense occurred int64 height = 3; // The corresponding time where the offense occurred - google.protobuf.Timestamp time = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdtime) = true - ]; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // Total voting power of the validator set in case the ABCI application does // not store historical validators. // https://github.com/tendermint/tendermint/issues/4581 @@ -378,11 +365,11 @@ message Evidence { // State Sync Types message Snapshot { - uint64 height = 1; // The height at which the snapshot was taken - uint32 format = 2; // The application-specific snapshot format - uint32 chunks = 3; // Number of chunks in the snapshot - bytes hash = 4; // Arbitrary snapshot hash, equal only if identical - bytes metadata = 5; // Arbitrary application metadata + uint64 height = 1; // The height at which the snapshot was taken + uint32 format = 2; // The application-specific snapshot format + uint32 chunks = 3; // Number of chunks in the snapshot + bytes hash = 4; // Arbitrary snapshot hash, equal only if identical + bytes metadata = 5; // Arbitrary application metadata } //---------------------------------------- diff --git a/third_party/proto/tendermint/types/evidence.proto b/third_party/proto/tendermint/types/evidence.proto index 3b234571..d9548a43 100644 --- a/third_party/proto/tendermint/types/evidence.proto +++ b/third_party/proto/tendermint/types/evidence.proto @@ -17,19 +17,19 @@ message Evidence { // DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. message DuplicateVoteEvidence { - tendermint.types.Vote vote_a = 1; - tendermint.types.Vote vote_b = 2; - int64 total_voting_power = 3; - int64 validator_power = 4; - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + tendermint.types.Vote vote_a = 1; + tendermint.types.Vote vote_b = 2; + int64 total_voting_power = 3; + int64 validator_power = 4; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } // LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. message LightClientAttackEvidence { - tendermint.types.LightBlock conflicting_block = 1; - int64 common_height = 2; + tendermint.types.LightBlock conflicting_block = 1; + int64 common_height = 2; repeated tendermint.types.Validator byzantine_validators = 3; - int64 total_voting_power = 4; + int64 total_voting_power = 4; google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } diff --git a/third_party/proto/tendermint/types/params.proto b/third_party/proto/tendermint/types/params.proto index 0de7d846..70789222 100644 --- a/third_party/proto/tendermint/types/params.proto +++ b/third_party/proto/tendermint/types/params.proto @@ -45,8 +45,7 @@ message EvidenceParams { // It should correspond with an app's "unbonding period" or other similar // mechanism for handling [Nothing-At-Stake // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - google.protobuf.Duration max_age_duration = 2 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // This sets the maximum size of total evidence in bytes that can be committed in a single block. // and should fall comfortably under the max block bytes. diff --git a/third_party/proto/tendermint/types/types.proto b/third_party/proto/tendermint/types/types.proto index 7f7ea74c..57efc33c 100644 --- a/third_party/proto/tendermint/types/types.proto +++ b/third_party/proto/tendermint/types/types.proto @@ -66,19 +66,19 @@ message Header { BlockID last_block_id = 5 [(gogoproto.nullable) = false]; // hashes of block data - bytes last_commit_hash = 6; // commit from validators from the last block - bytes data_hash = 7; // transactions + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions // hashes from the app output from the prev block - bytes validators_hash = 8; // validators for the current block - bytes next_validators_hash = 9; // validators for the next block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block // consensus info - bytes evidence_hash = 13; // evidence included in the block - bytes proposer_address = 14; // original proposer of the block + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block } // Data contains the set of transactions included in the block @@ -95,30 +95,27 @@ message Vote { SignedMsgType type = 1; int64 height = 2; int32 round = 3; - BlockID block_id = 4 - [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. - google.protobuf.Timestamp timestamp = 5 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes validator_address = 6; - int32 validator_index = 7; - bytes signature = 8; + BlockID block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes validator_address = 6; + int32 validator_index = 7; + bytes signature = 8; } // Commit contains the evidence that a block was committed by a set of validators. message Commit { - int64 height = 1; - int32 round = 2; - BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; - repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; + int64 height = 1; + int32 round = 2; + BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; } // CommitSig is a part of the Vote included in a Commit. message CommitSig { BlockIDFlag block_id_flag = 1; bytes validator_address = 2; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 4; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; } message Proposal { @@ -127,9 +124,8 @@ message Proposal { int32 round = 3; int32 pol_round = 4; BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 6 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 7; + google.protobuf.Timestamp timestamp = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 7; } message SignedHeader { diff --git a/x/auction/client/cli/query.go b/x/auction/client/cli/query.go index 61412ccd..9877ffc4 100644 --- a/x/auction/client/cli/query.go +++ b/x/auction/client/cli/query.go @@ -2,10 +2,10 @@ package cli import ( "fmt" - "strconv" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/peggyjv/sommelier/v7/x/auction/types" "github.com/spf13/cobra" ) @@ -77,14 +77,14 @@ func queryActiveAuction() *cobra.Command { return err } - auctionID, err := strconv.ParseUint(args[0], 10, 32) + auctionID, err := sdk.ParseUint(args[0]) if err != nil { return err } queryClient := types.NewQueryClient(ctx) req := &types.QueryActiveAuctionRequest{ - AuctionId: uint32(auctionID), + AuctionId: uint32(auctionID.Uint64()), } res, err := queryClient.QueryActiveAuction(cmd.Context(), req) @@ -113,14 +113,14 @@ func queryEndedAuction() *cobra.Command { return err } - auctionID, err := strconv.ParseUint(args[0], 10, 32) + auctionID, err := sdk.ParseUint(args[0]) if err != nil { return err } queryClient := types.NewQueryClient(ctx) req := &types.QueryEndedAuctionRequest{ - AuctionId: uint32(auctionID), + AuctionId: uint32(auctionID.Uint64()), } res, err := queryClient.QueryEndedAuction(cmd.Context(), req) @@ -285,20 +285,20 @@ func queryBid() *cobra.Command { return err } - auctionID, err := strconv.ParseUint(args[0], 10, 32) + auctionID, err := sdk.ParseUint(args[0]) if err != nil { return err } - bidID, err := strconv.ParseUint(args[1], 10, 64) + bidID, err := sdk.ParseUint(args[0]) if err != nil { return err } queryClient := types.NewQueryClient(ctx) req := &types.QueryBidRequest{ - AuctionId: uint32(auctionID), - BidId: bidID, + AuctionId: uint32(auctionID.Uint64()), + BidId: bidID.Uint64(), } res, err := queryClient.QueryBid(cmd.Context(), req) @@ -327,14 +327,14 @@ func queryBidsByAuction() *cobra.Command { return err } - auctionID, err := strconv.ParseUint(args[0], 10, 32) + auctionID, err := sdk.ParseUint(args[0]) if err != nil { return err } queryClient := types.NewQueryClient(ctx) req := &types.QueryBidsByAuctionRequest{ - AuctionId: uint32(auctionID), + AuctionId: uint32(auctionID.Uint64()), } res, err := queryClient.QueryBidsByAuction(cmd.Context(), req) diff --git a/x/auction/client/cli/query_test.go b/x/auction/client/cli/query_test.go index 59340646..365c0bcf 100644 --- a/x/auction/client/cli/query_test.go +++ b/x/auction/client/cli/query_test.go @@ -50,20 +50,6 @@ func TestQueryActiveAuction(t *testing.T) { }, err: sdkerrors.New("", uint32(1), "accepts 1 arg(s), received 2"), }, - { - name: "Auction ID overflow", - args: []string{ - "4294967296", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"4294967296\": value out of range"), - }, - { - name: "Auction ID invalid type", - args: []string{ - "one hundred and twenty", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"one hundred and twenty\": invalid syntax"), - }, } for _, tc := range testCases { @@ -94,20 +80,6 @@ func TestQueryEndedAuction(t *testing.T) { }, err: sdkerrors.New("", uint32(1), "accepts 1 arg(s), received 2"), }, - { - name: "Auction ID invalid type", - args: []string{ - "one hundred and twenty", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"one hundred and twenty\": invalid syntax"), - }, - { - name: "Auction ID overflow", - args: []string{ - "4294967296", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"4294967296\": value out of range"), - }, } for _, tc := range testCases { @@ -249,38 +221,6 @@ func TestQueryBids(t *testing.T) { }, err: sdkerrors.New("", uint32(1), "accepts 2 arg(s), received 3"), }, - { - name: "Auction ID overflow", - args: []string{ - "4294967296", - "2", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"4294967296\": value out of range"), - }, - { - name: "Bid ID overflow", - args: []string{ - "1", - "18446744073709551616", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"18446744073709551616\": value out of range"), - }, - { - name: "Auction ID invalid type", - args: []string{ - "one hundred and twenty", - "2", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"one hundred and twenty\": invalid syntax"), - }, - { - name: "Bid ID invalid type", - args: []string{ - "1", - "four", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"four\": invalid syntax"), - }, } for _, tc := range testCases { @@ -311,20 +251,6 @@ func TestQueryBidByAuction(t *testing.T) { }, err: sdkerrors.New("", uint32(1), "accepts 1 arg(s), received 2"), }, - { - name: "Auction ID overflow", - args: []string{ - "4294967296", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"4294967296\": value out of range"), - }, - { - name: "Auction ID invalid type", - args: []string{ - "one hundred and twenty", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"one hundred and twenty\": invalid syntax"), - }, } for _, tc := range testCases { diff --git a/x/auction/client/cli/tx.go b/x/auction/client/cli/tx.go index b86d9e3d..e0e44b4e 100644 --- a/x/auction/client/cli/tx.go +++ b/x/auction/client/cli/tx.go @@ -3,7 +3,6 @@ package cli import ( "fmt" "io/ioutil" - "strconv" "strings" "github.com/cosmos/cosmos-sdk/client" @@ -120,7 +119,7 @@ $ %s tx auction submit-bid 1 10000usomm 50000gravity0xdac17f958d2ee523a220620699 return err } - auctionID, err := strconv.ParseUint(args[0], 10, 32) + auctionID, err := sdk.ParseUint(args[0]) if err != nil { return err } @@ -140,7 +139,7 @@ $ %s tx auction submit-bid 1 10000usomm 50000gravity0xdac17f958d2ee523a220620699 return fmt.Errorf("must include `--from` flag") } - msg, err := types.NewMsgSubmitBidRequest(uint32(auctionID), maxBidInUsomm, saleTokenMinimumAmount, bidder) + msg, err := types.NewMsgSubmitBidRequest(uint32(auctionID.Uint64()), maxBidInUsomm, saleTokenMinimumAmount, bidder) if err != nil { return err } diff --git a/x/auction/client/cli/tx_test.go b/x/auction/client/cli/tx_test.go index a966bc4e..624a027b 100644 --- a/x/auction/client/cli/tx_test.go +++ b/x/auction/client/cli/tx_test.go @@ -78,24 +78,6 @@ func TestSubmitBid(t *testing.T) { }, err: sdkerrors.New("", uint32(1), "must include `--from` flag"), }, - { - name: "Auction ID overflow", - args: []string{ - "4294967296", - "10000usomm", - "50000gravity0xdac17f958d2ee523a2206206994597c13d831ec7", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"4294967296\": value out of range"), - }, - { - name: "Auction ID invalid type", - args: []string{ - "one hundred and twenty", - "10000usomm", - "50000gravity0xdac17f958d2ee523a2206206994597c13d831ec7", - }, - err: sdkerrors.New("", uint32(1), "strconv.ParseUint: parsing \"one hundred and twenty\": invalid syntax"), - }, { name: "Invalid bid", args: []string{ diff --git a/x/axelarcork/client/cli/query.go b/x/axelarcork/client/cli/query.go new file mode 100644 index 00000000..0b1efbf5 --- /dev/null +++ b/x/axelarcork/client/cli/query.go @@ -0,0 +1,463 @@ +package cli + +import ( + "strconv" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + "github.com/spf13/cobra" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd() *cobra.Command { + corkQueryCmd := &cobra.Command{ + Use: "axelarcork", + Short: "Querying commands for the axelar cork module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + corkQueryCmd.AddCommand([]*cobra.Command{ + queryParams(), + queryScheduledCorks(), + queryCellarIDs(), + queryCellarIDsByChainID(), + queryScheduledBlockHeights(), + queryScheduledCorksByBlockHeight(), + queryScheduledCorksByID(), + queryCorkResult(), + queryCorkResults(), + queryChainConfigurations(), + queryAxelarContractCallNonces(), + queryAxelayProxyUpgradeData(), + }...) + + return corkQueryCmd + +} + +func queryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "parameters", + Aliases: []string{"params"}, + Args: cobra.NoArgs, + Short: "query cork params from the chain", + RunE: func(cmd *cobra.Command, _ []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + req := &types.QueryParamsRequest{} + + res, err := queryClient.QueryParams(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryCellarIDs() *cobra.Command { + cmd := &cobra.Command{ + Use: "cellar-ids", + Aliases: []string{"cids"}, + Args: cobra.NoArgs, + Short: "query all managed cellar ids from all chains", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + req := &types.QueryCellarIDsRequest{} + + queryClient := types.NewQueryClient(ctx) + + res, err := queryClient.QueryCellarIDs(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryCellarIDsByChainID() *cobra.Command { + cmd := &cobra.Command{ + Use: "cellar-ids-by-chain-id [chain-id]", + Args: cobra.ExactArgs(1), + Short: "query managed cellar ids from the chain", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + chainID, err := sdk.ParseUint(args[0]) + if err != nil { + return err + } + + req := &types.QueryCellarIDsByChainIDRequest{ + ChainId: chainID.Uint64(), + } + + queryClient := types.NewQueryClient(ctx) + + res, err := queryClient.QueryCellarIDsByChainID(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryScheduledCorks() *cobra.Command { + cmd := &cobra.Command{ + Use: "scheduled-corks [chain-id]", + Aliases: []string{"scs"}, + Args: cobra.ExactArgs(1), + Short: "query scheduled corks from the chain", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + + chainID, err := sdk.ParseUint(args[0]) + if err != nil { + return err + } + + req := &types.QueryScheduledCorksRequest{ + ChainId: chainID.Uint64(), + } + + res, err := queryClient.QueryScheduledCorks(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryScheduledCorksByBlockHeight() *cobra.Command { + cmd := &cobra.Command{ + Use: "scheduled-corks-by-block-height [chain-id]", + Aliases: []string{"scbbh"}, + Args: cobra.ExactArgs(1), + Short: "query scheduled corks from the chain by block height", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + height, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + chainID, err := sdk.ParseUint(args[0]) + if err != nil { + return err + } + + req := &types.QueryScheduledCorksByBlockHeightRequest{ + BlockHeight: uint64(height), + ChainId: chainID.Uint64(), + } + + res, err := queryClient.QueryScheduledCorksByBlockHeight(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryScheduledBlockHeights() *cobra.Command { + cmd := &cobra.Command{ + Use: "scheduled-block-heights [chain-id]", + Aliases: []string{"scbhs"}, + Args: cobra.ExactArgs(1), + Short: "query scheduled cork block heights from the chain", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + chainID, err := sdk.ParseUint(args[0]) + if err != nil { + return err + } + + req := &types.QueryScheduledBlockHeightsRequest{ + ChainId: chainID.Uint64(), + } + + res, err := queryClient.QueryScheduledBlockHeights(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryScheduledCorksByID() *cobra.Command { + cmd := &cobra.Command{ + Use: "scheduled-corks-by-id [chain-id]", + Aliases: []string{"scbi"}, + Args: cobra.ExactArgs(1), + Short: "query scheduled corks by their cork ID", + Long: "query scheduled corks by their cork ID, which is the keccak256 hash of the block height, target contract address, and encoded contract call concatenated", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + id := args[0] + // the length of a keccak256 hash string + if len(id) != 64 { + return sdkerrors.New("", uint32(1), "invalid ID length, must be a keccak256 hash") + } + + queryClient := types.NewQueryClient(ctx) + chainID, err := sdk.ParseUint(args[0]) + if err != nil { + return err + } + + req := &types.QueryScheduledCorksByIDRequest{ + Id: id, + ChainId: chainID.Uint64(), + } + res, err := queryClient.QueryScheduledCorksByID(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryCorkResult() *cobra.Command { + cmd := &cobra.Command{ + Use: "cork-result [chain-id] [cork-id]", + Aliases: []string{"cr"}, + Args: cobra.ExactArgs(2), + Short: "query cork result from the chain", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + corkID := args[0] + // the length of a keccak256 hash string + if len(corkID) != 64 { + return sdkerrors.New("", uint32(1), "invalid ID length, must be a keccak256 hash") + } + + queryClient := types.NewQueryClient(ctx) + chainID, err := sdk.ParseUint(args[1]) + if err != nil { + return err + } + + req := &types.QueryCorkResultRequest{ + Id: corkID, + ChainId: chainID.Uint64(), + } + + res, err := queryClient.QueryCorkResult(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryCorkResults() *cobra.Command { + cmd := &cobra.Command{ + Use: "cork-results [chain-id]", + Aliases: []string{"crs"}, + Args: cobra.ExactArgs(1), + Short: "query cork results from the chain", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + chainID, err := sdk.ParseUint(args[0]) + if err != nil { + return err + } + + req := &types.QueryCorkResultsRequest{ + ChainId: chainID.Uint64(), + } + + res, err := queryClient.QueryCorkResults(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryChainConfigurations() *cobra.Command { + cmd := &cobra.Command{ + Use: "chain-configurations", + Aliases: []string{"cfgs"}, + Args: cobra.NoArgs, + Short: "query axelar chain configurations", + RunE: func(cmd *cobra.Command, _ []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + req := &types.QueryChainConfigurationsRequest{} + + res, err := queryClient.QueryChainConfigurations(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryAxelarContractCallNonces() *cobra.Command { + cmd := &cobra.Command{ + Use: "axelar-contract-call-nonces", + Aliases: []string{"accn"}, + Args: cobra.NoArgs, + Short: "query axelar contract call nonces from the chain", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + + req := &types.QueryAxelarContractCallNoncesRequest{} + + res, err := queryClient.QueryAxelarContractCallNonces(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func queryAxelayProxyUpgradeData() *cobra.Command { + cmd := &cobra.Command{ + Use: "axelar-proxy-upgrade-data", + Aliases: []string{"apud"}, + Args: cobra.NoArgs, + Short: "query axelar proxy upgrade data from the chain", + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + + req := &types.QueryAxelarProxyUpgradeDataRequest{} + + res, err := queryClient.QueryAxelarProxyUpgradeData(cmd.Context(), req) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/axelarcork/client/cli/query_test.go b/x/axelarcork/client/cli/query_test.go new file mode 100644 index 00000000..e0d549bb --- /dev/null +++ b/x/axelarcork/client/cli/query_test.go @@ -0,0 +1,81 @@ +package cli + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestQueryScheduledCorksByBlockHeightCmd(t *testing.T) { + testCases := []struct { + name string + args []string + err error + }{ + { + name: "Block height overflow", + args: []string{ + "18446744073709551616", + }, + err: sdkerrors.New("", uint32(1), "strconv.Atoi: parsing \"18446744073709551616\": value out of range"), + }, + } + + for _, tc := range testCases { + cmd := *queryScheduledCorksByBlockHeight() + cmd.SetArgs(tc.args) + err := cmd.Execute() + + require.Equal(t, tc.err.Error(), err.Error()) + } +} + +func TestQueryScheduledCorksByIDCmd(t *testing.T) { + testCases := []struct { + name string + args []string + err error + }{ + { + name: "Invalid ID", + args: []string{ + "bad", + }, + err: sdkerrors.New("", uint32(1), "invalid ID length, must be a keccak256 hash"), + }, + } + + for _, tc := range testCases { + cmd := *queryScheduledCorksByID() + cmd.SetArgs(tc.args) + err := cmd.Execute() + + require.Equal(t, tc.err.Error(), err.Error()) + } +} + +func TestQueryCorkResultCmd(t *testing.T) { + testCases := []struct { + name string + args []string + err error + }{ + { + name: "Invalid ID", + args: []string{ + "1", + "bad", + }, + err: sdkerrors.New("", uint32(1), "invalid ID length, must be a keccak256 hash"), + }, + } + + for _, tc := range testCases { + cmd := *queryCorkResult() + cmd.SetArgs(tc.args) + err := cmd.Execute() + + require.Equal(t, tc.err.Error(), err.Error()) + } +} diff --git a/x/axelarcork/client/cli/tx.go b/x/axelarcork/client/cli/tx.go new file mode 100644 index 00000000..75542ad3 --- /dev/null +++ b/x/axelarcork/client/cli/tx.go @@ -0,0 +1,815 @@ +package cli + +import ( + "fmt" + "os" + "strings" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/ethereum/go-ethereum/common" + types "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + "github.com/spf13/cobra" +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + corkTxCmd := &cobra.Command{ + Use: "axelar-cork", + Short: "AxelarCork transaction subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + corkTxCmd.AddCommand( + CmdScheduleAxelarCork(), + CmdRelayAxelarCork(), + CmdBumpAxelarCorkGas(), + CmdRelayAxelarProxyUpgrade()) + + return corkTxCmd +} + +////////////// +// Commands // +////////////// + +func CmdScheduleAxelarCork() *cobra.Command { + cmd := &cobra.Command{ + Use: "schedule-axelar-cork [chain-id] [contract-address] [block-height] [contract-call]", + Args: cobra.ExactArgs(4), + Short: "Schedule an Axelar cork", + + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + from := clientCtx.GetFromAddress() + + chainID, err := sdk.ParseUint(args[0]) + if err != nil { + return err + } + + contractAddr := args[1] + if !common.IsHexAddress(contractAddr) { + return fmt.Errorf("contract address %s is invalid", contractAddr) + } + + blockHeight, err := sdk.ParseUint(args[2]) + if err != nil { + return err + } + + contractCallBz := []byte(args[3]) // todo: how are contract calls submitted? + + scheduleCorkMsg := types.MsgScheduleAxelarCorkRequest{ + Cork: &types.AxelarCork{ + EncodedContractCall: contractCallBz, + ChainId: chainID.Uint64(), + TargetContractAddress: contractAddr, + }, + ChainId: chainID.Uint64(), + BlockHeight: blockHeight.Uint64(), + Signer: from.String(), + } + if err := scheduleCorkMsg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &scheduleCorkMsg) + + }, + } + + return cmd +} + +func CmdRelayAxelarCork() *cobra.Command { + cmd := &cobra.Command{ + Use: "relay-axelar-cork [chain-id] [contract-address] [token] [fee]", + Args: cobra.ExactArgs(4), + Short: "Relay a consensus validated Axelar cork", + + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + from := clientCtx.GetFromAddress() + + chainID, err := sdk.ParseUint(args[0]) + if err != nil { + return err + } + + contractAddr := args[1] + if !common.IsHexAddress(contractAddr) { + return fmt.Errorf("contract address %s is invalid", contractAddr) + } + + token, err := sdk.ParseCoinNormalized(args[2]) + if err != nil { + return err + } + + fee, err := sdk.ParseUint(args[3]) + if err != nil { + return err + } + + relayCorkMsg := types.MsgRelayAxelarCorkRequest{ + Signer: from.String(), + Token: token, + Fee: fee.Uint64(), + ChainId: chainID.Uint64(), + TargetContractAddress: contractAddr, + } + if err := relayCorkMsg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &relayCorkMsg) + + }, + } + + return cmd +} + +func CmdRelayAxelarProxyUpgrade() *cobra.Command { + cmd := &cobra.Command{ + Use: "relay-axelar-proxy-upgrade [chain-id] [token] [fee]", + Args: cobra.ExactArgs(4), + Short: "Relay a proxy contract upgrade call", + + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + from := clientCtx.GetFromAddress() + + chainID, err := sdk.ParseUint(args[0]) + if err != nil { + return err + } + + token, err := sdk.ParseCoinNormalized(args[2]) + if err != nil { + return err + } + + fee, err := sdk.ParseUint(args[3]) + if err != nil { + return err + } + + relayProxyUpgradeMsg := types.MsgRelayAxelarProxyUpgradeRequest{ + Signer: from.String(), + Token: token, + Fee: fee.Uint64(), + ChainId: chainID.Uint64(), + } + if err := relayProxyUpgradeMsg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &relayProxyUpgradeMsg) + + }, + } + + return cmd +} + +func CmdBumpAxelarCorkGas() *cobra.Command { + cmd := &cobra.Command{ + Use: "bump-axelar-cork [token] [message-id]", + Args: cobra.ExactArgs(2), + Short: "Add gas for an Axelar cork that is stuck relaying", + + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + from := clientCtx.GetFromAddress() + + token, err := sdk.ParseCoinNormalized(args[0]) + if err != nil { + return err + } + + messageID := args[1] + + bumpAxelarCorkGasMsg := types.MsgBumpAxelarCorkGasRequest{ + Signer: from.String(), + Token: token, + MessageId: messageID, + } + if err := bumpAxelarCorkGasMsg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &bumpAxelarCorkGasMsg) + + }, + } + + return cmd +} + +/////////////// +// Proposals // +/////////////// + +// GetCmdSubmitAddCellarIDProposal implements the command to submit a cellar id addition proposal +func GetCmdSubmitAddCellarIDProposal() *cobra.Command { + + cmd := &cobra.Command{ + Use: "add-cellar-id [proposal-file]", + Args: cobra.ExactArgs(1), + Short: "Submit a cellar id addition proposal", + Long: strings.TrimSpace( + fmt.Sprintf(`Submit a cellar addition proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. + +Example: +$ %s tx gov submit-proposal add-cellar-id --from= + +Where proposal.json contains: + +{ + "title": "Dollary-doos LP Cellar Proposal", + "description": "I have a hunch", + "cellar_ids": ["0x123801a7D398351b8bE11C439e05C5B3259aeC9B", "0x456801a7D398351b8bE11C439e05C5B3259aeC9B"], + "deposit": "10000usomm" +} +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal := types.AddAxelarManagedCellarIDsProposalWithDeposit{} + contents, err := os.ReadFile(args[0]) + if err != nil { + return err + } + + if err = clientCtx.Codec.UnmarshalJSON(contents, &proposal); err != nil { + return err + } + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + for _, id := range proposal.CellarIds.Ids { + if !common.IsHexAddress(id) { + return fmt.Errorf("%s is not a valid ethereum address", id) + } + } + + content := types.NewAddManagedCellarIDsProposal( + proposal.Title, + proposal.Description, + proposal.ChainId, + &types.CellarIDSet{Ids: proposal.CellarIds.Ids}) + + from := clientCtx.GetFromAddress() + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + return cmd +} + +// GetCmdSubmitRemoveCellarIDProposal implements the command to submit a cellar id removal proposal +func GetCmdSubmitRemoveCellarIDProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "remove-cellar-id [proposal-file]", + Args: cobra.ExactArgs(1), + Short: "Submit a cellar id removal proposal", + Long: strings.TrimSpace( + fmt.Sprintf(`Submit a cellar removal proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. + +Example: +$ %s tx gov submit-proposal remove-cellar-id --from= + +Where proposal.json contains: + +{ + "title": "Dollary-doos LP Cellar Removal Proposal", + "description": "I don't trust them", + "cellar_ids": ["0x123801a7D398351b8bE11C439e05C5B3259aeC9B", "0x456801a7D398351b8bE11C439e05C5B3259aeC9B"], + "deposit": "10000usomm" +} +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal := types.RemoveAxelarManagedCellarIDsProposalWithDeposit{} + contents, err := os.ReadFile(args[0]) + if err != nil { + return err + } + + if err = clientCtx.Codec.UnmarshalJSON(contents, &proposal); err != nil { + return err + } + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + for _, id := range proposal.CellarIds.Ids { + if !common.IsHexAddress(id) { + return fmt.Errorf("%s is not a valid ethereum address", id) + } + } + + content := types.NewRemoveManagedCellarIDsProposal( + proposal.Title, + proposal.Description, + proposal.ChainId, + &types.CellarIDSet{Ids: proposal.CellarIds.Ids}) + + from := clientCtx.GetFromAddress() + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + return cmd +} + +// GetCmdSubmitScheduledAxelarCorkProposal implements the command to submit scheduled cork proposal +func GetCmdSubmitScheduledAxelarCorkProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "schedule-axelar-cork [proposal-file]", + Args: cobra.ExactArgs(1), + Short: "Submit a scheduled cork proposal", + Long: strings.TrimSpace( + fmt.Sprintf(`Submit a scheduled cork proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. + +Example: +$ %s tx gov submit-proposal schedule-cork --from= + +Where proposal.json contains: + +{ + "title": "Dollary-doos LP Scheduled AxelarCork Proposal", + "description": "I trust them, approve cork", + "block_height": 100000, + "target_contract_address": "0x123801a7D398351b8bE11C439e05C5B3259aeC9B", + "contract_call_proto_json": "{\"cellar_id\":\"0x123801a7D398351b8bE11C439e05C5B3259aeC9B\",\"\":{\"some_fuction\":{\"function_args\":{}},\"block_height\":12345}}", + "deposit": "10000usomm" +} + +The contract_call_proto_json field must be the JSON representation of a ScheduleRequest, which is defined in Steward's protos. For more information, see the Steward API docs at https://github.com/peggyjv/steward. +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal := types.AxelarScheduledCorkProposalWithDeposit{} + contents, err := os.ReadFile(args[0]) + if err != nil { + return err + } + + if err = clientCtx.Codec.UnmarshalJSON(contents, &proposal); err != nil { + return err + } + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + if !common.IsHexAddress(proposal.TargetContractAddress) { + return fmt.Errorf("%s is not a valid contract address", proposal.TargetContractAddress) + } + + content := types.NewAxelarScheduledCorkProposal( + proposal.Title, + proposal.Description, + proposal.BlockHeight, + proposal.ChainId, + proposal.TargetContractAddress, + proposal.ContractCallProtoJson, + ) + if err := content.ValidateBasic(); err != nil { + return err + } + from := clientCtx.GetFromAddress() + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + return cmd +} + +func CmdSubmitAxelarCommunityPoolEthereumSpendProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "axelar-community-pool-spend [proposal-file]", + Args: cobra.ExactArgs(2), + Short: "Submit a community pool spend proposal", + Long: strings.TrimSpace( + fmt.Sprintf(`Submit a community pool spend proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. The funds from the community pool +will be bridged to the target EVM via Axelar to the supplied recipient address. Only one denomination +of Cosmos token can be sent. Fees will be removed from the balance by Axelar automatically. + +Example: +$ %s tx gov submit-proposal community-pool-spend --from= + +Where proposal.json contains: + +{ + "title": "Community Pool Ethereum Spend", + "description": "Bridge me some tokens to Ethereum!", + "recipient": "0x0000000000000000000000000000000000000000", + "chain_name": "Avalanche", + "amount": "20000stake", + "deposit": "1000stake" +} +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal, err := ParseCommunityPoolSpendProposal(clientCtx.Codec, args[0]) + if err != nil { + return err + } + + if len(proposal.Title) == 0 { + return fmt.Errorf("title is empty") + } + + if len(proposal.Description) == 0 { + return fmt.Errorf("description is empty") + } + + if !common.IsHexAddress(proposal.Recipient) { + return fmt.Errorf("recipient is not a valid Ethereum address") + } + + amount, err := sdk.ParseCoinNormalized(proposal.Amount) + if err != nil { + return err + } + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + from := clientCtx.GetFromAddress() + + content := types.NewAxelarCommunitySpendProposal( + proposal.Title, + proposal.Description, + proposal.Recipient, + proposal.ChainId, + amount, + ) + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + return cmd +} + +// GetCmdSubmitAddChainConfigurationProposal implements the command to submit a cellar id addition proposal +func GetCmdSubmitAddChainConfigurationProposal() *cobra.Command { + + cmd := &cobra.Command{ + Use: "add-chain-config [proposal-file]", + Args: cobra.ExactArgs(1), + Short: "Submit a chain configuration addition proposal", + Long: strings.TrimSpace( + fmt.Sprintf(`Submit a chain configuration addition proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. + +Example: +$ %s tx gov submit-proposal add-chain-config --from= + +Where proposal.json contains: + +{ + "title": "Enable Fake EVM proposal", + "description": "Fake it 'til you make it'", + "chain_congifuration": { + "name": "FakeEVM", + "id": 1000, + "vote_threshold": "0.333", + "proxy_address": "0x1234..." + }, + "deposit": "10000usomm" +} +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal := types.AddChainConfigurationProposalWithDeposit{} + contents, err := os.ReadFile(args[0]) + if err != nil { + return err + } + + if err = clientCtx.Codec.UnmarshalJSON(contents, &proposal); err != nil { + return err + } + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + if err := proposal.ChainConfiguration.ValidateBasic(); err != nil { + return err + } + + content := types.NewAddChainConfigurationProposal( + proposal.Title, + proposal.Description, + *proposal.ChainConfiguration, + ) + + from := clientCtx.GetFromAddress() + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + return cmd +} + +// GetCmdSubmitRemoveChainConfigurationProposal implements the command to submit a chain configuration removal proposal +func GetCmdSubmitRemoveChainConfigurationProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "remove-chain-configuration [proposal-file]", + Args: cobra.ExactArgs(1), + Short: "Submit a chain configuration removal proposal", + Long: strings.TrimSpace( + fmt.Sprintf(`Submit a chain configuration removal proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. + +Example: +$ %s tx gov submit-proposal remove-chain-configuration --from= + +Where proposal.json contains: + +{ + "title": "Dollary-doos LP Cellar Removal Proposal", + "description": "I don't trust them", + "chain_id": 1000, + "deposit": "10000usomm" +} +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal := types.RemoveChainConfigurationProposalWithDeposit{} + contents, err := os.ReadFile(args[0]) + if err != nil { + return err + } + + if err = clientCtx.Codec.UnmarshalJSON(contents, &proposal); err != nil { + return err + } + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + if proposal.ChainId == 0 { + return fmt.Errorf("chain ID cannot be zero") + } + + content := types.NewRemoveChainConfigurationProposal( + proposal.Title, + proposal.Description, + proposal.ChainId) + + from := clientCtx.GetFromAddress() + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + return cmd +} + +func GetCmdSubmitUpgradeAxelarProxyContractProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "upgrade-axelar-proxy-contract [proposal-file]", + Args: cobra.ExactArgs(1), + Short: "Submit an upgrade axelar proxy contract proposal", + Long: strings.TrimSpace( + fmt.Sprintf(`Submit an Axelar proxy contract upgrade proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. + +Example: +$ %s tx gov submit-proposal upgrade-axelar-proxy-contract --from= + +Where proposal.json contains: + +{ + "title": "Upgrade Axelar Proxy Contract Proposal", + "description": "New features", + "chain_id": 1000, + "new_proxy_address": "0x1234567890123456789012345678901234567890", + "deposit": "10000usomm" +} +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal := types.UpgradeAxelarProxyContractProposalWithDeposit{} + contents, err := os.ReadFile(args[0]) + if err != nil { + return err + } + + if err = clientCtx.Codec.UnmarshalJSON(contents, &proposal); err != nil { + return err + } + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + if proposal.ChainId == 0 { + return fmt.Errorf("chain ID cannot be zero") + } + + content := types.NewUpgradeAxelarProxyContractProposal( + proposal.Title, + proposal.Description, + proposal.ChainId, + proposal.NewProxyAddress, + ) + + from := clientCtx.GetFromAddress() + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + return cmd +} + +func GetCmdSubmitCancelAxelarProxyContractUpgradeProposal() *cobra.Command { + cmd := &cobra.Command{ + Use: "cancel-axelar-proxy-contract-upgrade [proposal-file]", + Args: cobra.ExactArgs(1), + Short: "Submit a cancel axelar proxy contract upgrade proposal", + Long: strings.TrimSpace( + fmt.Sprintf(`Submit a cancellation proposal for an existing Axelar proxy contract upgrade along with an initial deposit. +The proposal details must be supplied via a JSON file. + +Example: +$ %s tx gov submit-proposal cancel-axelar-proxy-contract-upgrade --from= + +Where proposal.json contains: + +{ + "title": "Upgrade Axelar Proxy Contract Proposal", + "description": "New features", + "chain_id": 1000, + "deposit": "10000usomm" +} +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal := types.CancelAxelarProxyContractUpgradeProposalWithDeposit{} + contents, err := os.ReadFile(args[0]) + if err != nil { + return err + } + + if err = clientCtx.Codec.UnmarshalJSON(contents, &proposal); err != nil { + return err + } + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + if proposal.ChainId == 0 { + return fmt.Errorf("chain ID cannot be zero") + } + + content := types.NewCancelAxelarProxyContractUpgradeProposal( + proposal.Title, + proposal.Description, + proposal.ChainId, + ) + + from := clientCtx.GetFromAddress() + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + return cmd +} diff --git a/x/axelarcork/client/cli/tx_test.go b/x/axelarcork/client/cli/tx_test.go new file mode 100644 index 00000000..ecda0e56 --- /dev/null +++ b/x/axelarcork/client/cli/tx_test.go @@ -0,0 +1,140 @@ +package cli + +import ( + "io/ioutil" + "os" + "testing" + + "github.com/cosmos/cosmos-sdk/simapp/params" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + + "github.com/cosmos/cosmos-sdk/testutil" + "github.com/stretchr/testify/require" +) + +func TestParseAddManagedCellarsProposal(t *testing.T) { + encodingConfig := params.MakeTestEncodingConfig() + + okJSON := testutil.WriteToNewTempFile(t, ` +{ + "title": "Dollary-doos LP Cellar Proposal", + "description": "I have a hunch", + "cellar_ids": {"ids": ["0x123801a7D398351b8bE11C439e05C5B3259aeC9B", "0x456801a7D398351b8bE11C439e05C5B3259aeC9B"]}, + "deposit": "1000stake" +} +`) + + proposal := types.AddAxelarManagedCellarIDsProposalWithDeposit{} + contents, err := ioutil.ReadFile(okJSON.Name()) + require.NoError(t, err) + + err = encodingConfig.Marshaler.UnmarshalJSON(contents, &proposal) + require.NoError(t, err) + + require.Equal(t, "Dollary-doos LP Cellar Proposal", proposal.Title) + require.Equal(t, "I have a hunch", proposal.Description) + require.Equal(t, "0x123801a7D398351b8bE11C439e05C5B3259aeC9B", proposal.CellarIds.Ids[0]) + require.Equal(t, "0x456801a7D398351b8bE11C439e05C5B3259aeC9B", proposal.CellarIds.Ids[1]) + require.Equal(t, "1000stake", proposal.Deposit) +} + +func TestParseRemoveManagedCellarsProposal(t *testing.T) { + encodingConfig := params.MakeTestEncodingConfig() + + okJSON := testutil.WriteToNewTempFile(t, ` +{ + "title": "Dollary-doos LP Cellar Proposal", + "description": "I have a hunch", + "cellar_ids": {"ids": ["0x123801a7D398351b8bE11C439e05C5B3259aeC9B", "0x456801a7D398351b8bE11C439e05C5B3259aeC9B"]}, + "deposit": "1000stake" +} +`) + + proposal := types.RemoveAxelarManagedCellarIDsProposalWithDeposit{} + contents, err := ioutil.ReadFile(okJSON.Name()) + require.NoError(t, err) + + err = encodingConfig.Marshaler.UnmarshalJSON(contents, &proposal) + require.NoError(t, err) + + require.Equal(t, "Dollary-doos LP Cellar Proposal", proposal.Title) + require.Equal(t, "I have a hunch", proposal.Description) + require.Equal(t, "0x123801a7D398351b8bE11C439e05C5B3259aeC9B", proposal.CellarIds.Ids[0]) + require.Equal(t, "0x456801a7D398351b8bE11C439e05C5B3259aeC9B", proposal.CellarIds.Ids[1]) + require.Equal(t, "1000stake", proposal.Deposit) +} + +func TestParseSubmitScheduledCorkProposal(t *testing.T) { + encodingConfig := params.MakeTestEncodingConfig() + + okJSON := testutil.WriteToNewTempFile(t, ` +{ + "title": "Scheduled cork proposal", + "description": "I have a hunch", + "contract_call_proto_json": "{\"cellar_id\":\"0x123801a7D398351b8bE11C439e05C5B3259aeC9B\",\"cellar_v1\":{\"some_fuction\":{\"function_args\":{}},\"block_height\":12345}}", + "deposit": "1000stake" +} +`) + + proposal := types.AxelarScheduledCorkProposalWithDeposit{} + contents, err := ioutil.ReadFile(okJSON.Name()) + require.NoError(t, err) + + err = encodingConfig.Marshaler.UnmarshalJSON(contents, &proposal) + require.NoError(t, err) + + require.Equal(t, "Scheduled cork proposal", proposal.Title) + require.Equal(t, "I have a hunch", proposal.Description) + require.Equal(t, "{\"cellar_id\":\"0x123801a7D398351b8bE11C439e05C5B3259aeC9B\",\"cellar_v1\":{\"some_fuction\":{\"function_args\":{}},\"block_height\":12345}}", proposal.ContractCallProtoJson) + require.Equal(t, "1000stake", proposal.Deposit) +} + +func TestParseUpgradeAxelarProxyContractProposal(t *testing.T) { + encodingConfig := params.MakeTestEncodingConfig() + + okJSON := testutil.WriteToNewTempFile(t, ` +{ + "title": "Upgrade Axelar proxy contract proposal", + "description": "I have a hunch", + "chain_id": 1, + "new_proxy_address": "0x123801a7D398351b8bE11C439e05C5B3259aeC9B", + "deposit": "1000stake" +} +`) + + proposal := types.UpgradeAxelarProxyContractProposalWithDeposit{} + contents, err := os.ReadFile(okJSON.Name()) + require.NoError(t, err) + + err = encodingConfig.Marshaler.UnmarshalJSON(contents, &proposal) + require.NoError(t, err) + + require.Equal(t, "Upgrade Axelar proxy contract proposal", proposal.Title) + require.Equal(t, "I have a hunch", proposal.Description) + require.Equal(t, "0x123801a7D398351b8bE11C439e05C5B3259aeC9B", proposal.NewProxyAddress) + require.Equal(t, "1000stake", proposal.Deposit) +} + +func TestParseCancelAxelarProxyContractUpgradeProposal(t *testing.T) { + encodingConfig := params.MakeTestEncodingConfig() + + okJSON := testutil.WriteToNewTempFile(t, ` +{ + "title": "Cancel Axelar proxy contract upgrade proposal", + "description": "I have a hunch", + "chain_id": 1, + "deposit": "1000stake" +} +`) + + proposal := types.CancelAxelarProxyContractUpgradeProposalWithDeposit{} + contents, err := os.ReadFile(okJSON.Name()) + require.NoError(t, err) + + err = encodingConfig.Marshaler.UnmarshalJSON(contents, &proposal) + require.NoError(t, err) + + require.Equal(t, "Cancel Axelar proxy contract upgrade proposal", proposal.Title) + require.Equal(t, "I have a hunch", proposal.Description) + require.Equal(t, "1000stake", proposal.Deposit) +} diff --git a/x/axelarcork/client/cli/util.go b/x/axelarcork/client/cli/util.go new file mode 100644 index 00000000..9a9f2b65 --- /dev/null +++ b/x/axelarcork/client/cli/util.go @@ -0,0 +1,24 @@ +package cli + +import ( + "os" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +// ParseCommunityPoolSpendProposal reads and parses a CommunityPoolEthereumSpendProposalForCLI from a file. +func ParseCommunityPoolSpendProposal(cdc codec.JSONCodec, proposalFile string) (types.AxelarCommunityPoolSpendProposalForCLI, error) { + proposal := types.AxelarCommunityPoolSpendProposalForCLI{} + + contents, err := os.ReadFile(proposalFile) + if err != nil { + return proposal, err + } + + if err = cdc.UnmarshalJSON(contents, &proposal); err != nil { + return proposal, err + } + + return proposal, nil +} diff --git a/x/axelarcork/client/proposal_handler.go b/x/axelarcork/client/proposal_handler.go new file mode 100644 index 00000000..69bb3942 --- /dev/null +++ b/x/axelarcork/client/proposal_handler.go @@ -0,0 +1,18 @@ +package client + +import ( + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + "github.com/peggyjv/sommelier/v7/x/axelarcork/client/cli" + "github.com/peggyjv/sommelier/v7/x/axelarcork/client/rest" +) + +var ( + AddProposalHandler = govclient.NewProposalHandler(cli.GetCmdSubmitAddCellarIDProposal, rest.AddProposalRESTHandler) + RemoveProposalHandler = govclient.NewProposalHandler(cli.GetCmdSubmitRemoveCellarIDProposal, rest.RemoveProposalRESTHandler) + ScheduledCorkProposalHandler = govclient.NewProposalHandler(cli.GetCmdSubmitScheduledAxelarCorkProposal, rest.ScheduledCorkProposalRESTHandler) + CommunityPoolEthereumSpendProposalHandler = govclient.NewProposalHandler(cli.CmdSubmitAxelarCommunityPoolEthereumSpendProposal, rest.CommunitySpendProposalRESTHandler) + AddChainConfigurationHandler = govclient.NewProposalHandler(cli.GetCmdSubmitAddChainConfigurationProposal, rest.AddChainConfigurationProposalRESTHandler) + RemoveChainConfigurationHandler = govclient.NewProposalHandler(cli.GetCmdSubmitRemoveChainConfigurationProposal, rest.RemoveChainConfigurationProposalRESTHandler) + UpgradeAxelarProxyContractHandler = govclient.NewProposalHandler(cli.GetCmdSubmitUpgradeAxelarProxyContractProposal, rest.UpgradeAxelarProxyContractProposalRESTHandler) + CancelAxelarProxyContractUpgradeHandler = govclient.NewProposalHandler(cli.GetCmdSubmitCancelAxelarProxyContractUpgradeProposal, rest.CancelAxelarProxyContractUpgradeProposalRESTHandler) +) diff --git a/x/axelarcork/client/rest/rest.go b/x/axelarcork/client/rest/rest.go new file mode 100644 index 00000000..7dccfd63 --- /dev/null +++ b/x/axelarcork/client/rest/rest.go @@ -0,0 +1,318 @@ +package rest + +import ( + "net/http" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/cosmos/cosmos-sdk/types/rest" + govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +// AddProposalRESTHandler returns a ProposalRESTHandler that exposes add managed cellar IDs REST handler with a given sub-route. +func AddProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "add_axelar_managed_cellar_ids", + Handler: postAddProposalHandlerFn(clientCtx), + } +} + +// RemoveProposalRESTHandler returns a ProposalRESTHandler that exposes remove managed cellar IDs REST handler with a given sub-route. +func RemoveProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "remove_axelar_managed_cellar_ids", + Handler: postRemoveProposalHandlerFn(clientCtx), + } +} + +// ScheduledCorkProposalRESTHandler returns a ProposalRESTHandler that exposes the scheduled cork REST handler with a given sub-route. +func ScheduledCorkProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "scheduled_axelar_cork", + Handler: postScheduledCorkProposalHandlerFn(clientCtx), + } +} + +func postAddProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req AddManagedCellarIDsProposalReq + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + content := types.NewAddManagedCellarIDsProposal( + req.Title, + req.Description, + req.ChainID, + &types.CellarIDSet{ + Ids: req.CellarIDs, + }) + + msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) + if rest.CheckBadRequestError(w, err) { + return + } + if rest.CheckBadRequestError(w, msg.ValidateBasic()) { + return + } + + tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) + } +} + +func postRemoveProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req RemoveManagedCellarIDsProposalReq + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + content := types.NewRemoveManagedCellarIDsProposal( + req.Title, + req.Description, + req.ChainID, + &types.CellarIDSet{ + Ids: req.CellarIDs, + }) + + msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) + if rest.CheckBadRequestError(w, err) { + return + } + if rest.CheckBadRequestError(w, msg.ValidateBasic()) { + return + } + + tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) + } +} + +func postScheduledCorkProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req ScheduledCorkProposalReq + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + content := types.NewAxelarScheduledCorkProposal( + req.Title, + req.Description, + req.BlockHeight, + req.ChainID, + req.TargetContractAddress, + req.ContractCallProtoJSON, + ) + if rest.CheckBadRequestError(w, content.ValidateBasic()) { + return + } + msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) + if rest.CheckBadRequestError(w, err) { + return + } + if rest.CheckBadRequestError(w, msg.ValidateBasic()) { + return + } + + tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) + } +} + +// CommunitySpendProposalRESTHandler returns a ProposalRESTHandler that exposes the community pool spend REST handler with a given sub-route. +func CommunitySpendProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "community_pool_evm_spend", + Handler: postCommunitySpendProposalHandlerFn(clientCtx), + } +} + +func postCommunitySpendProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req CommunityPoolSpendProposalReq + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + content := types.NewAxelarCommunitySpendProposal(req.Title, req.Description, req.Recipient, req.ChainID, req.Amount) + + msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) + if rest.CheckBadRequestError(w, err) { + return + } + if rest.CheckBadRequestError(w, msg.ValidateBasic()) { + return + } + + tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) + } +} + +// AddChainConfigurationProposalRESTHandler returns a ProposalRESTHandler that exposes add chain configuration REST handler with a given sub-route. +func AddChainConfigurationProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "add_chain_configuration", + Handler: postAddChainConfigurationProposalHandlerFn(clientCtx), + } +} + +// RemoveChainConfigurationProposalRESTHandler returns a ProposalRESTHandler that exposes remove chain configuration REST handler with a given sub-route. +func RemoveChainConfigurationProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "remove_chain_configuration", + Handler: postRemoveChainConfigurationProposalHandlerFn(clientCtx), + } +} + +func postAddChainConfigurationProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req AddChainConfigurationProposalReq + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + content := types.NewAddChainConfigurationProposal( + req.Title, + req.Description, + req.ChainConfiguration) + + msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) + if rest.CheckBadRequestError(w, err) { + return + } + if rest.CheckBadRequestError(w, msg.ValidateBasic()) { + return + } + + tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) + } +} + +func postRemoveChainConfigurationProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req RemoveChainConfigurationProposalReq + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + content := types.NewRemoveChainConfigurationProposal( + req.Title, + req.Description, + req.ChainID) + + msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) + if rest.CheckBadRequestError(w, err) { + return + } + if rest.CheckBadRequestError(w, msg.ValidateBasic()) { + return + } + + tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) + } +} + +func UpgradeAxelarProxyContractProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "upgrade_axelar_proxy_contract", + Handler: postUpgradeAxelarProxyContractProposalHandlerFn(clientCtx), + } +} + +func postUpgradeAxelarProxyContractProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req UpgradeAxelarProxyContractProposalReq + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + content := types.NewUpgradeAxelarProxyContractProposal( + req.Title, + req.Description, + req.ChainID, + req.NewProxyAddress, + ) + + msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) + if rest.CheckBadRequestError(w, err) { + return + } + if rest.CheckBadRequestError(w, msg.ValidateBasic()) { + return + } + + tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) + } +} + +func CancelAxelarProxyContractUpgradeProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "cancel_axelar_proxy_contract_upgrade", + Handler: postCancelAxelarProxyContractUpgradeProposalHandlerFn(clientCtx), + } +} + +func postCancelAxelarProxyContractUpgradeProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req CancelAxelarProxyContractUpgradeProposalReq + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + content := types.NewCancelAxelarProxyContractUpgradeProposal( + req.Title, + req.Description, + req.ChainID, + ) + + msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) + if rest.CheckBadRequestError(w, err) { + return + } + if rest.CheckBadRequestError(w, msg.ValidateBasic()) { + return + } + + tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) + } +} diff --git a/x/axelarcork/client/rest/utils.go b/x/axelarcork/client/rest/utils.go new file mode 100644 index 00000000..4053e560 --- /dev/null +++ b/x/axelarcork/client/rest/utils.go @@ -0,0 +1,101 @@ +package rest + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/rest" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +type ( + // AddManagedCellarIDsProposalReq defines a managed cellar ID addition proposal request body. + AddManagedCellarIDsProposalReq struct { + BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` + + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + ChainID uint64 `json:"chain_id" yaml:"chain_id"` + CellarIDs []string `json:"cellar_ids" yaml:"cellar_ids"` + Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` + Deposit sdk.Coins `json:"deposit" yaml:"deposit"` + } + // RemoveManagedCellarIDsProposalReq defines a managed cellar ID removal proposal request body. + RemoveManagedCellarIDsProposalReq struct { + BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` + + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + ChainID uint64 `json:"chain_id" yaml:"chain_id"` + CellarIDs []string `json:"cellar_ids" yaml:"cellar_ids"` + Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` + Deposit sdk.Coins `json:"deposit" yaml:"deposit"` + } + // ScheduledCorkProposalReq defines a schedule cork proposal request body. + ScheduledCorkProposalReq struct { + BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` + + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + BlockHeight uint64 `json:"block_height" yaml:"block_height"` + ChainName string `json:"chain_name" yaml:"chain_name"` + ChainID uint64 `json:"chain_id" yaml:"chain_id"` + TargetContractAddress string `json:"target_contract_address" yaml:"target_contract_address"` + ContractCallProtoJSON string `json:"contract_call_proto_json" yaml:"contract_call_proto_json"` + Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` + Deposit sdk.Coins `json:"deposit" yaml:"deposit"` + } + // CommunityPoolSpendProposalReq defines a community pool spend proposal request body. + CommunityPoolSpendProposalReq struct { + BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` + + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + Recipient string `json:"recipient" yaml:"recipient"` + Amount sdk.Coin `json:"amount" yaml:"amount"` + ChainID uint64 `json:"chain_id" yaml:"chain_id"` + ChainName string `json:"chain_name" yaml:"chain_name"` + Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` + Deposit sdk.Coins `json:"deposit" yaml:"deposit"` + } + // AddChainConfigurationProposalReq defines a chain configuration addition proposal request body. + AddChainConfigurationProposalReq struct { + BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` + + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + ChainConfiguration types.ChainConfiguration `json:"chain_configuration" yaml:"chain_configuration"` + Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` + Deposit sdk.Coins `json:"deposit" yaml:"deposit"` + } + // RemoveChainConfigurationProposalReq defines a chain configuration removal proposal request body. + RemoveChainConfigurationProposalReq struct { + BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` + + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + ChainID uint64 `json:"chain_id" yaml:"chain_id"` + Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` + Deposit sdk.Coins `json:"deposit" yaml:"deposit"` + } + // UpgradeAxelarProxyContractProposalReq defines a upgrade axelar proxy contract proposal request body. + UpgradeAxelarProxyContractProposalReq struct { + BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` + + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + ChainID uint64 `json:"chain_id" yaml:"chain_id"` + NewProxyAddress string `json:"new_proxy_address" yaml:"new_proxy_address"` + Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` + Deposit sdk.Coins `json:"deposit" yaml:"deposit"` + } + + // CancelAxelarProxyContractUpgradeProposalReq defines a cancel axelar proxy contract upgrade proposal request body. + CancelAxelarProxyContractUpgradeProposalReq struct { + BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"` + + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + ChainID uint64 `json:"chain_id" yaml:"chain_id"` + Proposer sdk.AccAddress `json:"proposer" yaml:"proposer"` + Deposit sdk.Coins `json:"deposit" yaml:"deposit"` + } +) diff --git a/x/axelarcork/handler.go b/x/axelarcork/handler.go new file mode 100644 index 00000000..a4610d68 --- /dev/null +++ b/x/axelarcork/handler.go @@ -0,0 +1,60 @@ +package axelarcork + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/peggyjv/sommelier/v7/x/axelarcork/keeper" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +// NewHandler returns a handler for "axelarcork" type messages. +func NewHandler(k keeper.Keeper) sdk.Handler { + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + switch msg := msg.(type) { + case *types.MsgScheduleAxelarCorkRequest: + res, err := k.ScheduleCork(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgRelayAxelarCorkRequest: + res, err := k.RelayCork(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgRelayAxelarProxyUpgradeRequest: + res, err := k.RelayProxyUpgrade(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgBumpAxelarCorkGasRequest: + res, err := k.BumpCorkGas(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized axelar cork message type: %T", msg) + } + } +} + +func NewProposalHandler(k keeper.Keeper) govtypes.Handler { + return func(ctx sdk.Context, content govtypes.Content) error { + switch c := content.(type) { + case *types.AddAxelarManagedCellarIDsProposal: + return keeper.HandleAddManagedCellarsProposal(ctx, k, *c) + case *types.RemoveAxelarManagedCellarIDsProposal: + return keeper.HandleRemoveManagedCellarsProposal(ctx, k, *c) + case *types.AxelarScheduledCorkProposal: + return keeper.HandleScheduledCorkProposal(ctx, k, *c) + case *types.AxelarCommunityPoolSpendProposal: + return keeper.HandleCommunityPoolSpendProposal(ctx, k, *c) + case *types.AddChainConfigurationProposal: + return keeper.HandleAddChainConfigurationProposal(ctx, k, *c) + case *types.RemoveChainConfigurationProposal: + return keeper.HandleRemoveChainConfigurationProposal(ctx, k, *c) + case *types.UpgradeAxelarProxyContractProposal: + return keeper.HandleUpgradeAxelarProxyContractProposal(ctx, k, *c) + case *types.CancelAxelarProxyContractUpgradeProposal: + return keeper.HandleCancelAxelarProxyContractUpgradeProposal(ctx, k, *c) + + default: + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized axelar cork proposal content type: %T", c) + } + } +} diff --git a/x/axelarcork/ibc_middleware.go b/x/axelarcork/ibc_middleware.go new file mode 100644 index 00000000..f1ba07cb --- /dev/null +++ b/x/axelarcork/ibc_middleware.go @@ -0,0 +1,74 @@ +package axelarcork + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v3/modules/core/exported" + "github.com/peggyjv/sommelier/v7/x/axelarcork/keeper" +) + +var _ porttypes.Middleware = &IBCMiddleware{} + +type IBCMiddleware struct { + app porttypes.IBCModule + keeper keeper.Keeper +} + +func NewIBCMiddleware(k keeper.Keeper, app porttypes.IBCModule) IBCMiddleware { + return IBCMiddleware{ + app: app, + keeper: k, + } +} + +func (im IBCMiddleware) OnChanOpenInit(ctx sdk.Context, order types.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty types.Counterparty, version string) error { + return im.app.OnChanOpenInit(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) +} + +func (im IBCMiddleware) OnChanOpenTry(ctx sdk.Context, order types.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty types.Counterparty, counterpartyVersion string) (version string, err error) { + return im.app.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) +} + +func (im IBCMiddleware) OnChanOpenAck(ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string) error { + return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) +} + +func (im IBCMiddleware) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error { + return im.app.OnChanOpenConfirm(ctx, portID, channelID) +} + +func (im IBCMiddleware) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error { + return im.app.OnChanCloseInit(ctx, portID, channelID) +} + +func (im IBCMiddleware) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error { + return im.app.OnChanCloseConfirm(ctx, portID, channelID) +} + +func (im IBCMiddleware) OnRecvPacket(ctx sdk.Context, packet types.Packet, relayer sdk.AccAddress) exported.Acknowledgement { + return im.app.OnRecvPacket(ctx, packet, relayer) +} + +func (im IBCMiddleware) OnAcknowledgementPacket(ctx sdk.Context, packet types.Packet, acknowledgement []byte, relayer sdk.AccAddress) error { + return im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) +} + +func (im IBCMiddleware) OnTimeoutPacket(ctx sdk.Context, packet types.Packet, relayer sdk.AccAddress) error { + return im.app.OnTimeoutPacket(ctx, packet, relayer) +} + +func (im IBCMiddleware) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI) error { + if err := im.keeper.ValidateAxelarPacket(ctx, packet); err != nil { + im.keeper.Logger(ctx).Error(fmt.Sprintf("ICS20 packet send was denied: %s", err.Error())) + return err + } + return im.keeper.Ics4Wrapper.SendPacket(ctx, chanCap, packet) +} + +func (im IBCMiddleware) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.PacketI, ack exported.Acknowledgement) error { + return im.keeper.Ics4Wrapper.WriteAcknowledgement(ctx, chanCap, packet, ack) +} diff --git a/x/axelarcork/keeper/abci.go b/x/axelarcork/keeper/abci.go new file mode 100644 index 00000000..e7e180d8 --- /dev/null +++ b/x/axelarcork/keeper/abci.go @@ -0,0 +1,55 @@ +package keeper + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// BeginBlocker is called at the beginning of every block +func (k Keeper) BeginBlocker(ctx sdk.Context) {} + +// EndBlocker defines the oracle logic that executes at the end of every block: +// +// 1) Collects all winning votes +// +// 2) Stores all winning votes as corks that strategists are allowed to relay via Axelar + +func (k Keeper) EndBlocker(ctx sdk.Context) { + k.IterateChainConfigurations(ctx, func(config types.ChainConfiguration) (stop bool) { + k.Logger(ctx).Info("tallying scheduled cork votes", + "height", fmt.Sprintf("%d", ctx.BlockHeight()), + "chain id", config.Id) + winningScheduledVotes := k.GetApprovedScheduledAxelarCorks(ctx, config.Id) + if len(winningScheduledVotes) > 0 { + k.Logger(ctx).Info("marking all winning scheduled cork votes as relayable", + "winning votes", winningScheduledVotes, + "chain id", config.Id) + for _, c := range winningScheduledVotes { + k.SetWinningAxelarCork(ctx, config.Id, uint64(ctx.BlockHeight()), c.Deadline, c) + } + } + + k.Logger(ctx).Info("removing timed out approved corks", + "height", fmt.Sprintf("%d", ctx.BlockHeight()), + "chain id", config.Id) + + timeoutHeight := uint64(ctx.BlockHeight()) - k.GetParamSet(ctx).CorkTimeoutBlocks + k.IterateWinningAxelarCorks(ctx, config.Id, func(_ common.Address, blockHeight uint64, deadline uint64, cork types.AxelarCork) (stop bool) { + if blockHeight >= timeoutHeight { + k.Logger(ctx).Info("deleting expired approved scheduled axelar cork", + "scheduled height", fmt.Sprintf("%d", blockHeight), + "target contract address", cork.TargetContractAddress) + + k.DeleteWinningAxelarCorkByBlockheight(ctx, config.Id, blockHeight, cork) + } + return false + }) + + return false + }) +} diff --git a/x/axelarcork/keeper/chain_config.go b/x/axelarcork/keeper/chain_config.go new file mode 100644 index 00000000..e9e9763c --- /dev/null +++ b/x/axelarcork/keeper/chain_config.go @@ -0,0 +1,55 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +func (k Keeper) GetChainConfigurationByID(ctx sdk.Context, chainID uint64) (types.ChainConfiguration, bool) { + bz := ctx.KVStore(k.storeKey).Get(types.ChainConfigurationKey(chainID)) + if len(bz) == 0 { + return types.ChainConfiguration{}, false + } + + var chainConfig types.ChainConfiguration + k.cdc.MustUnmarshal(bz, &chainConfig) + return chainConfig, true +} + +func (k Keeper) SetChainConfiguration(ctx sdk.Context, chainID uint64, config types.ChainConfiguration) { + bz := k.cdc.MustMarshal(&config) + ctx.KVStore(k.storeKey).Set(types.ChainConfigurationKey(chainID), bz) +} + +func (k Keeper) IterateChainConfigurations(ctx sdk.Context, handler func(config types.ChainConfiguration) (stop bool)) { + store := ctx.KVStore(k.storeKey) + iter := sdk.KVStorePrefixIterator(store, []byte{types.ChainConfigurationPrefix}) + defer iter.Close() + for ; iter.Valid(); iter.Next() { + var chainConfig types.ChainConfiguration + k.cdc.MustUnmarshal(iter.Value(), &chainConfig) + if handler(chainConfig) { + break + } + } +} + +func (k Keeper) GetChainConfigurationByName(ctx sdk.Context, chainName string) (types.ChainConfiguration, bool) { + var chainConfig types.ChainConfiguration + found := false + k.IterateChainConfigurations(ctx, func(config types.ChainConfiguration) (stop bool) { + if config.Name == chainName { + chainConfig = config + found = true + return true + } + + return false + }) + + return chainConfig, found +} + +func (k Keeper) DeleteChainConfigurationByID(ctx sdk.Context, chainID uint64) { + ctx.KVStore(k.storeKey).Delete(types.ChainConfigurationKey(chainID)) +} diff --git a/x/axelarcork/keeper/genesis.go b/x/axelarcork/keeper/genesis.go new file mode 100644 index 00000000..0be14e51 --- /dev/null +++ b/x/axelarcork/keeper/genesis.go @@ -0,0 +1,111 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +// InitGenesis initialize default parameters +// and the keeper's address to pubkey map +func InitGenesis(ctx sdk.Context, k Keeper, gs types.GenesisState) { + k.SetParams(ctx, *gs.Params) + + senderAccount := k.GetSenderAccount(ctx) + if senderAccount == nil { + panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) + } + + k.accountKeeper.SetModuleAccount(ctx, senderAccount) + + for i, config := range gs.ChainConfigurations.Configurations { + k.SetChainConfiguration(ctx, config.Id, *config) + k.SetCellarIDs(ctx, config.Id, *gs.CellarIds[i]) + } + + for _, corkResult := range gs.CorkResults.CorkResults { + k.SetAxelarCorkResult( + ctx, + corkResult.Cork.ChainId, + corkResult.Cork.IDHash(corkResult.BlockHeight), + *corkResult, + ) + } + + for _, scheduledCork := range gs.ScheduledCorks.ScheduledCorks { + valAddr, err := sdk.ValAddressFromBech32(scheduledCork.Validator) + if err != nil { + panic(err) + } + + k.SetScheduledAxelarCork(ctx, scheduledCork.Cork.ChainId, scheduledCork.BlockHeight, valAddr, *scheduledCork.Cork) + } + + for _, n := range gs.AxelarContractCallNonces { + if _, found := k.GetChainConfigurationByID(ctx, n.ChainId); !found { + panic(fmt.Sprintf("chain configuration %d not found", n.ChainId)) + } + + if !common.IsHexAddress(n.ContractAddress) { + panic(fmt.Sprintf("invalid contract address %s", n.ContractAddress)) + } + + k.SetAxelarContractCallNonce(ctx, n.ChainId, n.ContractAddress, n.Nonce) + } + + for _, ud := range gs.AxelarUpgradeData { + if _, found := k.GetChainConfigurationByID(ctx, ud.ChainId); !found { + panic(fmt.Sprintf("chain configuration %d not found for upgrade data", ud.ChainId)) + } + + k.SetAxelarProxyUpgradeData(ctx, ud.ChainId, *ud) + } +} + +// ExportGenesis writes the current store values +// to a genesis file, which can be imported again +// with InitGenesis +func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState { + var gs types.GenesisState + + ps := k.GetParamSet(ctx) + gs.Params = &ps + + k.IterateChainConfigurations(ctx, func(config types.ChainConfiguration) (stop bool) { + gs.ChainConfigurations.Configurations = append(gs.ChainConfigurations.Configurations, &config) + + cellarIDs := k.GetCellarIDs(ctx, config.Id) + var cellarIDSet types.CellarIDSet + for _, id := range cellarIDs { + cellarIDSet.Ids = append(cellarIDSet.Ids, id.String()) + } + gs.CellarIds = append(gs.CellarIds, &cellarIDSet) + + gs.ScheduledCorks.ScheduledCorks = append(gs.ScheduledCorks.ScheduledCorks, k.GetScheduledAxelarCorks(ctx, config.Id)...) + gs.CorkResults.CorkResults = append(gs.CorkResults.CorkResults, k.GetAxelarCorkResults(ctx, config.Id)...) + + return false + }) + + k.IterateAxelarContractCallNonces(ctx, func(chainID uint64, contractAddress common.Address, nonce uint64) (stop bool) { + accn := &types.AxelarContractCallNonce{ + ChainId: chainID, + ContractAddress: contractAddress.Hex(), + Nonce: nonce, + } + + gs.AxelarContractCallNonces = append(gs.AxelarContractCallNonces, accn) + + return false + }) + + k.IterateAxelarProxyUpgradeData(ctx, func(chainID uint64, upgradeData types.AxelarUpgradeData) (stop bool) { + gs.AxelarUpgradeData = append(gs.AxelarUpgradeData, &upgradeData) + + return false + }) + + return gs +} diff --git a/x/axelarcork/keeper/keeper.go b/x/axelarcork/keeper/keeper.go new file mode 100644 index 00000000..39db49d0 --- /dev/null +++ b/x/axelarcork/keeper/keeper.go @@ -0,0 +1,530 @@ +package keeper + +import ( + "bytes" + "encoding/binary" + "encoding/hex" + "reflect" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + "github.com/tendermint/tendermint/libs/log" +) + +// Keeper of the oracle store +type Keeper struct { + storeKey sdk.StoreKey + cdc codec.BinaryCodec + paramSpace paramtypes.Subspace + accountKeeper types.AccountKeeper + stakingKeeper types.StakingKeeper + transferKeeper types.TransferKeeper + distributionKeeper types.DistributionKeeper + gravityKeeper types.GravityKeeper + + Ics4Wrapper types.ICS4Wrapper +} + +// NewKeeper creates a new x/axelarcork Keeper instance +func NewKeeper( + cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace, + accountKeeper types.AccountKeeper, stakingKeeper types.StakingKeeper, + transferKeeper types.TransferKeeper, distributionKeeper types.DistributionKeeper, + wrapper types.ICS4Wrapper, gravityKeeper types.GravityKeeper, +) Keeper { + // set KeyTable if it has not already been set + if !paramSpace.HasKeyTable() { + paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) + } + + return Keeper{ + storeKey: key, + cdc: cdc, + paramSpace: paramSpace, + accountKeeper: accountKeeper, + stakingKeeper: stakingKeeper, + transferKeeper: transferKeeper, + distributionKeeper: distributionKeeper, + gravityKeeper: gravityKeeper, + + Ics4Wrapper: wrapper, + } +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+types.ModuleName) +} + +//////////// +// Params // +//////////// + +const CorkVoteThresholdStr = "0.67" + +// GetParamSet returns the vote period from the parameters +func (k Keeper) GetParamSet(ctx sdk.Context) types.Params { + var p types.Params + k.paramSpace.GetParamSet(ctx, &p) + return p +} + +// SetParams sets the parameters in the store +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + // using this direct method instead of k.paramSpace.SetParamSet because our + // param validation should have happened on ValidateBasic, where it is + // contingent on being "enabled" + for _, pair := range params.ParamSetPairs() { + v := reflect.Indirect(reflect.ValueOf(pair.Value)).Interface() + + k.paramSpace.Set(ctx, pair.Key, v) + } +} + +///////////////////// +// Scheduled Corks // +///////////////////// + +func (k Keeper) SetScheduledAxelarCork(ctx sdk.Context, chainID uint64, blockHeight uint64, val sdk.ValAddress, cork types.AxelarCork) []byte { + id := cork.IDHash(blockHeight) + bz := k.cdc.MustMarshal(&cork) + ctx.KVStore(k.storeKey).Set(types.GetScheduledAxelarCorkKey(chainID, blockHeight, id, val, common.HexToAddress(cork.TargetContractAddress), cork.Deadline), bz) + return id +} + +// GetScheduledAxelarCork gets the scheduled cork for a given validator +// CONTRACT: must provide the validator address here not the delegate address +func (k Keeper) GetScheduledAxelarCork(ctx sdk.Context, chainID uint64, blockHeight uint64, id []byte, val sdk.ValAddress, contract common.Address, deadline uint64) (types.AxelarCork, bool) { + store := ctx.KVStore(k.storeKey) + + bz := store.Get(types.GetScheduledAxelarCorkKey(chainID, blockHeight, id, val, contract, deadline)) + if len(bz) == 0 { + return types.AxelarCork{}, false + } + + var cork types.AxelarCork + k.cdc.MustUnmarshal(bz, &cork) + return cork, true +} + +// DeleteScheduledAxelarCork deletes the scheduled cork for a given validator +// CONTRACT: must provide the validator address here not the delegate address +func (k Keeper) DeleteScheduledAxelarCork(ctx sdk.Context, chainID uint64, blockHeight uint64, id []byte, val sdk.ValAddress, contract common.Address, deadline uint64) { + ctx.KVStore(k.storeKey).Delete(types.GetScheduledAxelarCorkKey(chainID, blockHeight, id, val, contract, deadline)) +} + +// IterateScheduledAxelarCorks iterates over all scheduled corks by chain ID +func (k Keeper) IterateScheduledAxelarCorks(ctx sdk.Context, chainID uint64, cb func(val sdk.ValAddress, blockHeight uint64, id []byte, cel common.Address, deadline uint64, cork types.AxelarCork) (stop bool)) { + k.IterateScheduledAxelarCorksByPrefix(ctx, types.GetScheduledAxelarCorkKeyPrefix(chainID), cb) +} + +func (k Keeper) IterateScheduledAxelarCorksByBlockHeight(ctx sdk.Context, chainID uint64, blockHeight uint64, cb func(val sdk.ValAddress, blockHeight uint64, id []byte, cel common.Address, deadline uint64, cork types.AxelarCork) (stop bool)) { + k.IterateScheduledAxelarCorksByPrefix(ctx, types.GetScheduledAxelarCorkKeyByBlockHeightPrefix(chainID, blockHeight), cb) +} + +func (k Keeper) IterateScheduledAxelarCorksByPrefix(ctx sdk.Context, prefix []byte, cb func(val sdk.ValAddress, blockHeight uint64, id []byte, cel common.Address, deadline uint64, cork types.AxelarCork) (stop bool)) { + store := ctx.KVStore(k.storeKey) + iter := sdk.KVStorePrefixIterator(store, prefix) + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + var cork types.AxelarCork + keyPair := bytes.NewBuffer(iter.Key()) + keyPair.Next(1) // trim prefix byte + keyPair.Next(8) // trim chain id, it was filtered in the prefix + blockHeight := sdk.BigEndianToUint64(keyPair.Next(8)) + id := keyPair.Next(32) + val := sdk.ValAddress(keyPair.Next(20)) + contract := common.BytesToAddress(keyPair.Next(20)) + deadline := sdk.BigEndianToUint64(keyPair.Next(8)) + + k.cdc.MustUnmarshal(iter.Value(), &cork) + if cb(val, blockHeight, id, contract, deadline, cork) { + break + } + } +} + +func (k Keeper) GetScheduledAxelarCorks(ctx sdk.Context, chainID uint64) []*types.ScheduledAxelarCork { + var scheduledCorks []*types.ScheduledAxelarCork + k.IterateScheduledAxelarCorks(ctx, chainID, func(val sdk.ValAddress, blockHeight uint64, id []byte, _ common.Address, _ uint64, cork types.AxelarCork) (stop bool) { + scheduledCorks = append(scheduledCorks, &types.ScheduledAxelarCork{ + Validator: val.String(), + Cork: &cork, + BlockHeight: blockHeight, + Id: hex.EncodeToString(id), + }) + return false + }) + + return scheduledCorks +} + +func (k Keeper) GetScheduledAxelarCorksByBlockHeight(ctx sdk.Context, chainID uint64, height uint64) []*types.ScheduledAxelarCork { + var scheduledCorks []*types.ScheduledAxelarCork + k.IterateScheduledAxelarCorksByBlockHeight(ctx, chainID, height, func(val sdk.ValAddress, blockHeight uint64, Id []byte, _ common.Address, _ uint64, cork types.AxelarCork) (stop bool) { + scheduledCorks = append(scheduledCorks, &types.ScheduledAxelarCork{ + Validator: val.String(), + Cork: &cork, + BlockHeight: blockHeight, + Id: hex.EncodeToString(Id), + }) + + return false + }) + + return scheduledCorks +} + +func (k Keeper) GetScheduledAxelarCorksByID(ctx sdk.Context, chainID uint64, queriedID []byte) []*types.ScheduledAxelarCork { + var scheduledCorks []*types.ScheduledAxelarCork + k.IterateScheduledAxelarCorks(ctx, chainID, func(val sdk.ValAddress, blockHeight uint64, id []byte, _ common.Address, _ uint64, cork types.AxelarCork) (stop bool) { + if bytes.Equal(id, queriedID) { + scheduledCorks = append(scheduledCorks, &types.ScheduledAxelarCork{ + Validator: val.String(), + Cork: &cork, + BlockHeight: blockHeight, + Id: hex.EncodeToString(id), + }) + } + + return false + }) + + return scheduledCorks +} + +///////////////// +// WinningCork // +///////////////// + +func (k Keeper) SetWinningAxelarCork(ctx sdk.Context, chainID uint64, blockHeight uint64, deadline uint64, cork types.AxelarCork) { + bz := k.cdc.MustMarshal(&cork) + ctx.KVStore(k.storeKey).Set(types.GetWinningAxelarCorkKey(chainID, blockHeight, common.HexToAddress(cork.TargetContractAddress), deadline), bz) +} + +func (k Keeper) IterateWinningAxelarCorks(ctx sdk.Context, chainID uint64, cb func(contract common.Address, blockHeight uint64, deadline uint64, cork types.AxelarCork) (stop bool)) { + store := ctx.KVStore(k.storeKey) + iter := sdk.KVStorePrefixIterator(store, types.GetWinningAxelarCorkKeyPrefix(chainID)) + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + var cork types.AxelarCork + keyPair := bytes.NewBuffer(iter.Key()) + keyPair.Next(1) // trim prefix byte + keyPair.Next(8) // trim chain ID + blockHeight := binary.BigEndian.Uint64(keyPair.Next(8)) + contractAddress := common.BytesToAddress(keyPair.Next(20)) // contract + deadline := sdk.BigEndianToUint64(keyPair.Next(8)) + + k.cdc.MustUnmarshal(iter.Value(), &cork) + if cb(contractAddress, blockHeight, deadline, cork) { + break + } + } +} + +func (k Keeper) GetWinningAxelarCork(ctx sdk.Context, chainID uint64, contractAddr common.Address) (uint64, types.AxelarCork, bool) { + var bh uint64 + var c types.AxelarCork + found := false + k.IterateWinningAxelarCorks(ctx, chainID, func(contract common.Address, blockHeight uint64, deadline uint64, cork types.AxelarCork) (stop bool) { + if contractAddr == contract { + bh = blockHeight + c = cork + found = true + return true + } + + return false + }) + + return bh, c, found +} + +func (k Keeper) DeleteWinningAxelarCorkByBlockheight(ctx sdk.Context, chainID uint64, blockHeight uint64, cork types.AxelarCork) { + ctx.KVStore(k.storeKey).Delete(types.GetWinningAxelarCorkKey(chainID, blockHeight, common.HexToAddress(cork.TargetContractAddress), cork.Deadline)) +} + +// TODO (Collin): Need pruning logic. This method is unused. +func (k Keeper) DeleteWinningAxelarCork(ctx sdk.Context, chainID uint64, c types.AxelarCork) { + + k.IterateWinningAxelarCorks(ctx, chainID, func(contract common.Address, blockHeight uint64, deadline uint64, cork types.AxelarCork) (stop bool) { + if c.Equals(cork) { + k.DeleteWinningAxelarCorkByBlockheight(ctx, chainID, blockHeight, cork) + + return true + } + + return false + }) +} + +/////////////////////////// +// ScheduledBlockHeights // +/////////////////////////// + +func (k Keeper) GetScheduledBlockHeights(ctx sdk.Context, chainID uint64) []uint64 { + var heights []uint64 + + latestHeight := uint64(0) + k.IterateScheduledAxelarCorks(ctx, chainID, func(_ sdk.ValAddress, blockHeight uint64, _ []byte, _ common.Address, _ uint64, _ types.AxelarCork) (stop bool) { + if blockHeight > latestHeight { + heights = append(heights, blockHeight) + } + latestHeight = blockHeight + return false + }) + + return heights +} + +////////////////// +// AxelarCork Results // +////////////////// + +func (k Keeper) SetAxelarCorkResult(ctx sdk.Context, chainID uint64, id []byte, corkResult types.AxelarCorkResult) { + bz := k.cdc.MustMarshal(&corkResult) + ctx.KVStore(k.storeKey).Set(types.GetAxelarCorkResultKey(chainID, id), bz) +} + +func (k Keeper) GetAxelarCorkResult(ctx sdk.Context, chainID uint64, id []byte) (types.AxelarCorkResult, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.GetAxelarCorkResultKey(chainID, id)) + if len(bz) == 0 { + return types.AxelarCorkResult{}, false + } + + var corkResult types.AxelarCorkResult + k.cdc.MustUnmarshal(bz, &corkResult) + return corkResult, true +} + +func (k Keeper) DeleteAxelarCorkResult(ctx sdk.Context, chainID uint64, id []byte) { + ctx.KVStore(k.storeKey).Delete(types.GetAxelarCorkResultKey(chainID, id)) +} + +// IterateCorksResult iterates over all cork results by chain ID +func (k Keeper) IterateAxelarCorkResults(ctx sdk.Context, chainID uint64, cb func(id []byte, blockHeight uint64, approved bool, approvalPercentage string, corkResult types.AxelarCorkResult) (stop bool)) { + store := ctx.KVStore(k.storeKey) + iter := sdk.KVStorePrefixIterator(store, types.GetAxelarCorkResultPrefix(chainID)) + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + var corkResult types.AxelarCorkResult + keyPair := bytes.NewBuffer(iter.Key()) + keyPair.Next(1) // trim prefix byte + id := keyPair.Next(32) + + k.cdc.MustUnmarshal(iter.Value(), &corkResult) + if cb(id, corkResult.BlockHeight, corkResult.Approved, corkResult.ApprovalPercentage, corkResult) { + break + } + } +} + +// GetAxelarCorkResults returns AxelarCorkResults +func (k Keeper) GetAxelarCorkResults(ctx sdk.Context, chainID uint64) []*types.AxelarCorkResult { + var corkResults []*types.AxelarCorkResult + k.IterateAxelarCorkResults(ctx, chainID, func(id []byte, blockHeight uint64, approved bool, approvalPercentage string, corkResult types.AxelarCorkResult) (stop bool) { + corkResults = append(corkResults, &corkResult) + return false + }) + + return corkResults +} + +/////////// +// Votes // +/////////// + +func (k Keeper) GetApprovedScheduledAxelarCorks(ctx sdk.Context, chainID uint64) (approvedCorks []types.AxelarCork) { + currentBlockHeight := uint64(ctx.BlockHeight()) + totalPower := k.stakingKeeper.GetLastTotalPower(ctx) + corks := []types.AxelarCork{} + powers := []uint64{} + k.IterateScheduledAxelarCorksByBlockHeight(ctx, chainID, currentBlockHeight, func(val sdk.ValAddress, _ uint64, id []byte, addr common.Address, deadline uint64, cork types.AxelarCork) (stop bool) { + validator := k.stakingKeeper.Validator(ctx, val) + validatorPower := uint64(validator.GetConsensusPower(k.stakingKeeper.PowerReduction(ctx))) + found := false + for i, c := range corks { + if c.Equals(cork) { + powers[i] += validatorPower + + found = true + break + } + } + + if !found { + corks = append(corks, cork) + powers = append(powers, validatorPower) + } + + k.DeleteScheduledAxelarCork(ctx, chainID, currentBlockHeight, id, val, addr, deadline) + + return false + }) + + threshold := sdk.MustNewDecFromStr(CorkVoteThresholdStr) + for i, power := range powers { + cork := corks[i] + approvalPercentage := sdk.NewIntFromUint64(power).ToDec().Quo(totalPower.ToDec()) + quorumReached := approvalPercentage.GT(threshold) + corkResult := types.AxelarCorkResult{ + Cork: &cork, + BlockHeight: currentBlockHeight, + Approved: quorumReached, + ApprovalPercentage: approvalPercentage.Mul(sdk.NewDec(100)).String(), + } + corkID := cork.IDHash(currentBlockHeight) + + k.SetAxelarCorkResult(ctx, chainID, corkID, corkResult) + + if quorumReached { + approvedCorks = append(approvedCorks, cork) + } + } + + return approvedCorks +} + +///////////// +// Cellars // +///////////// + +func (k Keeper) SetCellarIDs(ctx sdk.Context, chainID uint64, c types.CellarIDSet) { + bz := k.cdc.MustMarshal(&c) + ctx.KVStore(k.storeKey).Set(types.MakeCellarIDsKey(chainID), bz) +} + +func (k Keeper) GetCellarIDs(ctx sdk.Context, chainID uint64) (cellars []common.Address) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.MakeCellarIDsKey(chainID)) + + var cids types.CellarIDSet + k.cdc.MustUnmarshal(bz, &cids) + + for _, cid := range cids.Ids { + cellars = append(cellars, common.HexToAddress(cid)) + } + + return cellars +} + +func (k Keeper) HasCellarID(ctx sdk.Context, chainID uint64, address common.Address) (found bool) { + found = false + for _, id := range k.GetCellarIDs(ctx, chainID) { + if id == address { + found = true + break + } + } + + return found +} + +///////////////////////////////// +// Axelar Contract Call Nonces // +///////////////////////////////// + +// SetAxelarContractCallNonce sets the nonce for the given chainID and address +func (k Keeper) SetAxelarContractCallNonce(ctx sdk.Context, chainID uint64, address string, nonce uint64) { + store := ctx.KVStore(k.storeKey) + store.Set(types.GetAxelarContractCallNonceKey(chainID, common.HexToAddress(address)), sdk.Uint64ToBigEndian(nonce)) +} + +// GetAxelarContractCallNonce returns the nonce for the given chainID and address, returning a zero if not found +func (k Keeper) GetAxelarContractCallNonce(ctx sdk.Context, chainID uint64, address string) uint64 { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.GetAxelarContractCallNonceKey(chainID, common.HexToAddress(address))) + if len(bz) == 0 { + return 0 + } + + return sdk.BigEndianToUint64(bz) +} + +// IncrementAxelarContractCallNonce increments the nonce for the given chainID and address +func (k Keeper) IncrementAxelarContractCallNonce(ctx sdk.Context, chainID uint64, address string) uint64 { + nonce := k.GetAxelarContractCallNonce(ctx, chainID, address) + 1 + k.SetAxelarContractCallNonce(ctx, chainID, address, nonce) + + return nonce +} + +// IterateAxelarContractCallNonces iterates over all axelar contract call nonces +func (k Keeper) IterateAxelarContractCallNonces(ctx sdk.Context, cb func(chainID uint64, address common.Address, nonce uint64) (stop bool)) { + store := ctx.KVStore(k.storeKey) + iter := sdk.KVStorePrefixIterator(store, []byte{types.AxelarContractCallNoncePrefix}) + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + keyPair := bytes.NewBuffer(iter.Key()) + keyPair.Next(1) // trim prefix byte + chainID := sdk.BigEndianToUint64(keyPair.Next(8)) + address := common.BytesToAddress(keyPair.Next(20)) + nonce := sdk.BigEndianToUint64(iter.Value()) + if cb(chainID, address, nonce) { + break + } + } +} + +///////////////////////// +// Axelar Upgrade Data // +///////////////////////// + +// SetAxelarProxyUpgradeData sets the upgrade data for the given chainID +func (k Keeper) SetAxelarProxyUpgradeData(ctx sdk.Context, chainID uint64, upgradeData types.AxelarUpgradeData) { + ud := k.cdc.MustMarshal(&upgradeData) + ctx.KVStore(k.storeKey).Set(types.GetAxelarProxyUpgradeDataKey(chainID), ud) +} + +// GetAxelarProxyUpgradeData returns the upgrade data for the given chainID, returning an empty payload if not found +func (k Keeper) GetAxelarProxyUpgradeData(ctx sdk.Context, chainID uint64) (types.AxelarUpgradeData, bool) { + bz := ctx.KVStore(k.storeKey).Get(types.GetAxelarProxyUpgradeDataKey(chainID)) + if len(bz) == 0 { + return types.AxelarUpgradeData{}, false + } + + upgradeData := types.AxelarUpgradeData{} + k.cdc.MustUnmarshal(bz, &upgradeData) + + return upgradeData, true +} + +// DeleteAxelarProxyUpgradeData deletes the upgrade data for the given chainID +func (k Keeper) DeleteAxelarProxyUpgradeData(ctx sdk.Context, chainID uint64) { + ctx.KVStore(k.storeKey).Delete(types.GetAxelarProxyUpgradeDataKey(chainID)) +} + +// IterateAxelarProxyUpgradeData iterates over all axelar proxy upgrade data +func (k Keeper) IterateAxelarProxyUpgradeData(ctx sdk.Context, cb func(chainID uint64, upgradeData types.AxelarUpgradeData) (stop bool)) { + store := ctx.KVStore(k.storeKey) + iter := sdk.KVStorePrefixIterator(store, []byte{types.AxelarProxyUpgradeDataPrefix}) + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + keyPair := bytes.NewBuffer(iter.Key()) + keyPair.Next(1) // trim prefix byte + chainID := sdk.BigEndianToUint64(keyPair.Next(8)) + upgradeData := types.AxelarUpgradeData{} + k.cdc.MustUnmarshal(iter.Value(), &upgradeData) + if cb(chainID, upgradeData) { + break + } + } +} + +///////////////////// +// Module Accounts // +///////////////////// + +func (k Keeper) GetSenderAccount(ctx sdk.Context) authtypes.ModuleAccountI { + return k.accountKeeper.GetModuleAccount(ctx, types.ModuleName) +} diff --git a/x/axelarcork/keeper/keeper_test.go b/x/axelarcork/keeper/keeper_test.go new file mode 100644 index 00000000..f327c103 --- /dev/null +++ b/x/axelarcork/keeper/keeper_test.go @@ -0,0 +1,367 @@ +package keeper + +import ( + "encoding/hex" + "testing" + + "github.com/peggyjv/sommelier/v7/x/axelarcork/tests/mocks" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + "github.com/ethereum/go-ethereum/common" + "github.com/golang/mock/gomock" + moduletestutil "github.com/peggyjv/sommelier/v7/testutil" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + "github.com/stretchr/testify/suite" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmtime "github.com/tendermint/tendermint/types/time" +) + +const ( + zeroAddressHex = "0x0000000000000000000000000000000000000000" + oneAddressHex = "0x1111111111111111111111111111111111111111" +) + +var ( + sampleCellarHex = "0xc0ffee254729296a45a3885639AC7E10F9d54979" + sampleCellarAddr = common.HexToAddress(sampleCellarHex) +) + +type KeeperTestSuite struct { + suite.Suite + + ctx sdk.Context + axelarcorkKeeper Keeper + accountKeeper *mocks.MockAccountKeeper + stakingKeeper *mocks.MockStakingKeeper + transferKeeper *mocks.MockTransferKeeper + distributionKeeper *mocks.MockDistributionKeeper + ics4wrapper *mocks.MockICS4Wrapper + gravityKeeper *mocks.MockGravityKeeper + + validator *mocks.MockValidatorI + + queryClient types.QueryClient + + encCfg moduletestutil.TestEncodingConfig +} + +func (suite *KeeperTestSuite) SetupTest() { + key := sdk.NewKVStoreKey(types.StoreKey) + tkey := sdk.NewTransientStoreKey("transient_test") + testCtx := testutil.DefaultContext(key, tkey) + ctx := testCtx.WithBlockHeader(tmproto.Header{Height: 5, Time: tmtime.Now()}) + encCfg := moduletestutil.MakeTestEncodingConfig() + + // gomock initializations + ctrl := gomock.NewController(suite.T()) + defer ctrl.Finish() + + suite.accountKeeper = mocks.NewMockAccountKeeper(ctrl) + suite.stakingKeeper = mocks.NewMockStakingKeeper(ctrl) + suite.transferKeeper = mocks.NewMockTransferKeeper(ctrl) + suite.distributionKeeper = mocks.NewMockDistributionKeeper(ctrl) + suite.ics4wrapper = mocks.NewMockICS4Wrapper(ctrl) + suite.validator = mocks.NewMockValidatorI(ctrl) + suite.ctx = ctx + + params := paramskeeper.NewKeeper( + encCfg.Codec, + codec.NewLegacyAmino(), + key, + tkey, + ) + + params.Subspace(types.ModuleName) + subSpace, found := params.GetSubspace(types.ModuleName) + suite.Assertions.True(found) + + suite.axelarcorkKeeper = NewKeeper( + encCfg.Codec, + key, + subSpace, + suite.accountKeeper, + suite.stakingKeeper, + suite.transferKeeper, + suite.distributionKeeper, + suite.ics4wrapper, + suite.gravityKeeper, + ) + + //types.RegisterInterfaces(encCfg.InterfaceRegistry) + + queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) + types.RegisterQueryServer(queryHelper, suite.axelarcorkKeeper) + queryClient := types.NewQueryClient(queryHelper) + + suite.queryClient = queryClient + suite.encCfg = encCfg +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (suite *KeeperTestSuite) TestSetGetCellarIDsHappyPath() { + ctx, axelarcorkKeeper := suite.ctx, suite.axelarcorkKeeper + require := suite.Require() + + cellarIDSet := types.CellarIDSet{ + Ids: []string{sampleCellarHex}, + } + expected := []common.Address{} + for _, id := range cellarIDSet.Ids { + expected = append(expected, common.HexToAddress(id)) + } + axelarcorkKeeper.SetCellarIDs(ctx, TestEVMChainID, cellarIDSet) + actual := axelarcorkKeeper.GetCellarIDs(ctx, TestEVMChainID) + + require.Equal(expected, actual) + require.True(axelarcorkKeeper.HasCellarID(ctx, TestEVMChainID, sampleCellarAddr)) +} + +func (suite *KeeperTestSuite) TestSetGetDeleteScheduledCork() { + ctx, axelarcorkKeeper := suite.ctx, suite.axelarcorkKeeper + require := suite.Require() + + axelarcorkKeeper.SetChainConfiguration(ctx, TestEVMChainID, types.ChainConfiguration{ + Name: "testevm", + Id: TestEVMChainID, + ProxyAddress: "0x123", + }) + + testHeight := uint64(123) + val := []byte("testaddress") + deadline := uint64(10000000000) + expectedCork := types.AxelarCork{ + EncodedContractCall: []byte("testcall"), + TargetContractAddress: sampleCellarHex, + Deadline: deadline, + } + expectedID := expectedCork.IDHash(testHeight) + actualID := axelarcorkKeeper.SetScheduledAxelarCork(ctx, TestEVMChainID, testHeight, val, expectedCork) + require.Equal(expectedID, actualID) + actualCork, found := axelarcorkKeeper.GetScheduledAxelarCork(ctx, TestEVMChainID, testHeight, actualID, val, sampleCellarAddr, deadline) + require.True(found) + require.Equal(expectedCork, actualCork) + + actualCorks := axelarcorkKeeper.GetScheduledAxelarCorks(ctx, TestEVMChainID) + require.Equal(&expectedCork, actualCorks[0].Cork) + + actualCorks = axelarcorkKeeper.GetScheduledAxelarCorksByID(ctx, TestEVMChainID, actualID) + require.Len(actualCorks, 1) + require.Equal(&expectedCork, actualCorks[0].Cork) + require.Equal(hex.EncodeToString(expectedID), actualCorks[0].Id) + + actualHeights := axelarcorkKeeper.GetScheduledBlockHeights(ctx, TestEVMChainID) + require.Equal(actualCorks[0].BlockHeight, actualHeights[0]) + + actualCorks = axelarcorkKeeper.GetScheduledAxelarCorksByBlockHeight(ctx, TestEVMChainID, testHeight) + require.Equal(&expectedCork, actualCorks[0].Cork) + require.Equal(testHeight, actualCorks[0].BlockHeight) + require.Equal(hex.EncodeToString(expectedID), actualCorks[0].Id) + + axelarcorkKeeper.DeleteScheduledAxelarCork(ctx, TestEVMChainID, testHeight, expectedID, sdk.ValAddress(val), sampleCellarAddr, deadline) + require.Empty(axelarcorkKeeper.GetScheduledAxelarCorks(ctx, TestEVMChainID)) +} + +func (suite *KeeperTestSuite) TestGetWinningVotes() { + ctx, axelarcorkKeeper := suite.ctx, suite.axelarcorkKeeper + require := suite.Require() + + axelarcorkKeeper.SetChainConfiguration(ctx, TestEVMChainID, types.ChainConfiguration{ + Name: "testevm", + Id: TestEVMChainID, + ProxyAddress: "0x123", + }) + + testHeight := uint64(ctx.BlockHeight()) + deadline := uint64(100000000000000) + cork := types.AxelarCork{ + EncodedContractCall: []byte("testcall"), + TargetContractAddress: sampleCellarHex, + Deadline: deadline, + } + _, bytes, err := bech32.DecodeAndConvert("somm1fcl08ymkl70dhyg3vmx4hjsqvxym7dawnp0zfp") + require.NoError(err) + require.Equal(20, len(bytes)) + axelarcorkKeeper.SetScheduledAxelarCork(ctx, TestEVMChainID, testHeight, bytes, cork) + + suite.stakingKeeper.EXPECT().GetLastTotalPower(ctx).Return(sdk.NewInt(100)) + suite.stakingKeeper.EXPECT().Validator(ctx, gomock.Any()).Return(suite.validator) + suite.validator.EXPECT().GetConsensusPower(gomock.Any()).Return(int64(100)) + suite.stakingKeeper.EXPECT().PowerReduction(ctx).Return(sdk.OneInt()) + + winningScheduledVotes := axelarcorkKeeper.GetApprovedScheduledAxelarCorks(ctx, TestEVMChainID) + results := axelarcorkKeeper.GetAxelarCorkResults(ctx, TestEVMChainID) + require.Len(winningScheduledVotes, 1) + require.Equal(cork, winningScheduledVotes[0]) + require.Equal(&cork, results[0].Cork) + require.True(results[0].Approved) + require.Equal("100.000000000000000000", results[0].ApprovalPercentage) + + // scheduled cork should be deleted at the scheduled height + require.Empty(axelarcorkKeeper.GetScheduledAxelarCorksByBlockHeight(ctx, TestEVMChainID, testHeight)) +} + +func (suite *KeeperTestSuite) TestCorkResults() { + ctx, axelarcorkKeeper := suite.ctx, suite.axelarcorkKeeper + require := suite.Require() + + require.Empty(axelarcorkKeeper.GetAxelarCorkResults(ctx, TestEVMChainID)) + + testHeight := uint64(ctx.BlockHeight()) + deadline := uint64(100000000000000) + cork := types.AxelarCork{ + EncodedContractCall: []byte("testcall"), + TargetContractAddress: sampleCellarHex, + Deadline: deadline, + } + id := cork.IDHash(testHeight) + result := types.AxelarCorkResult{ + Cork: &cork, + BlockHeight: testHeight, + Approved: true, + ApprovalPercentage: "100.00", + } + axelarcorkKeeper.SetAxelarCorkResult(ctx, TestEVMChainID, id, result) + actualResult, found := axelarcorkKeeper.GetAxelarCorkResult(ctx, TestEVMChainID, id) + require.True(found) + require.Equal(result, actualResult) + + results := axelarcorkKeeper.GetAxelarCorkResults(ctx, TestEVMChainID) + require.Equal(&actualResult, results[0]) + + axelarcorkKeeper.DeleteAxelarCorkResult(ctx, TestEVMChainID, id) + require.Empty(axelarcorkKeeper.GetAxelarCorkResults(ctx, TestEVMChainID)) +} + +func (suite *KeeperTestSuite) TestParamSet() { + ctx, axelarcorkKeeper := suite.ctx, suite.axelarcorkKeeper + require := suite.Require() + + require.Panics(func() { axelarcorkKeeper.GetParamSet(ctx) }) + + testGMPAccount := authtypes.NewModuleAddress("test-gmp-account") + + params := types.Params{ + IbcChannel: "test-ibc-channel", + IbcPort: "test-ibc-port", + GmpAccount: testGMPAccount.String(), + ExecutorAccount: "test-executor-account", + TimeoutDuration: 10, + } + axelarcorkKeeper.SetParams(ctx, params) + require.Equal(params, axelarcorkKeeper.GetParamSet(ctx)) +} + +func (suite *KeeperTestSuite) TestAxelarCorkContractCallNonces() { + ctx, axelarcorkKeeper := suite.ctx, suite.axelarcorkKeeper + require := suite.Require() + + chain1 := uint64(TestEVMChainID) + chain2 := uint64(100) + address1 := zeroAddressHex + address2 := sampleCellarAddr.Hex() + + require.Equal(uint64(0), axelarcorkKeeper.GetAxelarContractCallNonce(ctx, chain1, address1)) + + axelarcorkKeeper.IncrementAxelarContractCallNonce(ctx, chain1, address1) + require.Equal(uint64(1), axelarcorkKeeper.GetAxelarContractCallNonce(ctx, chain1, address1)) + + axelarcorkKeeper.SetAxelarContractCallNonce(ctx, chain1, address1, 5) + require.Equal(uint64(5), axelarcorkKeeper.GetAxelarContractCallNonce(ctx, chain1, address1)) + + axelarcorkKeeper.IncrementAxelarContractCallNonce(ctx, chain1, address2) + axelarcorkKeeper.IncrementAxelarContractCallNonce(ctx, chain2, address2) + axelarcorkKeeper.IncrementAxelarContractCallNonce(ctx, chain2, address2) + require.Equal(uint64(1), axelarcorkKeeper.GetAxelarContractCallNonce(ctx, chain1, address2)) + require.Equal(uint64(2), axelarcorkKeeper.GetAxelarContractCallNonce(ctx, chain2, address2)) + + var data []types.AxelarContractCallNonce + axelarcorkKeeper.IterateAxelarContractCallNonces(ctx, func(chainID uint64, address common.Address, nonce uint64) bool { + data = append(data, types.AxelarContractCallNonce{ + ChainId: chainID, + ContractAddress: address.Hex(), + Nonce: nonce, + }) + + return false + }) + require.EqualValues(3, len(data)) + require.EqualValues([]types.AxelarContractCallNonce{ + { + ChainId: chain1, + ContractAddress: address1, + Nonce: 5, + }, + { + ChainId: chain1, + ContractAddress: address2, + Nonce: 1, + }, + { + ChainId: chain2, + ContractAddress: address2, + Nonce: 2, + }, + }, data) +} + +func (suite *KeeperTestSuite) TestAxelarProxyArgsEncoding() { + require := suite.Require() + + cellars := []string{sampleCellarHex, oneAddressHex} + + _, err := types.EncodeLogicCallArgs(zeroAddressHex, 1, 100000000, []byte("testcall")) + require.NoError(err) + _, err = types.EncodeUpgradeArgs(zeroAddressHex, cellars) + require.NoError(err) +} + +// TestAxelarProxyUpgradeData tests the upgrade data set, get, and delete functions +func (suite *KeeperTestSuite) TestAxelarProxyUpgradeData() { + ctx, axelarcorkKeeper := suite.ctx, suite.axelarcorkKeeper + require := suite.Require() + + chainID1 := uint64(TestEVMChainID) + chainID2 := uint64(3) + cellars := []string{sampleCellarHex, oneAddressHex} + payload, err := types.EncodeUpgradeArgs(zeroAddressHex, cellars) + require.NoError(err) + upgradeData1 := types.AxelarUpgradeData{ + ChainId: chainID1, + Payload: payload, + ExecutableHeightThreshold: 10000000, + } + upgradeData2 := types.AxelarUpgradeData{ + ChainId: chainID2, + Payload: payload, + ExecutableHeightThreshold: 10000001, + } + + axelarcorkKeeper.SetAxelarProxyUpgradeData(ctx, chainID1, upgradeData1) + actualUpgradeData1, found := axelarcorkKeeper.GetAxelarProxyUpgradeData(ctx, chainID1) + require.True(found) + require.Equal(upgradeData1, actualUpgradeData1) + + axelarcorkKeeper.SetAxelarProxyUpgradeData(ctx, chainID2, upgradeData2) + var actualUpgradeData []types.AxelarUpgradeData + axelarcorkKeeper.IterateAxelarProxyUpgradeData(ctx, func(chainID uint64, ud types.AxelarUpgradeData) (stop bool) { + actualUpgradeData = append(actualUpgradeData, ud) + + return false + }) + require.Equal(actualUpgradeData[0], upgradeData1) + require.Equal(actualUpgradeData[1], upgradeData2) + + axelarcorkKeeper.DeleteAxelarProxyUpgradeData(ctx, chainID1) + _, found = axelarcorkKeeper.GetAxelarProxyUpgradeData(ctx, chainID1) + require.False(found) + +} diff --git a/x/axelarcork/keeper/msg_server.go b/x/axelarcork/keeper/msg_server.go new file mode 100644 index 00000000..17dcde93 --- /dev/null +++ b/x/axelarcork/keeper/msg_server.go @@ -0,0 +1,212 @@ +package keeper + +import ( + "context" + "encoding/hex" + "encoding/json" + "fmt" + "strconv" + "time" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + "github.com/ethereum/go-ethereum/common" + + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +var _ types.MsgServer = Keeper{} + +// ScheduleCork implements types.MsgServer +func (k Keeper) ScheduleCork(c context.Context, msg *types.MsgScheduleAxelarCorkRequest) (*types.MsgScheduleAxelarCorkResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + if !k.GetParamSet(ctx).Enabled { + return nil, types.ErrDisabled + } + + signer := msg.MustGetSigner() + validatorAddr := k.gravityKeeper.GetOrchestratorValidatorAddress(ctx, signer) + if validatorAddr == nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "signer %s is not a delegate", signer.String()) + } + + config, ok := k.GetChainConfigurationByID(ctx, msg.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", msg.ChainId) + } + + if !k.HasCellarID(ctx, config.Id, common.HexToAddress(msg.Cork.TargetContractAddress)) { + return nil, types.ErrUnmanagedCellarAddress + } + + if msg.BlockHeight <= uint64(ctx.BlockHeight()) { + return nil, types.ErrSchedulingInThePast + } + + corkID := k.SetScheduledAxelarCork(ctx, config.Id, msg.BlockHeight, validatorAddr, *msg.Cork) + + if err := ctx.EventManager().EmitTypedEvent(&types.ScheduleCorkEvent{ + Signer: signer.String(), + Validator: validatorAddr.String(), + Cork: msg.Cork.String(), + BlockHeight: msg.BlockHeight, + ChainId: config.Id, + }); err != nil { + return nil, err + } + + return &types.MsgScheduleAxelarCorkResponse{Id: hex.EncodeToString(corkID)}, nil +} + +func (k Keeper) RelayCork(c context.Context, msg *types.MsgRelayAxelarCorkRequest) (*types.MsgRelayAxelarCorkResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + params := k.GetParamSet(ctx) + + if !params.Enabled { + return nil, types.ErrDisabled + } + + config, ok := k.GetChainConfigurationByID(ctx, msg.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", msg.ChainId) + } + + // winning cork will be deleted during the middleware pass + _, cork, ok := k.GetWinningAxelarCork(ctx, config.Id, common.HexToAddress(msg.TargetContractAddress)) + if !ok { + return nil, fmt.Errorf("no cork on chain %d found for address %s", config.Id, msg.TargetContractAddress) + } + + nonce := k.IncrementAxelarContractCallNonce(ctx, msg.ChainId, cork.TargetContractAddress) + payload, err := types.EncodeLogicCallArgs(msg.TargetContractAddress, nonce, cork.Deadline, cork.EncodedContractCall) + if err != nil { + return nil, err + } + + axelarMemo := types.AxelarBody{ + DestinationChain: config.Name, + DestinationAddress: config.ProxyAddress, + Payload: payload, + Type: types.PureMessage, + Fee: &types.Fee{ + Amount: strconv.FormatUint(msg.Fee, 10), + Recipient: params.ExecutorAccount, + }, + } + bz, err := json.Marshal(axelarMemo) + if err != nil { + return nil, err + } + + transferMsg := transfertypes.NewMsgTransfer( + params.IbcPort, + params.IbcChannel, + msg.Token, + msg.Signer, + params.GmpAccount, + clienttypes.ZeroHeight(), + uint64(ctx.BlockTime().Add(time.Duration(params.TimeoutDuration)).UnixNano()), + ) + transferMsg.Memo = string(bz) + _, err = k.transferKeeper.Transfer(c, transferMsg) + if err != nil { + return nil, err + } + + return &types.MsgRelayAxelarCorkResponse{}, nil +} + +// RelayProxyUpgrade prepares the payload for IBC transfer if the current blockheight meets +// the payload's execution threshold, and then deletes the upgrade data. +func (k Keeper) RelayProxyUpgrade(c context.Context, msg *types.MsgRelayAxelarProxyUpgradeRequest) (*types.MsgRelayAxelarProxyUpgradeResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + params := k.GetParamSet(ctx) + + if !params.Enabled { + return nil, types.ErrDisabled + } + + config, ok := k.GetChainConfigurationByID(ctx, msg.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", msg.ChainId) + } + + upgradeData, found := k.GetAxelarProxyUpgradeData(ctx, msg.ChainId) + if !found { + return nil, fmt.Errorf("no proxy upgrade data found for chain %d", msg.ChainId) + } + + if ctx.BlockHeight() < upgradeData.ExecutableHeightThreshold { + return nil, fmt.Errorf("proxy upgrade call is not executable until height %d", upgradeData.ExecutableHeightThreshold) + } + + axelarMemo := types.AxelarBody{ + DestinationChain: config.Name, + DestinationAddress: config.ProxyAddress, + Payload: upgradeData.Payload, + Type: types.PureMessage, + Fee: &types.Fee{ + Amount: strconv.FormatUint(msg.Fee, 10), + Recipient: params.ExecutorAccount, + }, + } + bz, err := json.Marshal(axelarMemo) + if err != nil { + return nil, err + } + + transferMsg := transfertypes.NewMsgTransfer( + params.IbcPort, + params.IbcChannel, + msg.Token, + msg.Signer, + params.GmpAccount, + clienttypes.ZeroHeight(), + uint64(ctx.BlockTime().Add(time.Duration(params.TimeoutDuration)).UnixNano()), + ) + transferMsg.Memo = string(bz) + _, err = k.transferKeeper.Transfer(c, transferMsg) + if err != nil { + return nil, err + } + + k.DeleteAxelarProxyUpgradeData(ctx, msg.ChainId) + + return &types.MsgRelayAxelarProxyUpgradeResponse{}, nil +} + +func (k Keeper) BumpCorkGas(c context.Context, msg *types.MsgBumpAxelarCorkGasRequest) (*types.MsgBumpAxelarCorkGasResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + params := k.GetParamSet(ctx) + + if !params.Enabled { + return nil, types.ErrDisabled + } + + transferMsg := transfertypes.NewMsgTransfer( + params.IbcPort, + params.IbcChannel, + msg.Token, + msg.Signer, + params.ExecutorAccount, + clienttypes.ZeroHeight(), + uint64(ctx.BlockTime().Add(time.Duration(params.TimeoutDuration)).UnixNano()), + ) + transferMsg.Memo = msg.MessageId + _, err := k.transferKeeper.Transfer(c, transferMsg) + if err != nil { + return nil, err + } + + return &types.MsgBumpAxelarCorkGasResponse{}, nil +} + +func (k Keeper) CancelScheduledCork(c context.Context, msg *types.MsgCancelAxelarCorkRequest) (*types.MsgCancelAxelarCorkResponse, error) { + + // todo: implement + + return &types.MsgCancelAxelarCorkResponse{}, nil +} diff --git a/x/axelarcork/keeper/packet.go b/x/axelarcork/keeper/packet.go new file mode 100644 index 00000000..d42b5475 --- /dev/null +++ b/x/axelarcork/keeper/packet.go @@ -0,0 +1,112 @@ +package keeper + +import ( + "bytes" + "encoding/json" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +func (k Keeper) ValidateAxelarPacket(ctx sdk.Context, packet ibcexported.PacketI) error { + params := k.GetParamSet(ctx) + if !params.Enabled { + return nil + } + + // check if this is a call to axelar, exit early if this isn't axelar + channelID := packet.GetDestChannel() + if channelID != params.IbcChannel { + return nil + } + + // Parse the data from the packet + var packetData transfertypes.FungibleTokenPacketData + packetDataBz := packet.GetData() + if err := json.Unmarshal(packetDataBz, &packetData); err != nil { + return err + } + + // if we are not sending to the axelar gmp management account, we can skip + if packetData.Receiver != params.GmpAccount { + return nil + } + + // if the memo field is empty, we can pass the message along + if packetData.Memo == "" { + return nil + } + + var axelarBody types.AxelarBody + if err := json.Unmarshal([]byte(packetData.Memo), &axelarBody); err != nil { + return err + } + + // get the destination chain configuration + chainConfig, ok := k.GetChainConfigurationByName(ctx, axelarBody.DestinationChain) + if !ok { + return fmt.Errorf("configuration not found for chain %s", axelarBody.DestinationChain) + } + + if chainConfig.ProxyAddress != axelarBody.DestinationAddress { + return fmt.Errorf("msg cannot bypass the proxy. expected addr %s, received %s", chainConfig.ProxyAddress, axelarBody.DestinationAddress) + } + + // Validate logic call + if targetContract, nonce, _, callData, err := types.DecodeLogicCallArgs(axelarBody.Payload); err == nil { + if nonce == 0 { + return fmt.Errorf("nonce cannot be zero") + } + + blockHeight, winningCork, ok := k.GetWinningAxelarCork(ctx, chainConfig.Id, common.HexToAddress(targetContract)) + if !ok { + return fmt.Errorf("no cork expected for chain %s:%d at address %s", chainConfig.Name, chainConfig.Id, axelarBody.DestinationAddress) + } + + if !bytes.Equal(winningCork.EncodedContractCall, callData) { + return fmt.Errorf("cork body did not match expected body. received: %x, expected: %x", callData, winningCork.EncodedContractCall) + } + + // all checks have passed, delete the cork from state + k.DeleteWinningAxelarCorkByBlockheight(ctx, chainConfig.Id, blockHeight, winningCork) + + return nil + } + + // Validate upgrade + if newProxyContract, targets, err := types.DecodeUpgradeArgs(axelarBody.Payload); err == nil { + if !common.IsHexAddress(newProxyContract) { + return fmt.Errorf("invalid proxy address %s", newProxyContract) + } + + if len(targets) == 0 { + return fmt.Errorf("no targets provided") + } + + for _, target := range targets { + if !common.IsHexAddress(target) { + return fmt.Errorf("invalid target %s", target) + } + } + + upgradeData, ok := k.GetAxelarProxyUpgradeData(ctx, chainConfig.Id) + if !ok { + return fmt.Errorf("no upgrade data expected for chain %s:%d", chainConfig.Name, chainConfig.Id) + } + + if !bytes.Equal(upgradeData.Payload, axelarBody.Payload) { + return fmt.Errorf("upgrade data did not match expected data. received: %s, expected: %s", axelarBody.Payload, upgradeData.Payload) + } + + // all checks have passed, delete the upgrade data from state + k.DeleteAxelarProxyUpgradeData(ctx, chainConfig.Id) + + return nil + } + + return fmt.Errorf("invalid payload: %s", axelarBody.Payload) +} diff --git a/x/axelarcork/keeper/proposal_handler.go b/x/axelarcork/keeper/proposal_handler.go new file mode 100644 index 00000000..aac59e75 --- /dev/null +++ b/x/axelarcork/keeper/proposal_handler.go @@ -0,0 +1,203 @@ +package keeper + +import ( + "encoding/json" + "fmt" + "sort" + "time" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +// HandleAddManagedCellarsProposal is a handler for executing a passed community cellar addition proposal +func HandleAddManagedCellarsProposal(ctx sdk.Context, k Keeper, p types.AddAxelarManagedCellarIDsProposal) error { + config, ok := k.GetChainConfigurationByID(ctx, p.ChainId) + if !ok { + return fmt.Errorf("chain by id %d not found", p.ChainId) + } + + cellarIDs := k.GetCellarIDs(ctx, config.Id) + + for _, proposedCellarID := range p.CellarIds.Ids { + found := false + for _, id := range cellarIDs { + if id == common.HexToAddress(proposedCellarID) { + found = true + } + } + if !found { + cellarIDs = append(cellarIDs, common.HexToAddress(proposedCellarID)) + } + } + + idStrings := make([]string, len(cellarIDs)) + for i, cid := range cellarIDs { + idStrings[i] = cid.String() + } + + sort.Strings(idStrings) + k.SetCellarIDs(ctx, config.Id, types.CellarIDSet{Ids: idStrings}) + + return nil +} + +// HandleRemoveManagedCellarsProposal is a handler for executing a passed community cellar removal proposal +func HandleRemoveManagedCellarsProposal(ctx sdk.Context, k Keeper, p types.RemoveAxelarManagedCellarIDsProposal) error { + config, ok := k.GetChainConfigurationByID(ctx, p.ChainId) + if !ok { + return fmt.Errorf("chain by id %d not found", p.ChainId) + } + + var outputCellarIDs types.CellarIDSet + + for _, existingID := range k.GetCellarIDs(ctx, config.Id) { + found := false + for _, inputID := range p.CellarIds.Ids { + if existingID == common.HexToAddress(inputID) { + found = true + } + } + + if !found { + outputCellarIDs.Ids = append(outputCellarIDs.Ids, existingID.Hex()) + } + } + k.SetCellarIDs(ctx, config.Id, outputCellarIDs) + + return nil +} + +// HandleScheduledCorkProposal is a handler for executing a passed scheduled cork proposal +func HandleScheduledCorkProposal(ctx sdk.Context, k Keeper, p types.AxelarScheduledCorkProposal) error { + config, ok := k.GetChainConfigurationByID(ctx, p.ChainId) + if !ok { + return fmt.Errorf("chain by id %d not found", p.ChainId) + } + + if !k.HasCellarID(ctx, config.Id, common.HexToAddress(p.TargetContractAddress)) { + return sdkerrors.Wrapf(types.ErrUnmanagedCellarAddress, "id: %s", p.TargetContractAddress) + } + + return nil +} + +func HandleCommunityPoolSpendProposal(ctx sdk.Context, k Keeper, p types.AxelarCommunityPoolSpendProposal) error { + feePool := k.distributionKeeper.GetFeePool(ctx) + + // NOTE the community pool isn't a module account, however its coins + // are held in the distribution module account. Thus, the community pool + // must be reduced separately from the Axelar IBC calls + newPool, negative := feePool.CommunityPool.SafeSub(sdk.NewDecCoinsFromCoins(p.Amount)) + if negative { + return distributiontypes.ErrBadDistribution + } + + feePool.CommunityPool = newPool + sender := authtypes.NewModuleAddress(distributiontypes.ModuleName) + + params := k.GetParamSet(ctx) + config, ok := k.GetChainConfigurationByID(ctx, p.ChainId) + if !ok { + return fmt.Errorf("chain by id %d not found", p.ChainId) + } + + axelarMemo := types.AxelarBody{ + DestinationChain: config.Name, + DestinationAddress: p.Recipient, + Payload: nil, + Type: types.PureTokenTransfer, + } + bz, err := json.Marshal(axelarMemo) + if err != nil { + return err + } + + transferMsg := transfertypes.NewMsgTransfer( + params.IbcPort, + params.IbcChannel, + p.Amount, + sender.String(), + p.Recipient, + clienttypes.ZeroHeight(), + uint64(ctx.BlockTime().Add(time.Duration(params.TimeoutDuration)).UnixNano()), + ) + transferMsg.Memo = string(bz) + resp, err := k.transferKeeper.Transfer(ctx.Context(), transferMsg) + if err != nil { + return err + } + + k.distributionKeeper.SetFeePool(ctx, feePool) + k.Logger(ctx).Info("transfer from the community pool issued to the axelar bridge", + "ibc sequence", resp, + "amount", p.Amount.String(), + "recipient", p.Recipient, + "chain", config.Name, + "sender", sender.String(), + "timeout duration", params.TimeoutDuration, + ) + + return nil +} + +// HandleAddChainConfigurationProposal is a handler for executing a passed chain configuration addition proposal +func HandleAddChainConfigurationProposal(ctx sdk.Context, k Keeper, p types.AddChainConfigurationProposal) error { + k.SetChainConfiguration(ctx, p.ChainConfiguration.Id, *p.ChainConfiguration) + + return nil +} + +// HandleRemoveChainConfigurationProposal is a handler for executing a passed chain configuration removal proposal +func HandleRemoveChainConfigurationProposal(ctx sdk.Context, k Keeper, p types.RemoveChainConfigurationProposal) error { + k.DeleteChainConfigurationByID(ctx, p.ChainId) + + return nil +} + +// HandleUpgradeAxelarProxyContractProposal is a handler for executing a passed axelar proxy contract upgrade proposal +func HandleUpgradeAxelarProxyContractProposal(ctx sdk.Context, k Keeper, p types.UpgradeAxelarProxyContractProposal) error { + _, ok := k.GetChainConfigurationByID(ctx, p.ChainId) + if !ok { + return fmt.Errorf("chain by id %d not found", p.ChainId) + } + + cellars := []string{} + for _, c := range k.GetCellarIDs(ctx, p.ChainId) { + cellars = append(cellars, c.Hex()) + } + + payload, err := types.EncodeUpgradeArgs(p.NewProxyAddress, cellars) + if err != nil { + return err + } + + upgradeData := types.AxelarUpgradeData{ + Payload: payload, + ExecutableHeightThreshold: ctx.BlockHeight() + int64(types.DefaultExecutableHeightThreshold), + } + + k.SetAxelarProxyUpgradeData(ctx, p.ChainId, upgradeData) + + return nil +} + +// HandleCancelAxelarProxyContractUpgradeProposal is a handler for deleting axelar proxy contract upgrade data before the +// executable height threshold is reached. +func HandleCancelAxelarProxyContractUpgradeProposal(ctx sdk.Context, k Keeper, p types.CancelAxelarProxyContractUpgradeProposal) error { + _, ok := k.GetChainConfigurationByID(ctx, p.ChainId) + if !ok { + return fmt.Errorf("chain id %d not found", p.ChainId) + } + + k.DeleteAxelarProxyUpgradeData(ctx, p.ChainId) + + return nil +} diff --git a/x/axelarcork/keeper/query_server.go b/x/axelarcork/keeper/query_server.go new file mode 100644 index 00000000..0171b703 --- /dev/null +++ b/x/axelarcork/keeper/query_server.go @@ -0,0 +1,250 @@ +package keeper + +import ( + "context" + "encoding/hex" + "fmt" + + "github.com/ethereum/go-ethereum/common" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +var _ types.QueryServer = Keeper{} + +// QueryParams implements QueryServer +func (k Keeper) QueryParams(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + return &types.QueryParamsResponse{ + Params: k.GetParamSet(sdk.UnwrapSDKContext(c)), + }, nil +} + +func (k Keeper) QueryCellarIDs(c context.Context, req *types.QueryCellarIDsRequest) (*types.QueryCellarIDsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + response := &types.QueryCellarIDsResponse{ + CellarIds: []*types.CellarIDSet{}, + } + k.IterateChainConfigurations(ctx, func(config types.ChainConfiguration) (stop bool) { + set := types.CellarIDSet{Chain: &config, Ids: []string{}} + for _, id := range k.GetCellarIDs(ctx, config.Id) { + set.Ids = append(set.Ids, id.Hex()) + } + + response.CellarIds = append(response.CellarIds, &set) + + return false + }) + + return response, nil +} + +func (k Keeper) QueryCellarIDsByChainID(c context.Context, req *types.QueryCellarIDsByChainIDRequest) (*types.QueryCellarIDsByChainIDResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + config, ok := k.GetChainConfigurationByID(ctx, req.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", req.ChainId) + } + + response := &types.QueryCellarIDsByChainIDResponse{} + for _, id := range k.GetCellarIDs(ctx, config.Id) { + response.CellarIds = append(response.CellarIds, id.Hex()) + } + + return response, nil +} + +func (k Keeper) QueryScheduledCorks(c context.Context, req *types.QueryScheduledCorksRequest) (*types.QueryScheduledCorksResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + config, ok := k.GetChainConfigurationByID(ctx, req.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", req.ChainId) + } + + response := types.QueryScheduledCorksResponse{} + + k.IterateScheduledAxelarCorks(ctx, config.Id, func(val sdk.ValAddress, blockHeight uint64, id []byte, cel common.Address, deadline uint64, cork types.AxelarCork) (stop bool) { + response.Corks = append(response.Corks, &types.ScheduledAxelarCork{ + Cork: &cork, + BlockHeight: blockHeight, + Validator: val.String(), + Id: hex.EncodeToString(id), + }) + return false + }) + return &response, nil +} + +func (k Keeper) QueryScheduledBlockHeights(c context.Context, req *types.QueryScheduledBlockHeightsRequest) (*types.QueryScheduledBlockHeightsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + config, ok := k.GetChainConfigurationByID(ctx, req.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", req.ChainId) + } + + response := types.QueryScheduledBlockHeightsResponse{} + response.BlockHeights = k.GetScheduledBlockHeights(ctx, config.Id) + return &response, nil +} + +func (k Keeper) QueryScheduledCorksByBlockHeight(c context.Context, req *types.QueryScheduledCorksByBlockHeightRequest) (*types.QueryScheduledCorksByBlockHeightResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + config, ok := k.GetChainConfigurationByID(ctx, req.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", req.ChainId) + } + + response := types.QueryScheduledCorksByBlockHeightResponse{} + response.Corks = k.GetScheduledAxelarCorksByBlockHeight(ctx, config.Id, req.BlockHeight) + return &response, nil +} + +func (k Keeper) QueryScheduledCorksByID(c context.Context, req *types.QueryScheduledCorksByIDRequest) (*types.QueryScheduledCorksByIDResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + config, ok := k.GetChainConfigurationByID(ctx, req.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", req.ChainId) + } + + id, err := hex.DecodeString(req.Id) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "Failed to decode %s from hexadecimal to bytes", req.Id) + } + + response := types.QueryScheduledCorksByIDResponse{} + response.Corks = k.GetScheduledAxelarCorksByID(ctx, config.Id, id) + return &response, nil +} + +func (k Keeper) QueryCorkResult(c context.Context, req *types.QueryCorkResultRequest) (*types.QueryCorkResultResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + config, ok := k.GetChainConfigurationByID(ctx, req.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", req.ChainId) + } + + id, err := hex.DecodeString(req.Id) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "Failed to decode %s from hexadecimal to bytes", req.Id) + } + + response := types.QueryCorkResultResponse{} + var found bool + result, found := k.GetAxelarCorkResult(ctx, config.Id, id) + if !found { + return &types.QueryCorkResultResponse{}, status.Errorf(codes.NotFound, "No cork result found for id: %s", req.GetId()) + } + response.CorkResult = &result + + return &response, nil +} + +func (k Keeper) QueryCorkResults(c context.Context, req *types.QueryCorkResultsRequest) (*types.QueryCorkResultsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + config, ok := k.GetChainConfigurationByID(ctx, req.ChainId) + if !ok { + return nil, fmt.Errorf("chain by id %d not found", req.ChainId) + } + + response := types.QueryCorkResultsResponse{} + response.CorkResults = k.GetAxelarCorkResults(ctx, config.Id) + return &response, nil +} + +func (k Keeper) QueryChainConfigurations(c context.Context, req *types.QueryChainConfigurationsRequest) (*types.QueryChainConfigurationsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + var chainConfigurations []*types.ChainConfiguration + k.IterateChainConfigurations(ctx, func(config types.ChainConfiguration) (stop bool) { + chainConfigurations = append(chainConfigurations, &config) + return false + }) + + return &types.QueryChainConfigurationsResponse{Configurations: chainConfigurations}, nil +} + +func (k Keeper) QueryAxelarContractCallNonces(c context.Context, req *types.QueryAxelarContractCallNoncesRequest) (*types.QueryAxelarContractCallNoncesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + + response := types.QueryAxelarContractCallNoncesResponse{} + + nonces := []*types.AxelarContractCallNonce{} + k.IterateAxelarContractCallNonces(ctx, func(chainID uint64, address common.Address, nonce uint64) (stop bool) { + nonces = append(nonces, &types.AxelarContractCallNonce{ + ChainId: chainID, + ContractAddress: address.Hex(), + Nonce: nonce, + }) + + return false + }) + + response.ContractCallNonces = nonces + + return &response, nil +} + +func (k Keeper) QueryAxelarProxyUpgradeData(c context.Context, req *types.QueryAxelarProxyUpgradeDataRequest) (*types.QueryAxelarProxyUpgradeDataResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + + response := types.QueryAxelarProxyUpgradeDataResponse{} + + upgradeData := []*types.AxelarUpgradeData{} + k.IterateAxelarProxyUpgradeData(ctx, func(chainID uint64, data types.AxelarUpgradeData) (stop bool) { + upgradeData = append(upgradeData, &data) + return false + }) + + response.ProxyUpgradeData = upgradeData + + return &response, nil +} diff --git a/x/axelarcork/keeper/query_server_test.go b/x/axelarcork/keeper/query_server_test.go new file mode 100644 index 00000000..8aa22f7d --- /dev/null +++ b/x/axelarcork/keeper/query_server_test.go @@ -0,0 +1,167 @@ +package keeper + +import ( + "encoding/hex" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" +) + +const TestEVMChainID = 2 + +func (suite *KeeperTestSuite) TestQueriesHappyPath() { + ctx, axelarcorkKeeper := suite.ctx, suite.axelarcorkKeeper + require := suite.Require() + + testGMPAccount := authtypes.NewModuleAddress("test-gmp-account") + + params := types.Params{ + IbcChannel: "test-ibc-channel", + IbcPort: "test-ibc-port", + GmpAccount: testGMPAccount.String(), + ExecutorAccount: "test-executor-account", + TimeoutDuration: 10, + } + axelarcorkKeeper.SetParams(ctx, params) + + chainConfig := types.ChainConfiguration{ + Name: "testevm", + Id: TestEVMChainID, + ProxyAddress: "0x123", + } + axelarcorkKeeper.SetChainConfiguration(ctx, TestEVMChainID, chainConfig) + + testHeight := uint64(ctx.BlockHeight()) + cork := types.AxelarCork{ + EncodedContractCall: []byte("testcall"), + TargetContractAddress: sampleCellarHex, + ChainId: TestEVMChainID, + } + id := cork.IDHash(testHeight) + + val := sdk.ValAddress("12345678901234567890") + expectedScheduledCork := types.ScheduledAxelarCork{ + Cork: &cork, + BlockHeight: testHeight, + Validator: "cosmosvaloper1xyerxdp4xcmnswfsxyerxdp4xcmnswfs008wpw", + Id: hex.EncodeToString(id), + } + axelarcorkKeeper.SetScheduledAxelarCork(ctx, TestEVMChainID, testHeight, val, cork) + + corkResult := types.AxelarCorkResult{ + Cork: &cork, + BlockHeight: testHeight, + Approved: true, + ApprovalPercentage: "100.00", + } + axelarcorkKeeper.SetAxelarCorkResult(ctx, TestEVMChainID, id, corkResult) + + ids := []string{"0x0000000000000000000000000000000000000000", "0x1111111111111111111111111111111111111111"} + axelarcorkKeeper.SetCellarIDs(ctx, TestEVMChainID, types.CellarIDSet{Ids: ids}) + + nonce := types.AxelarContractCallNonce{ + Nonce: 1, + ChainId: TestEVMChainID, + ContractAddress: sampleCellarHex, + } + axelarcorkKeeper.SetAxelarContractCallNonce(ctx, TestEVMChainID, sampleCellarHex, nonce.Nonce) + + upgradeData := types.AxelarUpgradeData{ + ChainId: TestEVMChainID, + Payload: []byte("test-payload"), + ExecutableHeightThreshold: 100, + } + axelarcorkKeeper.SetAxelarProxyUpgradeData(ctx, TestEVMChainID, upgradeData) + + paramsResult, err := axelarcorkKeeper.QueryParams(sdk.WrapSDKContext(ctx), &types.QueryParamsRequest{}) + require.Nil(err) + require.Equal(params, paramsResult.Params) + + scheduledCorksResult, err := axelarcorkKeeper.QueryScheduledCorks(sdk.WrapSDKContext(ctx), &types.QueryScheduledCorksRequest{ChainId: TestEVMChainID}) + require.Nil(err) + require.Equal(&expectedScheduledCork, scheduledCorksResult.Corks[0]) + + scheduledCorksByHeightResult, err := axelarcorkKeeper.QueryScheduledCorksByBlockHeight(sdk.WrapSDKContext(ctx), + &types.QueryScheduledCorksByBlockHeightRequest{ + BlockHeight: testHeight, + ChainId: TestEVMChainID, + }) + require.Nil(err) + require.Equal(&expectedScheduledCork, scheduledCorksByHeightResult.Corks[0]) + + scheduledCorksByIDResult, err := axelarcorkKeeper.QueryScheduledCorksByID(sdk.WrapSDKContext(ctx), + &types.QueryScheduledCorksByIDRequest{ + Id: hex.EncodeToString(id), + ChainId: TestEVMChainID, + }) + require.Nil(err) + require.Equal(&expectedScheduledCork, scheduledCorksByIDResult.Corks[0]) + + blockHeightResult, err := axelarcorkKeeper.QueryScheduledBlockHeights(sdk.WrapSDKContext(ctx), &types.QueryScheduledBlockHeightsRequest{ChainId: TestEVMChainID}) + require.Nil(err) + require.Equal(testHeight, blockHeightResult.BlockHeights[0]) + + corkResultResult, err := axelarcorkKeeper.QueryCorkResult(sdk.WrapSDKContext(ctx), &types.QueryCorkResultRequest{Id: hex.EncodeToString(id), ChainId: TestEVMChainID}) + require.Nil(err) + require.Equal(&corkResult, corkResultResult.CorkResult) + + corkResultsResult, err := axelarcorkKeeper.QueryCorkResults(sdk.WrapSDKContext(ctx), &types.QueryCorkResultsRequest{ChainId: TestEVMChainID}) + require.Nil(err) + require.Equal(&corkResult, corkResultsResult.CorkResults[0]) + + cellarIDsResult, err := axelarcorkKeeper.QueryCellarIDs(sdk.WrapSDKContext(ctx), &types.QueryCellarIDsRequest{}) + require.Nil(err) + expectedCellarIDSet := []*types.CellarIDSet{{Ids: ids, Chain: &chainConfig}} + require.Equal(expectedCellarIDSet, cellarIDsResult.CellarIds) + + cellarIDsByChainIDResult, err := axelarcorkKeeper.QueryCellarIDsByChainID(sdk.WrapSDKContext(ctx), &types.QueryCellarIDsByChainIDRequest{ChainId: TestEVMChainID}) + require.Nil(err) + require.Equal(expectedCellarIDSet[0].Ids, cellarIDsByChainIDResult.CellarIds) + + noncesResult, err := axelarcorkKeeper.QueryAxelarContractCallNonces(sdk.WrapSDKContext(ctx), &types.QueryAxelarContractCallNoncesRequest{}) + require.Nil(err) + require.Equal(&nonce, noncesResult.ContractCallNonces[0]) + + upgradeDataResult, err := axelarcorkKeeper.QueryAxelarProxyUpgradeData(sdk.WrapSDKContext(ctx), &types.QueryAxelarProxyUpgradeDataRequest{}) + require.Nil(err) + require.Equal(&upgradeData, upgradeDataResult.ProxyUpgradeData[0]) +} + +func (suite *KeeperTestSuite) TestQueriesUnhappyPath() { + ctx, axelarcorkKeeper := suite.ctx, suite.axelarcorkKeeper + require := suite.Require() + + paramsResult, err := axelarcorkKeeper.QueryParams(sdk.WrapSDKContext(ctx), nil) + require.Nil(paramsResult) + require.NotNil(err) + + scheduledCorksResult, err := axelarcorkKeeper.QueryScheduledCorks(sdk.WrapSDKContext(ctx), nil) + require.Nil(scheduledCorksResult) + require.NotNil(err) + + scheduledCorksByHeightResult, err := axelarcorkKeeper.QueryScheduledCorksByBlockHeight(sdk.WrapSDKContext(ctx), nil) + require.Nil(scheduledCorksByHeightResult) + require.NotNil(err) + + scheduledCorksByIDResult, err := axelarcorkKeeper.QueryScheduledCorksByID(sdk.WrapSDKContext(ctx), nil) + require.Nil(scheduledCorksByIDResult) + require.NotNil(err) + + blockHeightResult, err := axelarcorkKeeper.QueryScheduledBlockHeights(sdk.WrapSDKContext(ctx), nil) + require.Nil(blockHeightResult) + require.NotNil(err) + + corkResultResult, err := axelarcorkKeeper.QueryCorkResult(sdk.WrapSDKContext(ctx), nil) + require.Nil(corkResultResult) + require.NotNil(err) + + corkResultsResult, err := axelarcorkKeeper.QueryCorkResults(sdk.WrapSDKContext(ctx), nil) + require.Nil(corkResultsResult) + require.NotNil(err) + + noncesResult, err := axelarcorkKeeper.QueryAxelarContractCallNonces(sdk.WrapSDKContext(ctx), nil) + require.Nil(noncesResult) + require.NotNil(err) +} diff --git a/x/axelarcork/keeper/setup_unit_test.go b/x/axelarcork/keeper/setup_unit_test.go new file mode 100644 index 00000000..d7bd36c5 --- /dev/null +++ b/x/axelarcork/keeper/setup_unit_test.go @@ -0,0 +1,143 @@ +package keeper + +import ( + "reflect" + "testing" + + "github.com/peggyjv/sommelier/v7/x/axelarcork/tests/mocks" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + + "github.com/golang/mock/gomock" + + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmdb "github.com/tendermint/tm-db" +) + +type mocksForCork struct { + mockStakingKeeper *mocks.MockStakingKeeper + mockValidator *mocks.MockValidatorI +} + +func setupCorkKeeper(t *testing.T) ( + Keeper, sdk.Context, mocksForCork, *gomock.Controller, +) { + db := tmdb.NewMemDB() + commitMultiStore := store.NewCommitMultiStore(db) + + // Mount the KV store with the x/cork store key + storeKey := sdk.NewKVStoreKey(types.StoreKey) + commitMultiStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) + + // Mount Transient store + transientStoreKey := sdk.NewTransientStoreKey("transient" + types.StoreKey) + commitMultiStore.MountStoreWithDB(transientStoreKey, sdk.StoreTypeTransient, nil) + + // Mount Memory store + memStoreKey := storetypes.NewMemoryStoreKey("mem" + types.StoreKey) + commitMultiStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) + + require.NoError(t, commitMultiStore.LoadLatestVersion()) + protoCodec := codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + params := initParamsKeeper( + protoCodec, codec.NewLegacyAmino(), storeKey, memStoreKey) + + subSpace, found := params.GetSubspace(types.ModuleName) + require.True(t, found) + + ctrl := gomock.NewController(t) + mockAccountKeeper := mocks.NewMockAccountKeeper(ctrl) + mockStakingKeeper := mocks.NewMockStakingKeeper(ctrl) + mockTransferKeeper := mocks.NewMockTransferKeeper(ctrl) + mockDistributionKeeper := mocks.NewMockDistributionKeeper(ctrl) + mockICS4wrapper := mocks.NewMockICS4Wrapper(ctrl) + mockGravityKeeper := mocks.NewMockGravityKeeper(ctrl) + + k := NewKeeper( + protoCodec, + storeKey, + subSpace, + mockAccountKeeper, + mockStakingKeeper, + mockTransferKeeper, + mockDistributionKeeper, + mockICS4wrapper, + mockGravityKeeper, + ) + + ctx := sdk.NewContext(commitMultiStore, tmproto.Header{}, false, log.NewNopLogger()) + + return k, ctx, mocksForCork{ + mockStakingKeeper: mockStakingKeeper, + mockValidator: mocks.NewMockValidatorI(ctrl), + }, ctrl +} + +func initParamsKeeper( + appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, + key sdk.StoreKey, tkey sdk.StoreKey, +) paramskeeper.Keeper { + paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) + paramsKeeper.Subspace(types.ModuleName) + + return paramsKeeper +} + +func TestSetupCorkKeepers(t *testing.T) { + testCases := []struct { + name string + test func() + }{{ + name: "make sure that mocks implement expected keepers interfaces", + test: func() { + k, ctx, mocks, ctrl := setupCorkKeeper(t) + require.PanicsWithError(t, "UnmarshalJSON cannot decode empty bytes", + func() { + params := k.GetParamSet(ctx) + require.NoError(t, params.ValidateBasic()) + }, + ) + + for _, keeperPair := range []struct { + expected interface{} + mock interface{} + }{ + { + expected: (*types.StakingKeeper)(nil), + mock: mocks.mockStakingKeeper, + }, + { + expected: (*stakingtypes.ValidatorI)(nil), + mock: mocks.mockValidator, + }, + } { + _interface := reflect.TypeOf(keeperPair.expected).Elem() + isImplementingExpectedMethods := reflect. + TypeOf(keeperPair.mock).Implements(_interface) + assert.True(t, isImplementingExpectedMethods) + } + + defer ctrl.Finish() + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + tc.test() + }) + } + +} diff --git a/x/axelarcork/module.go b/x/axelarcork/module.go new file mode 100644 index 00000000..591b2b34 --- /dev/null +++ b/x/axelarcork/module.go @@ -0,0 +1,175 @@ +package axelarcork + +import ( + "context" + "encoding/json" + "math/rand" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + sim "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/peggyjv/sommelier/v7/x/axelarcork/client/cli" + "github.com/peggyjv/sommelier/v7/x/axelarcork/keeper" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleSimulation = AppModule{} +) + +// AppModuleBasic defines the basic application module used by the cork module. +type AppModuleBasic struct{} + +// Name returns the cork module's name +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec doesn't support amino +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +// DefaultGenesis returns default genesis state as raw bytes for the oracle +// module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + gs := types.DefaultGenesisState() + return cdc.MustMarshalJSON(&gs) +} + +// ValidateGenesis performs genesis state validation for the cork module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var gs types.GenesisState + if err := cdc.UnmarshalJSON(bz, &gs); err != nil { + return err + } + return gs.Validate() +} + +// RegisterRESTRoutes doesn't support legacy REST routes. +// We don't want to support the legacy rest server here +func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} + +// GetTxCmd returns the root tx command for the cork module. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the root query command for the cork module. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the cork module. +// also implements app modeul basic +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) +} + +// RegisterInterfaces implements app module basic +func (b AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +// AppModule implements an application module for the cork module. +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper + cdc codec.Codec +} + +// NewAppModule creates a new AppModule object +func NewAppModule(keeper keeper.Keeper, cdc codec.Codec) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{}, + keeper: keeper, + cdc: cdc, + } +} + +// Name returns the cork module's name. +func (AppModule) Name() string { return types.ModuleName } + +// RegisterInvariants performs a no-op. +func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// Route returns the message routing key for the cork module. +func (am AppModule) Route() sdk.Route { return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) } + +// QuerierRoute returns the cork module's querier route name. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// LegacyQuerierHandler returns a nil Querier. +func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { + return nil +} + +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { + return 1 +} + +func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation { + return nil +} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// InitGenesis performs genesis initialization for the cork module. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + keeper.InitGenesis(ctx, am.keeper, genesisState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the exported genesis state as raw bytes for the oracle +// module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genesisState := keeper.ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(&genesisState) +} + +// BeginBlock returns the begin blocker for the cork module. +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + am.keeper.BeginBlocker(ctx) +} + +// EndBlock returns the end blocker for the cork module. +func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + am.keeper.EndBlocker(ctx) + return []abci.ValidatorUpdate{} +} + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the cork module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { +} + +// ProposalContents returns all the cork content functions used to +// simulate governance proposals. +func (am AppModule) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized cork param changes for the simulator. +func (AppModule) RandomizedParams(r *rand.Rand) []sim.ParamChange { + return nil +} + +// RegisterStoreDecoder registers a decoder for cork module's types +func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { +} diff --git a/x/axelarcork/module_test.go b/x/axelarcork/module_test.go new file mode 100644 index 00000000..0e5c94ba --- /dev/null +++ b/x/axelarcork/module_test.go @@ -0,0 +1,153 @@ +package axelarcork_test + +import ( + "encoding/json" + "testing" + + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + "github.com/golang/mock/gomock" + "github.com/peggyjv/sommelier/v7/x/axelarcork/tests" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + "github.com/stretchr/testify/require" +) + +var ( + testDenom = "usomm" + testAmount = "100" + + testSourcePort = "sommelier" + testSourceChannel = "channel-1" + testDestinationPort = "axelar" + testDestinationChannel = "channel-2" +) + +func transferPacket(t *testing.T, receiver string, metadata any) channeltypes.Packet { + t.Helper() + transferPacket := transfertypes.FungibleTokenPacketData{ + Denom: testDenom, + Amount: testAmount, + Receiver: receiver, + } + + if metadata != nil { + if mStr, ok := metadata.(string); ok { + transferPacket.Memo = mStr + } else { + memo, err := json.Marshal(metadata) + require.NoError(t, err) + transferPacket.Memo = string(memo) + } + } + + transferData, err := transfertypes.ModuleCdc.MarshalJSON(&transferPacket) + require.NoError(t, err) + + return channeltypes.Packet{ + SourcePort: testSourcePort, + SourceChannel: testSourceChannel, + DestinationPort: testDestinationPort, + DestinationChannel: testDestinationChannel, + Data: transferData, + } +} + +func TestSendPacket_NoMemo(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + + setup := tests.NewTestSetup(t, ctl) + ctx := setup.Initializer.Ctx + acMiddleware := setup.AxelarCorkMiddleware + + // Test data + packet := transferPacket(t, tests.TestGMPAccount.String(), "") + + // Expected mocks + gomock.InOrder( + setup.Mocks.ICS4WrapperMock.EXPECT().SendPacket(ctx, nil, packet). + Return(nil), + ) + + require.NoError(t, acMiddleware.SendPacket(ctx, nil, packet)) +} + +func TestSendPacket_NotAxelarChannel(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + + setup := tests.NewTestSetup(t, ctl) + ctx := setup.Initializer.Ctx + acMiddleware := setup.AxelarCorkMiddleware + + // Test data + packet := transferPacket(t, tests.TestGMPAccount.String(), "{}") + packet.DestinationChannel = "channel-other" + + // Expected mocks + gomock.InOrder( + setup.Mocks.ICS4WrapperMock.EXPECT().SendPacket(ctx, nil, packet). + Return(nil), + ) + + require.NoError(t, acMiddleware.SendPacket(ctx, nil, packet)) +} + +func TestSendPacket_NotGMPReceiver(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + + setup := tests.NewTestSetup(t, ctl) + ctx := setup.Initializer.Ctx + acMiddleware := setup.AxelarCorkMiddleware + + // Test data + packet := transferPacket(t, "cosmos16plylpsgxechajltx9yeseqexzdzut9g8vla4k", "{}") + + // Expected mocks + gomock.InOrder( + setup.Mocks.ICS4WrapperMock.EXPECT().SendPacket(ctx, nil, packet). + Return(nil), + ) + + require.NoError(t, acMiddleware.SendPacket(ctx, nil, packet)) +} + +func TestSendPacket_EmptyPayload(t *testing.T) { + ctl := gomock.NewController(t) + defer ctl.Finish() + + setup := tests.NewTestSetup(t, ctl) + ctx := setup.Initializer.Ctx + acMiddleware := setup.AxelarCorkMiddleware + + params := types.Params{ + Enabled: true, + IbcChannel: testDestinationChannel, + IbcPort: testDestinationPort, + GmpAccount: tests.TestGMPAccount.String(), + ExecutorAccount: "abc123", + TimeoutDuration: 10, + } + setup.Keepers.AxelarCorkKeeper.SetParams(ctx, params) + + ethChainConfig := types.ChainConfiguration{ + Name: "Ethereum", + Id: 1, + ProxyAddress: "test-proxy-addr", + } + setup.Keepers.AxelarCorkKeeper.SetChainConfiguration(ctx, 1, ethChainConfig) + + // Test data + acBody := types.AxelarBody{ + DestinationChain: "Ethereum", + DestinationAddress: "test-addr", + Payload: nil, + Type: 0, + Fee: nil, + } + packet := transferPacket(t, tests.TestGMPAccount.String(), acBody) + + // expect error for non-existent + require.Error(t, acMiddleware.SendPacket(ctx, nil, packet)) +} diff --git a/x/axelarcork/tests/address.go b/x/axelarcork/tests/address.go new file mode 100644 index 00000000..c58f25a6 --- /dev/null +++ b/x/axelarcork/tests/address.go @@ -0,0 +1,24 @@ +package tests + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +// AccAddress returns a random account address +func AccAddress() sdk.AccAddress { + pk := ed25519.GenPrivKey().PubKey() + addr := pk.Address() + return sdk.AccAddress(addr) +} + +func AccAddressFromBech32(t *testing.T, addr string) sdk.AccAddress { + t.Helper() + a, err := sdk.AccAddressFromBech32(addr) + require.NoError(t, err) + + return a +} diff --git a/x/axelarcork/tests/mocks/expected_keepers_mocks.go b/x/axelarcork/tests/mocks/expected_keepers_mocks.go new file mode 100644 index 00000000..1f099960 --- /dev/null +++ b/x/axelarcork/tests/mocks/expected_keepers_mocks.go @@ -0,0 +1,493 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/axelarcork/types/expected_keepers.go + +// Package mocks is a generated GoMock package. +package mocks + +import ( + context "context" + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/x/auth/types" + types1 "github.com/cosmos/cosmos-sdk/x/capability/types" + types2 "github.com/cosmos/cosmos-sdk/x/distribution/types" + types3 "github.com/cosmos/cosmos-sdk/x/staking/types" + types4 "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + types5 "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + exported "github.com/cosmos/ibc-go/v3/modules/core/exported" + gomock "github.com/golang/mock/gomock" +) + +// MockAccountKeeper is a mock of AccountKeeper interface. +type MockAccountKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountKeeperMockRecorder +} + +// MockAccountKeeperMockRecorder is the mock recorder for MockAccountKeeper. +type MockAccountKeeperMockRecorder struct { + mock *MockAccountKeeper +} + +// NewMockAccountKeeper creates a new mock instance. +func NewMockAccountKeeper(ctrl *gomock.Controller) *MockAccountKeeper { + mock := &MockAccountKeeper{ctrl: ctrl} + mock.recorder = &MockAccountKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountKeeper) EXPECT() *MockAccountKeeperMockRecorder { + return m.recorder +} + +// GetAccount mocks base method. +func (m *MockAccountKeeper) GetAccount(ctx types.Context, addr types.AccAddress) types0.AccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", ctx, addr) + ret0, _ := ret[0].(types0.AccountI) + return ret0 +} + +// GetAccount indicates an expected call of GetAccount. +func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetAccount), ctx, addr) +} + +// GetModuleAccount mocks base method. +func (m *MockAccountKeeper) GetModuleAccount(ctx types.Context, name string) types0.ModuleAccountI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAccount", ctx, name) + ret0, _ := ret[0].(types0.ModuleAccountI) + return ret0 +} + +// GetModuleAccount indicates an expected call of GetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAccount), ctx, name) +} + +// GetModuleAddress mocks base method. +func (m *MockAccountKeeper) GetModuleAddress(name string) types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetModuleAddress", name) + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetModuleAddress indicates an expected call of GetModuleAddress. +func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetModuleAddress", reflect.TypeOf((*MockAccountKeeper)(nil).GetModuleAddress), name) +} + +// SetModuleAccount mocks base method. +func (m *MockAccountKeeper) SetModuleAccount(arg0 types.Context, arg1 types0.ModuleAccountI) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetModuleAccount", arg0, arg1) +} + +// SetModuleAccount indicates an expected call of SetModuleAccount. +func (mr *MockAccountKeeperMockRecorder) SetModuleAccount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetModuleAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetModuleAccount), arg0, arg1) +} + +// MockICS4Wrapper is a mock of ICS4Wrapper interface. +type MockICS4Wrapper struct { + ctrl *gomock.Controller + recorder *MockICS4WrapperMockRecorder +} + +// MockICS4WrapperMockRecorder is the mock recorder for MockICS4Wrapper. +type MockICS4WrapperMockRecorder struct { + mock *MockICS4Wrapper +} + +// NewMockICS4Wrapper creates a new mock instance. +func NewMockICS4Wrapper(ctrl *gomock.Controller) *MockICS4Wrapper { + mock := &MockICS4Wrapper{ctrl: ctrl} + mock.recorder = &MockICS4WrapperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockICS4Wrapper) EXPECT() *MockICS4WrapperMockRecorder { + return m.recorder +} + +// SendPacket mocks base method. +func (m *MockICS4Wrapper) SendPacket(ctx types.Context, channelCap *types1.Capability, packet exported.PacketI) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendPacket", ctx, channelCap, packet) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendPacket indicates an expected call of SendPacket. +func (mr *MockICS4WrapperMockRecorder) SendPacket(ctx, channelCap, packet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPacket", reflect.TypeOf((*MockICS4Wrapper)(nil).SendPacket), ctx, channelCap, packet) +} + +// WriteAcknowledgement mocks base method. +func (m *MockICS4Wrapper) WriteAcknowledgement(ctx types.Context, chanCap *types1.Capability, packet exported.PacketI, acknowledgement exported.Acknowledgement) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteAcknowledgement", ctx, chanCap, packet, acknowledgement) + ret0, _ := ret[0].(error) + return ret0 +} + +// WriteAcknowledgement indicates an expected call of WriteAcknowledgement. +func (mr *MockICS4WrapperMockRecorder) WriteAcknowledgement(ctx, chanCap, packet, acknowledgement interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteAcknowledgement", reflect.TypeOf((*MockICS4Wrapper)(nil).WriteAcknowledgement), ctx, chanCap, packet, acknowledgement) +} + +// MockChannelKeeper is a mock of ChannelKeeper interface. +type MockChannelKeeper struct { + ctrl *gomock.Controller + recorder *MockChannelKeeperMockRecorder +} + +// MockChannelKeeperMockRecorder is the mock recorder for MockChannelKeeper. +type MockChannelKeeperMockRecorder struct { + mock *MockChannelKeeper +} + +// NewMockChannelKeeper creates a new mock instance. +func NewMockChannelKeeper(ctrl *gomock.Controller) *MockChannelKeeper { + mock := &MockChannelKeeper{ctrl: ctrl} + mock.recorder = &MockChannelKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockChannelKeeper) EXPECT() *MockChannelKeeperMockRecorder { + return m.recorder +} + +// GetChannel mocks base method. +func (m *MockChannelKeeper) GetChannel(ctx types.Context, portID, channelID string) (types5.Channel, bool) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetChannel", ctx, portID, channelID) + ret0, _ := ret[0].(types5.Channel) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// GetChannel indicates an expected call of GetChannel. +func (mr *MockChannelKeeperMockRecorder) GetChannel(ctx, portID, channelID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChannel", reflect.TypeOf((*MockChannelKeeper)(nil).GetChannel), ctx, portID, channelID) +} + +// GetChannelClientState mocks base method. +func (m *MockChannelKeeper) GetChannelClientState(ctx types.Context, portID, channelID string) (string, exported.ClientState, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetChannelClientState", ctx, portID, channelID) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(exported.ClientState) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetChannelClientState indicates an expected call of GetChannelClientState. +func (mr *MockChannelKeeperMockRecorder) GetChannelClientState(ctx, portID, channelID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChannelClientState", reflect.TypeOf((*MockChannelKeeper)(nil).GetChannelClientState), ctx, portID, channelID) +} + +// MockStakingKeeper is a mock of StakingKeeper interface. +type MockStakingKeeper struct { + ctrl *gomock.Controller + recorder *MockStakingKeeperMockRecorder +} + +// MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. +type MockStakingKeeperMockRecorder struct { + mock *MockStakingKeeper +} + +// NewMockStakingKeeper creates a new mock instance. +func NewMockStakingKeeper(ctrl *gomock.Controller) *MockStakingKeeper { + mock := &MockStakingKeeper{ctrl: ctrl} + mock.recorder = &MockStakingKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { + return m.recorder +} + +// GetBondedValidatorsByPower mocks base method. +func (m *MockStakingKeeper) GetBondedValidatorsByPower(ctx types.Context) []types3.Validator { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBondedValidatorsByPower", ctx) + ret0, _ := ret[0].([]types3.Validator) + return ret0 +} + +// GetBondedValidatorsByPower indicates an expected call of GetBondedValidatorsByPower. +func (mr *MockStakingKeeperMockRecorder) GetBondedValidatorsByPower(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBondedValidatorsByPower", reflect.TypeOf((*MockStakingKeeper)(nil).GetBondedValidatorsByPower), ctx) +} + +// GetLastTotalPower mocks base method. +func (m *MockStakingKeeper) GetLastTotalPower(ctx types.Context) types.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLastTotalPower", ctx) + ret0, _ := ret[0].(types.Int) + return ret0 +} + +// GetLastTotalPower indicates an expected call of GetLastTotalPower. +func (mr *MockStakingKeeperMockRecorder) GetLastTotalPower(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastTotalPower", reflect.TypeOf((*MockStakingKeeper)(nil).GetLastTotalPower), ctx) +} + +// GetLastValidatorPower mocks base method. +func (m *MockStakingKeeper) GetLastValidatorPower(ctx types.Context, operator types.ValAddress) int64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLastValidatorPower", ctx, operator) + ret0, _ := ret[0].(int64) + return ret0 +} + +// GetLastValidatorPower indicates an expected call of GetLastValidatorPower. +func (mr *MockStakingKeeperMockRecorder) GetLastValidatorPower(ctx, operator interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastValidatorPower", reflect.TypeOf((*MockStakingKeeper)(nil).GetLastValidatorPower), ctx, operator) +} + +// IterateBondedValidatorsByPower mocks base method. +func (m *MockStakingKeeper) IterateBondedValidatorsByPower(arg0 types.Context, arg1 func(int64, types3.ValidatorI) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) +} + +// IterateBondedValidatorsByPower indicates an expected call of IterateBondedValidatorsByPower. +func (mr *MockStakingKeeperMockRecorder) IterateBondedValidatorsByPower(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateBondedValidatorsByPower", reflect.TypeOf((*MockStakingKeeper)(nil).IterateBondedValidatorsByPower), arg0, arg1) +} + +// IterateLastValidators mocks base method. +func (m *MockStakingKeeper) IterateLastValidators(arg0 types.Context, arg1 func(int64, types3.ValidatorI) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateLastValidators", arg0, arg1) +} + +// IterateLastValidators indicates an expected call of IterateLastValidators. +func (mr *MockStakingKeeperMockRecorder) IterateLastValidators(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateLastValidators", reflect.TypeOf((*MockStakingKeeper)(nil).IterateLastValidators), arg0, arg1) +} + +// IterateValidators mocks base method. +func (m *MockStakingKeeper) IterateValidators(arg0 types.Context, arg1 func(int64, types3.ValidatorI) bool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "IterateValidators", arg0, arg1) +} + +// IterateValidators indicates an expected call of IterateValidators. +func (mr *MockStakingKeeperMockRecorder) IterateValidators(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IterateValidators", reflect.TypeOf((*MockStakingKeeper)(nil).IterateValidators), arg0, arg1) +} + +// Jail mocks base method. +func (m *MockStakingKeeper) Jail(arg0 types.Context, arg1 types.ConsAddress) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Jail", arg0, arg1) +} + +// Jail indicates an expected call of Jail. +func (mr *MockStakingKeeperMockRecorder) Jail(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Jail", reflect.TypeOf((*MockStakingKeeper)(nil).Jail), arg0, arg1) +} + +// PowerReduction mocks base method. +func (m *MockStakingKeeper) PowerReduction(ctx types.Context) types.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PowerReduction", ctx) + ret0, _ := ret[0].(types.Int) + return ret0 +} + +// PowerReduction indicates an expected call of PowerReduction. +func (mr *MockStakingKeeperMockRecorder) PowerReduction(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PowerReduction", reflect.TypeOf((*MockStakingKeeper)(nil).PowerReduction), ctx) +} + +// Slash mocks base method. +func (m *MockStakingKeeper) Slash(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 types.Dec) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Slash", arg0, arg1, arg2, arg3, arg4) +} + +// Slash indicates an expected call of Slash. +func (mr *MockStakingKeeperMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Slash", reflect.TypeOf((*MockStakingKeeper)(nil).Slash), arg0, arg1, arg2, arg3, arg4) +} + +// Validator mocks base method. +func (m *MockStakingKeeper) Validator(arg0 types.Context, arg1 types.ValAddress) types3.ValidatorI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Validator", arg0, arg1) + ret0, _ := ret[0].(types3.ValidatorI) + return ret0 +} + +// Validator indicates an expected call of Validator. +func (mr *MockStakingKeeperMockRecorder) Validator(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validator", reflect.TypeOf((*MockStakingKeeper)(nil).Validator), arg0, arg1) +} + +// ValidatorByConsAddr mocks base method. +func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 types.Context, arg1 types.ConsAddress) types3.ValidatorI { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1) + ret0, _ := ret[0].(types3.ValidatorI) + return ret0 +} + +// ValidatorByConsAddr indicates an expected call of ValidatorByConsAddr. +func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorByConsAddr), arg0, arg1) +} + +// MockTransferKeeper is a mock of TransferKeeper interface. +type MockTransferKeeper struct { + ctrl *gomock.Controller + recorder *MockTransferKeeperMockRecorder +} + +// MockTransferKeeperMockRecorder is the mock recorder for MockTransferKeeper. +type MockTransferKeeperMockRecorder struct { + mock *MockTransferKeeper +} + +// NewMockTransferKeeper creates a new mock instance. +func NewMockTransferKeeper(ctrl *gomock.Controller) *MockTransferKeeper { + mock := &MockTransferKeeper{ctrl: ctrl} + mock.recorder = &MockTransferKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockTransferKeeper) EXPECT() *MockTransferKeeperMockRecorder { + return m.recorder +} + +// Transfer mocks base method. +func (m *MockTransferKeeper) Transfer(goCtx context.Context, msg *types4.MsgTransfer) (*types4.MsgTransferResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Transfer", goCtx, msg) + ret0, _ := ret[0].(*types4.MsgTransferResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Transfer indicates an expected call of Transfer. +func (mr *MockTransferKeeperMockRecorder) Transfer(goCtx, msg interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Transfer", reflect.TypeOf((*MockTransferKeeper)(nil).Transfer), goCtx, msg) +} + +// MockDistributionKeeper is a mock of DistributionKeeper interface. +type MockDistributionKeeper struct { + ctrl *gomock.Controller + recorder *MockDistributionKeeperMockRecorder +} + +// MockDistributionKeeperMockRecorder is the mock recorder for MockDistributionKeeper. +type MockDistributionKeeperMockRecorder struct { + mock *MockDistributionKeeper +} + +// NewMockDistributionKeeper creates a new mock instance. +func NewMockDistributionKeeper(ctrl *gomock.Controller) *MockDistributionKeeper { + mock := &MockDistributionKeeper{ctrl: ctrl} + mock.recorder = &MockDistributionKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDistributionKeeper) EXPECT() *MockDistributionKeeperMockRecorder { + return m.recorder +} + +// GetFeePool mocks base method. +func (m *MockDistributionKeeper) GetFeePool(ctx types.Context) types2.FeePool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetFeePool", ctx) + ret0, _ := ret[0].(types2.FeePool) + return ret0 +} + +// GetFeePool indicates an expected call of GetFeePool. +func (mr *MockDistributionKeeperMockRecorder) GetFeePool(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeePool", reflect.TypeOf((*MockDistributionKeeper)(nil).GetFeePool), ctx) +} + +// SetFeePool mocks base method. +func (m *MockDistributionKeeper) SetFeePool(ctx types.Context, feePool types2.FeePool) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetFeePool", ctx, feePool) +} + +// SetFeePool indicates an expected call of SetFeePool. +func (mr *MockDistributionKeeperMockRecorder) SetFeePool(ctx, feePool interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetFeePool", reflect.TypeOf((*MockDistributionKeeper)(nil).SetFeePool), ctx, feePool) +} + +// MockGravityKeeper is a mock of GravityKeeper interface. +type MockGravityKeeper struct { + ctrl *gomock.Controller + recorder *MockGravityKeeperMockRecorder +} + +// MockGravityKeeperMockRecorder is the mock recorder for MockGravityKeeper. +type MockGravityKeeperMockRecorder struct { + mock *MockGravityKeeper +} + +// NewMockGravityKeeper creates a new mock instance. +func NewMockGravityKeeper(ctrl *gomock.Controller) *MockGravityKeeper { + mock := &MockGravityKeeper{ctrl: ctrl} + mock.recorder = &MockGravityKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGravityKeeper) EXPECT() *MockGravityKeeperMockRecorder { + return m.recorder +} + +// GetOrchestratorValidatorAddress mocks base method. +func (m *MockGravityKeeper) GetOrchestratorValidatorAddress(ctx types.Context, orchAddr types.AccAddress) types.ValAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOrchestratorValidatorAddress", ctx, orchAddr) + ret0, _ := ret[0].(types.ValAddress) + return ret0 +} + +// GetOrchestratorValidatorAddress indicates an expected call of GetOrchestratorValidatorAddress. +func (mr *MockGravityKeeperMockRecorder) GetOrchestratorValidatorAddress(ctx, orchAddr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOrchestratorValidatorAddress", reflect.TypeOf((*MockGravityKeeper)(nil).GetOrchestratorValidatorAddress), ctx, orchAddr) +} diff --git a/x/axelarcork/tests/mocks/ibc_module_mocks.go b/x/axelarcork/tests/mocks/ibc_module_mocks.go new file mode 100644 index 00000000..c1e5134a --- /dev/null +++ b/x/axelarcork/tests/mocks/ibc_module_mocks.go @@ -0,0 +1,343 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: /Users/mv/go/pkg/mod/github.com/cosmos/ibc-go/v3@v3.4.0/modules/core/05-port/types/module.go + +// Package mock_types is a generated GoMock package. +package mocks + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/x/capability/types" + types1 "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + exported "github.com/cosmos/ibc-go/v3/modules/core/exported" + gomock "github.com/golang/mock/gomock" +) + +// MockIBCModule is a mock of IBCModule interface. +type MockIBCModule struct { + ctrl *gomock.Controller + recorder *MockIBCModuleMockRecorder +} + +// MockIBCModuleMockRecorder is the mock recorder for MockIBCModule. +type MockIBCModuleMockRecorder struct { + mock *MockIBCModule +} + +// NewMockIBCModule creates a new mock instance. +func NewMockIBCModule(ctrl *gomock.Controller) *MockIBCModule { + mock := &MockIBCModule{ctrl: ctrl} + mock.recorder = &MockIBCModuleMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockIBCModule) EXPECT() *MockIBCModuleMockRecorder { + return m.recorder +} + +// OnAcknowledgementPacket mocks base method. +func (m *MockIBCModule) OnAcknowledgementPacket(ctx types.Context, packet types1.Packet, acknowledgement []byte, relayer types.AccAddress) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnAcknowledgementPacket", ctx, packet, acknowledgement, relayer) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnAcknowledgementPacket indicates an expected call of OnAcknowledgementPacket. +func (mr *MockIBCModuleMockRecorder) OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnAcknowledgementPacket", reflect.TypeOf((*MockIBCModule)(nil).OnAcknowledgementPacket), ctx, packet, acknowledgement, relayer) +} + +// OnChanCloseConfirm mocks base method. +func (m *MockIBCModule) OnChanCloseConfirm(ctx types.Context, portID, channelID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanCloseConfirm", ctx, portID, channelID) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanCloseConfirm indicates an expected call of OnChanCloseConfirm. +func (mr *MockIBCModuleMockRecorder) OnChanCloseConfirm(ctx, portID, channelID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanCloseConfirm", reflect.TypeOf((*MockIBCModule)(nil).OnChanCloseConfirm), ctx, portID, channelID) +} + +// OnChanCloseInit mocks base method. +func (m *MockIBCModule) OnChanCloseInit(ctx types.Context, portID, channelID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanCloseInit", ctx, portID, channelID) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanCloseInit indicates an expected call of OnChanCloseInit. +func (mr *MockIBCModuleMockRecorder) OnChanCloseInit(ctx, portID, channelID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanCloseInit", reflect.TypeOf((*MockIBCModule)(nil).OnChanCloseInit), ctx, portID, channelID) +} + +// OnChanOpenAck mocks base method. +func (m *MockIBCModule) OnChanOpenAck(ctx types.Context, portID, channelID, counterpartyChannelID, counterpartyVersion string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanOpenAck", ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanOpenAck indicates an expected call of OnChanOpenAck. +func (mr *MockIBCModuleMockRecorder) OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenAck", reflect.TypeOf((*MockIBCModule)(nil).OnChanOpenAck), ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) +} + +// OnChanOpenConfirm mocks base method. +func (m *MockIBCModule) OnChanOpenConfirm(ctx types.Context, portID, channelID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanOpenConfirm", ctx, portID, channelID) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanOpenConfirm indicates an expected call of OnChanOpenConfirm. +func (mr *MockIBCModuleMockRecorder) OnChanOpenConfirm(ctx, portID, channelID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenConfirm", reflect.TypeOf((*MockIBCModule)(nil).OnChanOpenConfirm), ctx, portID, channelID) +} + +// OnChanOpenInit mocks base method. +func (m *MockIBCModule) OnChanOpenInit(ctx types.Context, order types1.Order, connectionHops []string, portID, channelID string, channelCap *types0.Capability, counterparty types1.Counterparty, version string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanOpenInit", ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanOpenInit indicates an expected call of OnChanOpenInit. +func (mr *MockIBCModuleMockRecorder) OnChanOpenInit(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenInit", reflect.TypeOf((*MockIBCModule)(nil).OnChanOpenInit), ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) +} + +// OnChanOpenTry mocks base method. +func (m *MockIBCModule) OnChanOpenTry(ctx types.Context, order types1.Order, connectionHops []string, portID, channelID string, channelCap *types0.Capability, counterparty types1.Counterparty, counterpartyVersion string) (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanOpenTry", ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// OnChanOpenTry indicates an expected call of OnChanOpenTry. +func (mr *MockIBCModuleMockRecorder) OnChanOpenTry(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenTry", reflect.TypeOf((*MockIBCModule)(nil).OnChanOpenTry), ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) +} + +// OnRecvPacket mocks base method. +func (m *MockIBCModule) OnRecvPacket(ctx types.Context, packet types1.Packet, relayer types.AccAddress) exported.Acknowledgement { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnRecvPacket", ctx, packet, relayer) + ret0, _ := ret[0].(exported.Acknowledgement) + return ret0 +} + +// OnRecvPacket indicates an expected call of OnRecvPacket. +func (mr *MockIBCModuleMockRecorder) OnRecvPacket(ctx, packet, relayer interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnRecvPacket", reflect.TypeOf((*MockIBCModule)(nil).OnRecvPacket), ctx, packet, relayer) +} + +// OnTimeoutPacket mocks base method. +func (m *MockIBCModule) OnTimeoutPacket(ctx types.Context, packet types1.Packet, relayer types.AccAddress) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnTimeoutPacket", ctx, packet, relayer) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnTimeoutPacket indicates an expected call of OnTimeoutPacket. +func (mr *MockIBCModuleMockRecorder) OnTimeoutPacket(ctx, packet, relayer interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnTimeoutPacket", reflect.TypeOf((*MockIBCModule)(nil).OnTimeoutPacket), ctx, packet, relayer) +} + +// MockMiddleware is a mock of Middleware interface. +type MockMiddleware struct { + ctrl *gomock.Controller + recorder *MockMiddlewareMockRecorder +} + +// MockMiddlewareMockRecorder is the mock recorder for MockMiddleware. +type MockMiddlewareMockRecorder struct { + mock *MockMiddleware +} + +// NewMockMiddleware creates a new mock instance. +func NewMockMiddleware(ctrl *gomock.Controller) *MockMiddleware { + mock := &MockMiddleware{ctrl: ctrl} + mock.recorder = &MockMiddlewareMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMiddleware) EXPECT() *MockMiddlewareMockRecorder { + return m.recorder +} + +// OnAcknowledgementPacket mocks base method. +func (m *MockMiddleware) OnAcknowledgementPacket(ctx types.Context, packet types1.Packet, acknowledgement []byte, relayer types.AccAddress) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnAcknowledgementPacket", ctx, packet, acknowledgement, relayer) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnAcknowledgementPacket indicates an expected call of OnAcknowledgementPacket. +func (mr *MockMiddlewareMockRecorder) OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnAcknowledgementPacket", reflect.TypeOf((*MockMiddleware)(nil).OnAcknowledgementPacket), ctx, packet, acknowledgement, relayer) +} + +// OnChanCloseConfirm mocks base method. +func (m *MockMiddleware) OnChanCloseConfirm(ctx types.Context, portID, channelID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanCloseConfirm", ctx, portID, channelID) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanCloseConfirm indicates an expected call of OnChanCloseConfirm. +func (mr *MockMiddlewareMockRecorder) OnChanCloseConfirm(ctx, portID, channelID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanCloseConfirm", reflect.TypeOf((*MockMiddleware)(nil).OnChanCloseConfirm), ctx, portID, channelID) +} + +// OnChanCloseInit mocks base method. +func (m *MockMiddleware) OnChanCloseInit(ctx types.Context, portID, channelID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanCloseInit", ctx, portID, channelID) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanCloseInit indicates an expected call of OnChanCloseInit. +func (mr *MockMiddlewareMockRecorder) OnChanCloseInit(ctx, portID, channelID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanCloseInit", reflect.TypeOf((*MockMiddleware)(nil).OnChanCloseInit), ctx, portID, channelID) +} + +// OnChanOpenAck mocks base method. +func (m *MockMiddleware) OnChanOpenAck(ctx types.Context, portID, channelID, counterpartyChannelID, counterpartyVersion string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanOpenAck", ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanOpenAck indicates an expected call of OnChanOpenAck. +func (mr *MockMiddlewareMockRecorder) OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenAck", reflect.TypeOf((*MockMiddleware)(nil).OnChanOpenAck), ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) +} + +// OnChanOpenConfirm mocks base method. +func (m *MockMiddleware) OnChanOpenConfirm(ctx types.Context, portID, channelID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanOpenConfirm", ctx, portID, channelID) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanOpenConfirm indicates an expected call of OnChanOpenConfirm. +func (mr *MockMiddlewareMockRecorder) OnChanOpenConfirm(ctx, portID, channelID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenConfirm", reflect.TypeOf((*MockMiddleware)(nil).OnChanOpenConfirm), ctx, portID, channelID) +} + +// OnChanOpenInit mocks base method. +func (m *MockMiddleware) OnChanOpenInit(ctx types.Context, order types1.Order, connectionHops []string, portID, channelID string, channelCap *types0.Capability, counterparty types1.Counterparty, version string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanOpenInit", ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnChanOpenInit indicates an expected call of OnChanOpenInit. +func (mr *MockMiddlewareMockRecorder) OnChanOpenInit(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenInit", reflect.TypeOf((*MockMiddleware)(nil).OnChanOpenInit), ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) +} + +// OnChanOpenTry mocks base method. +func (m *MockMiddleware) OnChanOpenTry(ctx types.Context, order types1.Order, connectionHops []string, portID, channelID string, channelCap *types0.Capability, counterparty types1.Counterparty, counterpartyVersion string) (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnChanOpenTry", ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// OnChanOpenTry indicates an expected call of OnChanOpenTry. +func (mr *MockMiddlewareMockRecorder) OnChanOpenTry(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnChanOpenTry", reflect.TypeOf((*MockMiddleware)(nil).OnChanOpenTry), ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) +} + +// OnRecvPacket mocks base method. +func (m *MockMiddleware) OnRecvPacket(ctx types.Context, packet types1.Packet, relayer types.AccAddress) exported.Acknowledgement { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnRecvPacket", ctx, packet, relayer) + ret0, _ := ret[0].(exported.Acknowledgement) + return ret0 +} + +// OnRecvPacket indicates an expected call of OnRecvPacket. +func (mr *MockMiddlewareMockRecorder) OnRecvPacket(ctx, packet, relayer interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnRecvPacket", reflect.TypeOf((*MockMiddleware)(nil).OnRecvPacket), ctx, packet, relayer) +} + +// OnTimeoutPacket mocks base method. +func (m *MockMiddleware) OnTimeoutPacket(ctx types.Context, packet types1.Packet, relayer types.AccAddress) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OnTimeoutPacket", ctx, packet, relayer) + ret0, _ := ret[0].(error) + return ret0 +} + +// OnTimeoutPacket indicates an expected call of OnTimeoutPacket. +func (mr *MockMiddlewareMockRecorder) OnTimeoutPacket(ctx, packet, relayer interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnTimeoutPacket", reflect.TypeOf((*MockMiddleware)(nil).OnTimeoutPacket), ctx, packet, relayer) +} + +// SendPacket mocks base method. +func (m *MockMiddleware) SendPacket(ctx types.Context, chanCap *types0.Capability, packet exported.PacketI) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendPacket", ctx, chanCap, packet) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendPacket indicates an expected call of SendPacket. +func (mr *MockMiddlewareMockRecorder) SendPacket(ctx, chanCap, packet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendPacket", reflect.TypeOf((*MockMiddleware)(nil).SendPacket), ctx, chanCap, packet) +} + +// WriteAcknowledgement mocks base method. +func (m *MockMiddleware) WriteAcknowledgement(ctx types.Context, chanCap *types0.Capability, packet exported.PacketI, ack exported.Acknowledgement) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WriteAcknowledgement", ctx, chanCap, packet, ack) + ret0, _ := ret[0].(error) + return ret0 +} + +// WriteAcknowledgement indicates an expected call of WriteAcknowledgement. +func (mr *MockMiddlewareMockRecorder) WriteAcknowledgement(ctx, chanCap, packet, ack interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WriteAcknowledgement", reflect.TypeOf((*MockMiddleware)(nil).WriteAcknowledgement), ctx, chanCap, packet, ack) +} diff --git a/x/axelarcork/tests/mocks/staking_mocks.go b/x/axelarcork/tests/mocks/staking_mocks.go new file mode 100644 index 00000000..0df4001b --- /dev/null +++ b/x/axelarcork/tests/mocks/staking_mocks.go @@ -0,0 +1,402 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: /Users/mv/go/pkg/mod/github.com/cosmos/cosmos-sdk@v0.45.13/x/staking/types/exported.go + +// Package mock_types is a generated GoMock package. +package mocks + +import ( + reflect "reflect" + + types "github.com/cosmos/cosmos-sdk/crypto/types" + types0 "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/x/staking/types" + gomock "github.com/golang/mock/gomock" + crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" +) + +// MockDelegationI is a mock of DelegationI interface. +type MockDelegationI struct { + ctrl *gomock.Controller + recorder *MockDelegationIMockRecorder +} + +// MockDelegationIMockRecorder is the mock recorder for MockDelegationI. +type MockDelegationIMockRecorder struct { + mock *MockDelegationI +} + +// NewMockDelegationI creates a new mock instance. +func NewMockDelegationI(ctrl *gomock.Controller) *MockDelegationI { + mock := &MockDelegationI{ctrl: ctrl} + mock.recorder = &MockDelegationIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDelegationI) EXPECT() *MockDelegationIMockRecorder { + return m.recorder +} + +// GetDelegatorAddr mocks base method. +func (m *MockDelegationI) GetDelegatorAddr() types0.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDelegatorAddr") + ret0, _ := ret[0].(types0.AccAddress) + return ret0 +} + +// GetDelegatorAddr indicates an expected call of GetDelegatorAddr. +func (mr *MockDelegationIMockRecorder) GetDelegatorAddr() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegatorAddr", reflect.TypeOf((*MockDelegationI)(nil).GetDelegatorAddr)) +} + +// GetShares mocks base method. +func (m *MockDelegationI) GetShares() types0.Dec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetShares") + ret0, _ := ret[0].(types0.Dec) + return ret0 +} + +// GetShares indicates an expected call of GetShares. +func (mr *MockDelegationIMockRecorder) GetShares() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetShares", reflect.TypeOf((*MockDelegationI)(nil).GetShares)) +} + +// GetValidatorAddr mocks base method. +func (m *MockDelegationI) GetValidatorAddr() types0.ValAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetValidatorAddr") + ret0, _ := ret[0].(types0.ValAddress) + return ret0 +} + +// GetValidatorAddr indicates an expected call of GetValidatorAddr. +func (mr *MockDelegationIMockRecorder) GetValidatorAddr() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorAddr", reflect.TypeOf((*MockDelegationI)(nil).GetValidatorAddr)) +} + +// MockValidatorI is a mock of ValidatorI interface. +type MockValidatorI struct { + ctrl *gomock.Controller + recorder *MockValidatorIMockRecorder +} + +// MockValidatorIMockRecorder is the mock recorder for MockValidatorI. +type MockValidatorIMockRecorder struct { + mock *MockValidatorI +} + +// NewMockValidatorI creates a new mock instance. +func NewMockValidatorI(ctrl *gomock.Controller) *MockValidatorI { + mock := &MockValidatorI{ctrl: ctrl} + mock.recorder = &MockValidatorIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockValidatorI) EXPECT() *MockValidatorIMockRecorder { + return m.recorder +} + +// ConsPubKey mocks base method. +func (m *MockValidatorI) ConsPubKey() (types.PubKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ConsPubKey") + ret0, _ := ret[0].(types.PubKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ConsPubKey indicates an expected call of ConsPubKey. +func (mr *MockValidatorIMockRecorder) ConsPubKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsPubKey", reflect.TypeOf((*MockValidatorI)(nil).ConsPubKey)) +} + +// GetBondedTokens mocks base method. +func (m *MockValidatorI) GetBondedTokens() types0.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetBondedTokens") + ret0, _ := ret[0].(types0.Int) + return ret0 +} + +// GetBondedTokens indicates an expected call of GetBondedTokens. +func (mr *MockValidatorIMockRecorder) GetBondedTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBondedTokens", reflect.TypeOf((*MockValidatorI)(nil).GetBondedTokens)) +} + +// GetCommission mocks base method. +func (m *MockValidatorI) GetCommission() types0.Dec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCommission") + ret0, _ := ret[0].(types0.Dec) + return ret0 +} + +// GetCommission indicates an expected call of GetCommission. +func (mr *MockValidatorIMockRecorder) GetCommission() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommission", reflect.TypeOf((*MockValidatorI)(nil).GetCommission)) +} + +// GetConsAddr mocks base method. +func (m *MockValidatorI) GetConsAddr() (types0.ConsAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsAddr") + ret0, _ := ret[0].(types0.ConsAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetConsAddr indicates an expected call of GetConsAddr. +func (mr *MockValidatorIMockRecorder) GetConsAddr() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsAddr", reflect.TypeOf((*MockValidatorI)(nil).GetConsAddr)) +} + +// GetConsensusPower mocks base method. +func (m *MockValidatorI) GetConsensusPower(arg0 types0.Int) int64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConsensusPower", arg0) + ret0, _ := ret[0].(int64) + return ret0 +} + +// GetConsensusPower indicates an expected call of GetConsensusPower. +func (mr *MockValidatorIMockRecorder) GetConsensusPower(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConsensusPower", reflect.TypeOf((*MockValidatorI)(nil).GetConsensusPower), arg0) +} + +// GetDelegatorShares mocks base method. +func (m *MockValidatorI) GetDelegatorShares() types0.Dec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDelegatorShares") + ret0, _ := ret[0].(types0.Dec) + return ret0 +} + +// GetDelegatorShares indicates an expected call of GetDelegatorShares. +func (mr *MockValidatorIMockRecorder) GetDelegatorShares() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDelegatorShares", reflect.TypeOf((*MockValidatorI)(nil).GetDelegatorShares)) +} + +// GetMinSelfDelegation mocks base method. +func (m *MockValidatorI) GetMinSelfDelegation() types0.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMinSelfDelegation") + ret0, _ := ret[0].(types0.Int) + return ret0 +} + +// GetMinSelfDelegation indicates an expected call of GetMinSelfDelegation. +func (mr *MockValidatorIMockRecorder) GetMinSelfDelegation() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMinSelfDelegation", reflect.TypeOf((*MockValidatorI)(nil).GetMinSelfDelegation)) +} + +// GetMoniker mocks base method. +func (m *MockValidatorI) GetMoniker() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMoniker") + ret0, _ := ret[0].(string) + return ret0 +} + +// GetMoniker indicates an expected call of GetMoniker. +func (mr *MockValidatorIMockRecorder) GetMoniker() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMoniker", reflect.TypeOf((*MockValidatorI)(nil).GetMoniker)) +} + +// GetOperator mocks base method. +func (m *MockValidatorI) GetOperator() types0.ValAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOperator") + ret0, _ := ret[0].(types0.ValAddress) + return ret0 +} + +// GetOperator indicates an expected call of GetOperator. +func (mr *MockValidatorIMockRecorder) GetOperator() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperator", reflect.TypeOf((*MockValidatorI)(nil).GetOperator)) +} + +// GetStatus mocks base method. +func (m *MockValidatorI) GetStatus() types1.BondStatus { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetStatus") + ret0, _ := ret[0].(types1.BondStatus) + return ret0 +} + +// GetStatus indicates an expected call of GetStatus. +func (mr *MockValidatorIMockRecorder) GetStatus() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatus", reflect.TypeOf((*MockValidatorI)(nil).GetStatus)) +} + +// GetTokens mocks base method. +func (m *MockValidatorI) GetTokens() types0.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokens") + ret0, _ := ret[0].(types0.Int) + return ret0 +} + +// GetTokens indicates an expected call of GetTokens. +func (mr *MockValidatorIMockRecorder) GetTokens() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokens", reflect.TypeOf((*MockValidatorI)(nil).GetTokens)) +} + +// IsBonded mocks base method. +func (m *MockValidatorI) IsBonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsBonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsBonded indicates an expected call of IsBonded. +func (mr *MockValidatorIMockRecorder) IsBonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsBonded", reflect.TypeOf((*MockValidatorI)(nil).IsBonded)) +} + +// IsJailed mocks base method. +func (m *MockValidatorI) IsJailed() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsJailed") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsJailed indicates an expected call of IsJailed. +func (mr *MockValidatorIMockRecorder) IsJailed() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsJailed", reflect.TypeOf((*MockValidatorI)(nil).IsJailed)) +} + +// IsUnbonded mocks base method. +func (m *MockValidatorI) IsUnbonded() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonded") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonded indicates an expected call of IsUnbonded. +func (mr *MockValidatorIMockRecorder) IsUnbonded() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonded", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonded)) +} + +// IsUnbonding mocks base method. +func (m *MockValidatorI) IsUnbonding() bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsUnbonding") + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsUnbonding indicates an expected call of IsUnbonding. +func (mr *MockValidatorIMockRecorder) IsUnbonding() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnbonding", reflect.TypeOf((*MockValidatorI)(nil).IsUnbonding)) +} + +// SharesFromTokens mocks base method. +func (m *MockValidatorI) SharesFromTokens(amt types0.Int) (types0.Dec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokens", amt) + ret0, _ := ret[0].(types0.Dec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokens indicates an expected call of SharesFromTokens. +func (mr *MockValidatorIMockRecorder) SharesFromTokens(amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokens", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokens), amt) +} + +// SharesFromTokensTruncated mocks base method. +func (m *MockValidatorI) SharesFromTokensTruncated(amt types0.Int) (types0.Dec, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SharesFromTokensTruncated", amt) + ret0, _ := ret[0].(types0.Dec) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SharesFromTokensTruncated indicates an expected call of SharesFromTokensTruncated. +func (mr *MockValidatorIMockRecorder) SharesFromTokensTruncated(amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharesFromTokensTruncated", reflect.TypeOf((*MockValidatorI)(nil).SharesFromTokensTruncated), amt) +} + +// TmConsPublicKey mocks base method. +func (m *MockValidatorI) TmConsPublicKey() (crypto.PublicKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TmConsPublicKey") + ret0, _ := ret[0].(crypto.PublicKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TmConsPublicKey indicates an expected call of TmConsPublicKey. +func (mr *MockValidatorIMockRecorder) TmConsPublicKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TmConsPublicKey", reflect.TypeOf((*MockValidatorI)(nil).TmConsPublicKey)) +} + +// TokensFromShares mocks base method. +func (m *MockValidatorI) TokensFromShares(arg0 types0.Dec) types0.Dec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromShares", arg0) + ret0, _ := ret[0].(types0.Dec) + return ret0 +} + +// TokensFromShares indicates an expected call of TokensFromShares. +func (mr *MockValidatorIMockRecorder) TokensFromShares(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromShares", reflect.TypeOf((*MockValidatorI)(nil).TokensFromShares), arg0) +} + +// TokensFromSharesRoundUp mocks base method. +func (m *MockValidatorI) TokensFromSharesRoundUp(arg0 types0.Dec) types0.Dec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesRoundUp", arg0) + ret0, _ := ret[0].(types0.Dec) + return ret0 +} + +// TokensFromSharesRoundUp indicates an expected call of TokensFromSharesRoundUp. +func (mr *MockValidatorIMockRecorder) TokensFromSharesRoundUp(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesRoundUp", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesRoundUp), arg0) +} + +// TokensFromSharesTruncated mocks base method. +func (m *MockValidatorI) TokensFromSharesTruncated(arg0 types0.Dec) types0.Dec { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TokensFromSharesTruncated", arg0) + ret0, _ := ret[0].(types0.Dec) + return ret0 +} + +// TokensFromSharesTruncated indicates an expected call of TokensFromSharesTruncated. +func (mr *MockValidatorIMockRecorder) TokensFromSharesTruncated(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TokensFromSharesTruncated", reflect.TypeOf((*MockValidatorI)(nil).TokensFromSharesTruncated), arg0) +} diff --git a/x/axelarcork/tests/setup.go b/x/axelarcork/tests/setup.go new file mode 100644 index 00000000..462413e2 --- /dev/null +++ b/x/axelarcork/tests/setup.go @@ -0,0 +1,175 @@ +package tests + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" + "github.com/golang/mock/gomock" + "github.com/peggyjv/sommelier/v7/x/axelarcork" + "github.com/peggyjv/sommelier/v7/x/axelarcork/keeper" + "github.com/peggyjv/sommelier/v7/x/axelarcork/tests/mocks" + "github.com/peggyjv/sommelier/v7/x/axelarcork/types" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmdb "github.com/tendermint/tm-db" +) + +var TestGMPAccount = authtypes.NewModuleAddress("test-gmp-account") + +// DefaultParams returns default oracle parameters +func TestParams() types.Params { + + return types.Params{ + IbcChannel: "channel-2", + IbcPort: "axelar", + GmpAccount: TestGMPAccount.String(), + ExecutorAccount: "test-executor-account", + TimeoutDuration: 100, + } +} + +func NewTestSetup(t *testing.T, ctl *gomock.Controller) *Setup { + t.Helper() + initializer := newInitializer() + + accountKeeperMock := mocks.NewMockAccountKeeper(ctl) + transferKeeperMock := mocks.NewMockTransferKeeper(ctl) + stakingKeeper := mocks.NewMockStakingKeeper(ctl) + distributionKeeperMock := mocks.NewMockDistributionKeeper(ctl) + ibcModuleMock := mocks.NewMockIBCModule(ctl) + ics4WrapperMock := mocks.NewMockICS4Wrapper(ctl) + gravityKeeper := mocks.NewMockGravityKeeper(ctl) + + paramsKeeper := initializer.paramsKeeper() + acKeeper := initializer.axelarcorkKeeper( + paramsKeeper, accountKeeperMock, stakingKeeper, transferKeeperMock, distributionKeeperMock, + ics4WrapperMock, gravityKeeper) + + require.NoError(t, initializer.StateStore.LoadLatestVersion()) + + acKeeper.SetParams(initializer.Ctx, TestParams()) + //acKeeper.SetChainConfiguration() + + return &Setup{ + Initializer: initializer, + + Keepers: &testKeepers{ + ParamsKeeper: ¶msKeeper, + AxelarCorkKeeper: acKeeper, + }, + + Mocks: &testMocks{ + AccountKeeperMock: accountKeeperMock, + TransferKeeperMock: transferKeeperMock, + DistributionKeeperMock: distributionKeeperMock, + IBCModuleMock: ibcModuleMock, + ICS4WrapperMock: ics4WrapperMock, + }, + + AxelarCorkMiddleware: initializer.axelarMiddleware(ibcModuleMock, acKeeper), + } +} + +type Setup struct { + Initializer initializer + + Keepers *testKeepers + Mocks *testMocks + + AxelarCorkMiddleware axelarcork.IBCMiddleware +} + +type testKeepers struct { + ParamsKeeper *paramskeeper.Keeper + AxelarCorkKeeper *keeper.Keeper +} + +type testMocks struct { + AccountKeeperMock *mocks.MockAccountKeeper + TransferKeeperMock *mocks.MockTransferKeeper + DistributionKeeperMock *mocks.MockDistributionKeeper + IBCModuleMock *mocks.MockIBCModule + ICS4WrapperMock *mocks.MockICS4Wrapper +} + +type initializer struct { + DB *tmdb.MemDB + StateStore store.CommitMultiStore + Ctx sdk.Context + Marshaler codec.Codec + Amino *codec.LegacyAmino +} + +// Create an initializer with in memory database and default codecs +func newInitializer() initializer { + logger := log.TestingLogger() + logger.Debug("initializing test setup") + + db := tmdb.NewMemDB() + stateStore := store.NewCommitMultiStore(db) + + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, logger) + interfaceRegistry := cdctypes.NewInterfaceRegistry() + amino := codec.NewLegacyAmino() + marshaler := codec.NewProtoCodec(interfaceRegistry) + + return initializer{ + DB: db, + StateStore: stateStore, + Ctx: ctx, + Marshaler: marshaler, + Amino: amino, + } +} + +func (i initializer) paramsKeeper() paramskeeper.Keeper { + storeKey := sdk.NewKVStoreKey(paramstypes.StoreKey) + transientStoreKey := sdk.NewTransientStoreKey(paramstypes.TStoreKey) + i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) + i.StateStore.MountStoreWithDB(transientStoreKey, storetypes.StoreTypeTransient, i.DB) + + paramsKeeper := paramskeeper.NewKeeper(i.Marshaler, i.Amino, storeKey, transientStoreKey) + + return paramsKeeper +} + +func (i initializer) axelarcorkKeeper( + paramsKeeper paramskeeper.Keeper, + accountKeeper types.AccountKeeper, + stakingKeeper types.StakingKeeper, + transferKeeper types.TransferKeeper, + distributionKeeper types.DistributionKeeper, + ics4Wrapper porttypes.ICS4Wrapper, + gravityKeeper types.GravityKeeper, +) *keeper.Keeper { + storeKey := sdk.NewKVStoreKey(types.StoreKey) + i.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, i.DB) + + subspace := paramsKeeper.Subspace(types.ModuleName) + routerKeeper := keeper.NewKeeper( + i.Marshaler, + storeKey, + subspace, + accountKeeper, + stakingKeeper, + transferKeeper, + distributionKeeper, + ics4Wrapper, + gravityKeeper, + ) + + return &routerKeeper +} + +func (i initializer) axelarMiddleware(app porttypes.IBCModule, k *keeper.Keeper) axelarcork.IBCMiddleware { + return axelarcork.NewIBCMiddleware(*k, app) +} diff --git a/x/axelarcork/types/axelar.go b/x/axelarcork/types/axelar.go new file mode 100644 index 00000000..45e08b57 --- /dev/null +++ b/x/axelarcork/types/axelar.go @@ -0,0 +1,21 @@ +package types + +const ( + _ int64 = iota + PureMessage + MessageWithToken + PureTokenTransfer +) + +type AxelarBody struct { + DestinationChain string `json:"destination_chain"` + DestinationAddress string `json:"destination_address"` + Payload []byte `json:"payload"` + Type int64 `json:"type"` + Fee *Fee `json:"fee"` +} + +type Fee struct { + Amount string `json:"amount"` + Recipient string `json:"recipient"` +} diff --git a/x/axelarcork/types/axelar_proxy.go b/x/axelarcork/types/axelar_proxy.go new file mode 100644 index 00000000..391f4b4a --- /dev/null +++ b/x/axelarcork/types/axelar_proxy.go @@ -0,0 +1,134 @@ +package types + +import ( + fmt "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" +) + +var ( + Address, _ = abi.NewType("address", "", nil) + AddressArr, _ = abi.NewType("address[]", "", nil) + Bytes, _ = abi.NewType("bytes", "", nil) + Uint256, _ = abi.NewType("uint256", "", nil) + + HourInBlocks = uint64((60 * 60) / 12) + DefaultExecutableHeightThreshold = 72 * HourInBlocks + + LogicCallMsgID = big.NewInt(0) + UpgradeMsgID = big.NewInt(1) +) + +func (ccn AxelarContractCallNonce) ValidateBasic() error { + if ccn.Nonce == 0 { + return fmt.Errorf("nonce cannot be zero") + } + + if ccn.ContractAddress == "" { + return fmt.Errorf("contract address cannot be empty") + } + + if ccn.ChainId == 0 { + return fmt.Errorf("chain ID cannot be zero") + } + + return nil +} + +func (ud AxelarUpgradeData) ValidateBasic() error { + if ud.ChainId == 0 { + return fmt.Errorf("chain ID cannot be zero") + } + + if ud.ExecutableHeightThreshold < 0 { + return fmt.Errorf("height threshold cannot be negative") + } + + if len(ud.Payload) == 0 { + return fmt.Errorf("payload cannot be empty") + } + + return nil +} + +func EncodeLogicCallArgs(targetContract string, nonce uint64, deadline uint64, callData []byte) ([]byte, error) { + return abi.Arguments{ + {Type: Uint256}, + {Type: Address}, + {Type: Uint256}, + {Type: Uint256}, + {Type: Bytes}, + }.Pack(LogicCallMsgID, common.HexToAddress(targetContract), big.NewInt(int64(nonce)), big.NewInt(int64(deadline)), callData) +} + +func DecodeLogicCallArgs(data []byte) (targetContract string, nonce uint64, deadline uint64, callData []byte, err error) { + args, err := abi.Arguments{ + {Type: Uint256}, + {Type: Address}, + {Type: Uint256}, + {Type: Uint256}, + {Type: Bytes}, + }.Unpack(data) + if err != nil { + return + } + + // Unpack(data) error will catch overflow errors, but this will handle unambiguously invalid data + if msgID, ok := args[0].(*big.Int); !ok || msgID.Cmp(LogicCallMsgID) != 0 { + return "", 0, 0, nil, fmt.Errorf("invalid logic call args") + } + + // Collin: Do we need to check for zero values in case these assertions somehow fail? + targetContractArg, _ := args[1].(common.Address) + targetContract = targetContractArg.String() + nonceArg, _ := args[2].(*big.Int) + nonce = nonceArg.Uint64() + deadlineArg, _ := args[3].(*big.Int) + deadline = deadlineArg.Uint64() + callData, _ = args[4].([]byte) + + return +} + +func EncodeUpgradeArgs(newAxelarProxy string, targets []string) ([]byte, error) { + targetAddrs := []common.Address{} + for _, target := range targets { + targetAddrs = append(targetAddrs, common.HexToAddress(target)) + } + + return abi.Arguments{ + {Type: Uint256}, + {Type: Address}, + {Type: AddressArr}, + }.Pack(UpgradeMsgID, common.HexToAddress(newAxelarProxy), targetAddrs) +} + +func DecodeUpgradeArgs(data []byte) (newAxelarProxy string, targets []string, err error) { + args, err := abi.Arguments{ + {Type: Uint256}, + {Type: Address}, + {Type: AddressArr}, + }.Unpack(data) + if err != nil { + return + } + + // Unpack(data) error will catch overflow errors, but this will handle unambiguously invalid data + if msgID, ok := args[0].(*big.Int); !ok || msgID.Cmp(UpgradeMsgID) != 0 { + return "", nil, fmt.Errorf("invalid upgrade args") + } + + // Collin: Do we need to check for zero values in case these assertions somehow fail? + newAxelarProxyArg, _ := args[1].(common.Address) + newAxelarProxy = newAxelarProxyArg.String() + targetsArg, _ := args[2].([]common.Address) + + targets = []string{} + for _, target := range targetsArg { + targets = append(targets, target.String()) + } + + return +} diff --git a/x/axelarcork/types/axelar_proxy_test.go b/x/axelarcork/types/axelar_proxy_test.go new file mode 100644 index 00000000..1f07b00d --- /dev/null +++ b/x/axelarcork/types/axelar_proxy_test.go @@ -0,0 +1,64 @@ +package types + +import ( + "bytes" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/stretchr/testify/require" +) + +func TestEncodingDecodingLogicCalls(t *testing.T) { + targetContract := "0x1111111111111111111111111111111111111111" + nonce := uint64(1) + deadline := uint64(1000000000) + callData := []byte("testdata") + + // Can encode and decode valid logic calls + result, err := EncodeLogicCallArgs(targetContract, nonce, deadline, callData) + require.NoError(t, err) + actualTargetContract, actualNonce, actualDeadline, actualCallData, err := DecodeLogicCallArgs(result) + require.NoError(t, err) + require.Equal(t, targetContract, actualTargetContract) + require.Equal(t, nonce, actualNonce) + require.Equal(t, deadline, actualDeadline) + require.Equal(t, callData, actualCallData) + + // Decoding logic call as upgrade caught + _, _, err = DecodeUpgradeArgs(result) + require.Error(t, err) + require.Equal(t, err.Error(), "invalid upgrade args") + + // Specifically using the wrong msgID in a logic call errors + wrongMsgID := result + upgradeMsgIDBytes, err := abi.Arguments{{Type: Uint256}}.Pack(UpgradeMsgID) + require.NoError(t, err) + wrongMsgID = bytes.Join([][]byte{upgradeMsgIDBytes, wrongMsgID[len(upgradeMsgIDBytes):]}, []byte{}) + _, _, _, _, err = DecodeLogicCallArgs(wrongMsgID) //nolint:dogsled + require.Error(t, err) + require.Equal(t, err.Error(), "invalid logic call args") + + // Can encode and decode valid upgrade calls + targets := []string{targetContract, "0x2222222222222222222222222222222222222222"} + + result, err = EncodeUpgradeArgs(targetContract, targets) + require.NoError(t, err) + actualNewAxelarProxy, actualTargets, err := DecodeUpgradeArgs(result) + require.NoError(t, err) + require.Equal(t, targetContract, actualNewAxelarProxy) + require.Equal(t, targets, actualTargets) + + // Decoding upgrade call as logic call caught + _, _, _, _, err = DecodeLogicCallArgs(result) //nolint:dogsled + require.Error(t, err) + + // Specifically using the wrong msgID in an upgrade call errors + wrongMsgID, err = EncodeUpgradeArgs(targetContract, targets) + require.NoError(t, err) + logicCallMsgIDBytes, err := abi.Arguments{{Type: Uint256}}.Pack(LogicCallMsgID) + require.NoError(t, err) + wrongMsgID = bytes.Join([][]byte{logicCallMsgIDBytes, wrongMsgID[len(logicCallMsgIDBytes):]}, []byte{}) + _, _, err = DecodeUpgradeArgs(wrongMsgID) + require.Error(t, err) + require.Equal(t, err.Error(), "invalid upgrade args") +} diff --git a/x/axelarcork/types/axelarcork.go b/x/axelarcork/types/axelarcork.go new file mode 100644 index 00000000..da99cc90 --- /dev/null +++ b/x/axelarcork/types/axelarcork.go @@ -0,0 +1,52 @@ +package types + +import ( + "bytes" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" +) + +func (c *AxelarCork) IDHash(blockHeight uint64) []byte { + blockHeightBytes := sdk.Uint64ToBigEndian(blockHeight) + + address := common.HexToAddress(c.TargetContractAddress) + + return crypto.Keccak256Hash( + bytes.Join( + [][]byte{blockHeightBytes, address.Bytes(), c.EncodedContractCall, sdk.Uint64ToBigEndian(c.Deadline)}, + []byte{}, + )).Bytes() +} + +func (c *AxelarCork) Equals(other AxelarCork) bool { + firstAddr := common.HexToAddress(c.TargetContractAddress) + secondAddr := common.HexToAddress(other.TargetContractAddress) + + if firstAddr != secondAddr { + return false + } + + if !bytes.Equal(c.EncodedContractCall, other.EncodedContractCall) { + return false + } + + if c.Deadline != other.Deadline { + return false + } + + return true +} + +func (c *AxelarCork) ValidateBasic() error { + if len(c.EncodedContractCall) == 0 { + return ErrEmptyContractCall + } + + if !common.IsHexAddress(c.TargetContractAddress) { + return ErrInvalidEVMAddress + } + + return nil +} diff --git a/x/axelarcork/types/axelarcork.pb.go b/x/axelarcork/types/axelarcork.pb.go new file mode 100644 index 00000000..b17faddf --- /dev/null +++ b/x/axelarcork/types/axelarcork.pb.go @@ -0,0 +1,2616 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: axelarcork/v1/axelarcork.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type AxelarCork struct { + // call body containing the ABI encoded bytes to send to the contract + EncodedContractCall []byte `protobuf:"bytes,1,opt,name=encoded_contract_call,json=encodedContractCall,proto3" json:"encoded_contract_call,omitempty"` + // the chain ID of the evm target chain + ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // address of the contract to send the call + TargetContractAddress string `protobuf:"bytes,3,opt,name=target_contract_address,json=targetContractAddress,proto3" json:"target_contract_address,omitempty"` + // unix timestamp before which the contract call must be executed. + // enforced by the proxy contract. + Deadline uint64 `protobuf:"varint,4,opt,name=deadline,proto3" json:"deadline,omitempty"` +} + +func (m *AxelarCork) Reset() { *m = AxelarCork{} } +func (m *AxelarCork) String() string { return proto.CompactTextString(m) } +func (*AxelarCork) ProtoMessage() {} +func (*AxelarCork) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{0} +} +func (m *AxelarCork) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AxelarCork) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AxelarCork.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AxelarCork) XXX_Merge(src proto.Message) { + xxx_messageInfo_AxelarCork.Merge(m, src) +} +func (m *AxelarCork) XXX_Size() int { + return m.Size() +} +func (m *AxelarCork) XXX_DiscardUnknown() { + xxx_messageInfo_AxelarCork.DiscardUnknown(m) +} + +var xxx_messageInfo_AxelarCork proto.InternalMessageInfo + +func (m *AxelarCork) GetEncodedContractCall() []byte { + if m != nil { + return m.EncodedContractCall + } + return nil +} + +func (m *AxelarCork) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *AxelarCork) GetTargetContractAddress() string { + if m != nil { + return m.TargetContractAddress + } + return "" +} + +func (m *AxelarCork) GetDeadline() uint64 { + if m != nil { + return m.Deadline + } + return 0 +} + +type ScheduledAxelarCork struct { + Cork *AxelarCork `protobuf:"bytes,1,opt,name=cork,proto3" json:"cork,omitempty"` + BlockHeight uint64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Validator string `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` + Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *ScheduledAxelarCork) Reset() { *m = ScheduledAxelarCork{} } +func (m *ScheduledAxelarCork) String() string { return proto.CompactTextString(m) } +func (*ScheduledAxelarCork) ProtoMessage() {} +func (*ScheduledAxelarCork) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{1} +} +func (m *ScheduledAxelarCork) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ScheduledAxelarCork) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ScheduledAxelarCork.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ScheduledAxelarCork) XXX_Merge(src proto.Message) { + xxx_messageInfo_ScheduledAxelarCork.Merge(m, src) +} +func (m *ScheduledAxelarCork) XXX_Size() int { + return m.Size() +} +func (m *ScheduledAxelarCork) XXX_DiscardUnknown() { + xxx_messageInfo_ScheduledAxelarCork.DiscardUnknown(m) +} + +var xxx_messageInfo_ScheduledAxelarCork proto.InternalMessageInfo + +func (m *ScheduledAxelarCork) GetCork() *AxelarCork { + if m != nil { + return m.Cork + } + return nil +} + +func (m *ScheduledAxelarCork) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *ScheduledAxelarCork) GetValidator() string { + if m != nil { + return m.Validator + } + return "" +} + +func (m *ScheduledAxelarCork) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type ScheduledAxelarCorks struct { + ScheduledCorks []*ScheduledAxelarCork `protobuf:"bytes,1,rep,name=scheduled_corks,json=scheduledCorks,proto3" json:"scheduled_corks,omitempty"` +} + +func (m *ScheduledAxelarCorks) Reset() { *m = ScheduledAxelarCorks{} } +func (m *ScheduledAxelarCorks) String() string { return proto.CompactTextString(m) } +func (*ScheduledAxelarCorks) ProtoMessage() {} +func (*ScheduledAxelarCorks) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{2} +} +func (m *ScheduledAxelarCorks) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ScheduledAxelarCorks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ScheduledAxelarCorks.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ScheduledAxelarCorks) XXX_Merge(src proto.Message) { + xxx_messageInfo_ScheduledAxelarCorks.Merge(m, src) +} +func (m *ScheduledAxelarCorks) XXX_Size() int { + return m.Size() +} +func (m *ScheduledAxelarCorks) XXX_DiscardUnknown() { + xxx_messageInfo_ScheduledAxelarCorks.DiscardUnknown(m) +} + +var xxx_messageInfo_ScheduledAxelarCorks proto.InternalMessageInfo + +func (m *ScheduledAxelarCorks) GetScheduledCorks() []*ScheduledAxelarCork { + if m != nil { + return m.ScheduledCorks + } + return nil +} + +type AxelarCorkResult struct { + Cork *AxelarCork `protobuf:"bytes,1,opt,name=cork,proto3" json:"cork,omitempty"` + BlockHeight uint64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Approved bool `protobuf:"varint,3,opt,name=approved,proto3" json:"approved,omitempty"` + ApprovalPercentage string `protobuf:"bytes,4,opt,name=approval_percentage,json=approvalPercentage,proto3" json:"approval_percentage,omitempty"` +} + +func (m *AxelarCorkResult) Reset() { *m = AxelarCorkResult{} } +func (m *AxelarCorkResult) String() string { return proto.CompactTextString(m) } +func (*AxelarCorkResult) ProtoMessage() {} +func (*AxelarCorkResult) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{3} +} +func (m *AxelarCorkResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AxelarCorkResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AxelarCorkResult.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AxelarCorkResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_AxelarCorkResult.Merge(m, src) +} +func (m *AxelarCorkResult) XXX_Size() int { + return m.Size() +} +func (m *AxelarCorkResult) XXX_DiscardUnknown() { + xxx_messageInfo_AxelarCorkResult.DiscardUnknown(m) +} + +var xxx_messageInfo_AxelarCorkResult proto.InternalMessageInfo + +func (m *AxelarCorkResult) GetCork() *AxelarCork { + if m != nil { + return m.Cork + } + return nil +} + +func (m *AxelarCorkResult) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *AxelarCorkResult) GetApproved() bool { + if m != nil { + return m.Approved + } + return false +} + +func (m *AxelarCorkResult) GetApprovalPercentage() string { + if m != nil { + return m.ApprovalPercentage + } + return "" +} + +type AxelarCorkResults struct { + CorkResults []*AxelarCorkResult `protobuf:"bytes,1,rep,name=cork_results,json=corkResults,proto3" json:"cork_results,omitempty"` +} + +func (m *AxelarCorkResults) Reset() { *m = AxelarCorkResults{} } +func (m *AxelarCorkResults) String() string { return proto.CompactTextString(m) } +func (*AxelarCorkResults) ProtoMessage() {} +func (*AxelarCorkResults) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{4} +} +func (m *AxelarCorkResults) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AxelarCorkResults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AxelarCorkResults.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AxelarCorkResults) XXX_Merge(src proto.Message) { + xxx_messageInfo_AxelarCorkResults.Merge(m, src) +} +func (m *AxelarCorkResults) XXX_Size() int { + return m.Size() +} +func (m *AxelarCorkResults) XXX_DiscardUnknown() { + xxx_messageInfo_AxelarCorkResults.DiscardUnknown(m) +} + +var xxx_messageInfo_AxelarCorkResults proto.InternalMessageInfo + +func (m *AxelarCorkResults) GetCorkResults() []*AxelarCorkResult { + if m != nil { + return m.CorkResults + } + return nil +} + +type CellarIDSet struct { + Chain *ChainConfiguration `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` + Ids []string `protobuf:"bytes,2,rep,name=ids,proto3" json:"ids,omitempty"` +} + +func (m *CellarIDSet) Reset() { *m = CellarIDSet{} } +func (m *CellarIDSet) String() string { return proto.CompactTextString(m) } +func (*CellarIDSet) ProtoMessage() {} +func (*CellarIDSet) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{5} +} +func (m *CellarIDSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CellarIDSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CellarIDSet.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CellarIDSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_CellarIDSet.Merge(m, src) +} +func (m *CellarIDSet) XXX_Size() int { + return m.Size() +} +func (m *CellarIDSet) XXX_DiscardUnknown() { + xxx_messageInfo_CellarIDSet.DiscardUnknown(m) +} + +var xxx_messageInfo_CellarIDSet proto.InternalMessageInfo + +func (m *CellarIDSet) GetChain() *ChainConfiguration { + if m != nil { + return m.Chain + } + return nil +} + +func (m *CellarIDSet) GetIds() []string { + if m != nil { + return m.Ids + } + return nil +} + +type ChainConfiguration struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + ProxyAddress string `protobuf:"bytes,3,opt,name=proxy_address,json=proxyAddress,proto3" json:"proxy_address,omitempty"` +} + +func (m *ChainConfiguration) Reset() { *m = ChainConfiguration{} } +func (m *ChainConfiguration) String() string { return proto.CompactTextString(m) } +func (*ChainConfiguration) ProtoMessage() {} +func (*ChainConfiguration) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{6} +} +func (m *ChainConfiguration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainConfiguration.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChainConfiguration) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainConfiguration.Merge(m, src) +} +func (m *ChainConfiguration) XXX_Size() int { + return m.Size() +} +func (m *ChainConfiguration) XXX_DiscardUnknown() { + xxx_messageInfo_ChainConfiguration.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainConfiguration proto.InternalMessageInfo + +func (m *ChainConfiguration) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ChainConfiguration) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *ChainConfiguration) GetProxyAddress() string { + if m != nil { + return m.ProxyAddress + } + return "" +} + +type ChainConfigurations struct { + Configurations []*ChainConfiguration `protobuf:"bytes,1,rep,name=configurations,proto3" json:"configurations,omitempty"` +} + +func (m *ChainConfigurations) Reset() { *m = ChainConfigurations{} } +func (m *ChainConfigurations) String() string { return proto.CompactTextString(m) } +func (*ChainConfigurations) ProtoMessage() {} +func (*ChainConfigurations) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{7} +} +func (m *ChainConfigurations) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainConfigurations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainConfigurations.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ChainConfigurations) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainConfigurations.Merge(m, src) +} +func (m *ChainConfigurations) XXX_Size() int { + return m.Size() +} +func (m *ChainConfigurations) XXX_DiscardUnknown() { + xxx_messageInfo_ChainConfigurations.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainConfigurations proto.InternalMessageInfo + +func (m *ChainConfigurations) GetConfigurations() []*ChainConfiguration { + if m != nil { + return m.Configurations + } + return nil +} + +// Used to enforce strictly newer call ordering per contract +type AxelarContractCallNonce struct { + ChainId uint64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ContractAddress string `protobuf:"bytes,2,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` + Nonce uint64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"` +} + +func (m *AxelarContractCallNonce) Reset() { *m = AxelarContractCallNonce{} } +func (m *AxelarContractCallNonce) String() string { return proto.CompactTextString(m) } +func (*AxelarContractCallNonce) ProtoMessage() {} +func (*AxelarContractCallNonce) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{8} +} +func (m *AxelarContractCallNonce) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AxelarContractCallNonce) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AxelarContractCallNonce.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AxelarContractCallNonce) XXX_Merge(src proto.Message) { + xxx_messageInfo_AxelarContractCallNonce.Merge(m, src) +} +func (m *AxelarContractCallNonce) XXX_Size() int { + return m.Size() +} +func (m *AxelarContractCallNonce) XXX_DiscardUnknown() { + xxx_messageInfo_AxelarContractCallNonce.DiscardUnknown(m) +} + +var xxx_messageInfo_AxelarContractCallNonce proto.InternalMessageInfo + +func (m *AxelarContractCallNonce) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *AxelarContractCallNonce) GetContractAddress() string { + if m != nil { + return m.ContractAddress + } + return "" +} + +func (m *AxelarContractCallNonce) GetNonce() uint64 { + if m != nil { + return m.Nonce + } + return 0 +} + +// Represents a proxy contract upgrade approved by governance with a delay in +// execution in case of an error. +type AxelarUpgradeData struct { + ChainId uint64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + ExecutableHeightThreshold int64 `protobuf:"varint,3,opt,name=executable_height_threshold,json=executableHeightThreshold,proto3" json:"executable_height_threshold,omitempty"` +} + +func (m *AxelarUpgradeData) Reset() { *m = AxelarUpgradeData{} } +func (m *AxelarUpgradeData) String() string { return proto.CompactTextString(m) } +func (*AxelarUpgradeData) ProtoMessage() {} +func (*AxelarUpgradeData) Descriptor() ([]byte, []int) { + return fileDescriptor_f8790c2a041a4f43, []int{9} +} +func (m *AxelarUpgradeData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AxelarUpgradeData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AxelarUpgradeData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AxelarUpgradeData) XXX_Merge(src proto.Message) { + xxx_messageInfo_AxelarUpgradeData.Merge(m, src) +} +func (m *AxelarUpgradeData) XXX_Size() int { + return m.Size() +} +func (m *AxelarUpgradeData) XXX_DiscardUnknown() { + xxx_messageInfo_AxelarUpgradeData.DiscardUnknown(m) +} + +var xxx_messageInfo_AxelarUpgradeData proto.InternalMessageInfo + +func (m *AxelarUpgradeData) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *AxelarUpgradeData) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func (m *AxelarUpgradeData) GetExecutableHeightThreshold() int64 { + if m != nil { + return m.ExecutableHeightThreshold + } + return 0 +} + +func init() { + proto.RegisterType((*AxelarCork)(nil), "axelarcork.v1.AxelarCork") + proto.RegisterType((*ScheduledAxelarCork)(nil), "axelarcork.v1.ScheduledAxelarCork") + proto.RegisterType((*ScheduledAxelarCorks)(nil), "axelarcork.v1.ScheduledAxelarCorks") + proto.RegisterType((*AxelarCorkResult)(nil), "axelarcork.v1.AxelarCorkResult") + proto.RegisterType((*AxelarCorkResults)(nil), "axelarcork.v1.AxelarCorkResults") + proto.RegisterType((*CellarIDSet)(nil), "axelarcork.v1.CellarIDSet") + proto.RegisterType((*ChainConfiguration)(nil), "axelarcork.v1.ChainConfiguration") + proto.RegisterType((*ChainConfigurations)(nil), "axelarcork.v1.ChainConfigurations") + proto.RegisterType((*AxelarContractCallNonce)(nil), "axelarcork.v1.AxelarContractCallNonce") + proto.RegisterType((*AxelarUpgradeData)(nil), "axelarcork.v1.AxelarUpgradeData") +} + +func init() { proto.RegisterFile("axelarcork/v1/axelarcork.proto", fileDescriptor_f8790c2a041a4f43) } + +var fileDescriptor_f8790c2a041a4f43 = []byte{ + // 674 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x4d, 0x6f, 0xd3, 0x4c, + 0x10, 0xae, 0x93, 0xf4, 0x6d, 0x32, 0x49, 0x3f, 0xde, 0x4d, 0xab, 0xa6, 0x7d, 0x5f, 0x85, 0xd4, + 0x5c, 0xc2, 0x81, 0x58, 0x0d, 0x12, 0xbd, 0x21, 0xb5, 0xe9, 0x81, 0x0a, 0x84, 0x90, 0x0b, 0x02, + 0x21, 0x21, 0xb3, 0xd9, 0x1d, 0x1c, 0xd3, 0x8d, 0xd7, 0x5a, 0x6f, 0xa2, 0xe4, 0x1f, 0x70, 0xe4, + 0xc2, 0xef, 0x40, 0xfc, 0x0b, 0x8e, 0x3d, 0x72, 0x44, 0xed, 0x1f, 0x41, 0x59, 0x3b, 0x71, 0x92, + 0x16, 0xc4, 0x85, 0xdb, 0xce, 0x3c, 0xcf, 0x3e, 0x7e, 0x66, 0x3c, 0xb3, 0x50, 0xa7, 0x23, 0x14, + 0x54, 0x31, 0xa9, 0x2e, 0x9c, 0xe1, 0xa1, 0x93, 0x45, 0xad, 0x48, 0x49, 0x2d, 0xc9, 0xfa, 0x5c, + 0x66, 0x78, 0xb8, 0xbf, 0xed, 0x4b, 0x5f, 0x1a, 0xc4, 0x99, 0x9c, 0x12, 0x92, 0xfd, 0xc5, 0x02, + 0x38, 0x36, 0xbc, 0x8e, 0x54, 0x17, 0xa4, 0x0d, 0x3b, 0x18, 0x32, 0xc9, 0x91, 0x7b, 0x4c, 0x86, + 0x5a, 0x51, 0xa6, 0x3d, 0x46, 0x85, 0xa8, 0x59, 0x0d, 0xab, 0x59, 0x71, 0xab, 0x29, 0xd8, 0x49, + 0xb1, 0x0e, 0x15, 0x82, 0xec, 0x41, 0x91, 0xf5, 0x68, 0x10, 0x7a, 0x01, 0xaf, 0xe5, 0x1a, 0x56, + 0xb3, 0xe0, 0xae, 0x99, 0xf8, 0x8c, 0x93, 0x87, 0xb0, 0xab, 0xa9, 0xf2, 0x51, 0x67, 0x6a, 0x94, + 0x73, 0x85, 0x71, 0x5c, 0xcb, 0x37, 0xac, 0x66, 0xc9, 0xdd, 0x49, 0xe0, 0xa9, 0xde, 0x71, 0x02, + 0x92, 0x7d, 0x28, 0x72, 0xa4, 0x5c, 0x04, 0x21, 0xd6, 0x0a, 0x46, 0x72, 0x16, 0xdb, 0x9f, 0x2d, + 0xa8, 0x9e, 0xb3, 0x1e, 0xf2, 0x81, 0x40, 0x3e, 0x67, 0xfd, 0x3e, 0x14, 0x26, 0xa5, 0x1a, 0xa7, + 0xe5, 0xf6, 0x5e, 0x6b, 0xa1, 0xfa, 0x56, 0x46, 0x74, 0x0d, 0x8d, 0x1c, 0x40, 0xa5, 0x2b, 0x24, + 0xbb, 0xf0, 0x7a, 0x18, 0xf8, 0x3d, 0x9d, 0x3a, 0x2f, 0x9b, 0xdc, 0x63, 0x93, 0x22, 0xff, 0x43, + 0x69, 0x48, 0x45, 0xc0, 0xa9, 0x96, 0x2a, 0xf5, 0x9b, 0x25, 0xc8, 0x06, 0xe4, 0x02, 0x6e, 0xdc, + 0x95, 0xdc, 0x5c, 0xc0, 0x6d, 0x06, 0xdb, 0xb7, 0xd8, 0x8a, 0xc9, 0x13, 0xd8, 0x8c, 0xa7, 0x79, + 0x6f, 0xf2, 0xe9, 0xb8, 0x66, 0x35, 0xf2, 0xcd, 0x72, 0xdb, 0x5e, 0xb2, 0x78, 0xcb, 0x6d, 0x77, + 0x63, 0x76, 0xd5, 0x88, 0xd9, 0x5f, 0x2d, 0xd8, 0x9a, 0x83, 0x31, 0x1e, 0x08, 0xfd, 0x17, 0x2a, + 0xdf, 0x87, 0x22, 0x8d, 0x22, 0x25, 0x87, 0xc8, 0x4d, 0xe1, 0x45, 0x77, 0x16, 0x13, 0x07, 0xaa, + 0xc9, 0x99, 0x0a, 0x2f, 0x42, 0xc5, 0x30, 0xd4, 0xd4, 0xc7, 0xb4, 0x11, 0x64, 0x0a, 0x3d, 0x9f, + 0x21, 0xf6, 0x2b, 0xf8, 0x77, 0xd9, 0x72, 0x4c, 0x4e, 0xa0, 0x32, 0x31, 0xe3, 0xa9, 0x24, 0x4e, + 0x5b, 0x72, 0xe7, 0xd7, 0xde, 0x0d, 0xcf, 0x2d, 0xb3, 0x4c, 0xc3, 0x7e, 0x0d, 0xe5, 0x0e, 0x0a, + 0x41, 0xd5, 0xd9, 0xe9, 0x39, 0x6a, 0x72, 0x04, 0xab, 0x66, 0xee, 0xd2, 0x3e, 0x1c, 0x2c, 0x69, + 0x75, 0x26, 0x58, 0x47, 0x86, 0xef, 0x03, 0x7f, 0xa0, 0xa8, 0x0e, 0x64, 0xe8, 0x26, 0x7c, 0xb2, + 0x05, 0xf9, 0x80, 0xc7, 0xb5, 0x5c, 0x23, 0xdf, 0x2c, 0xb9, 0x93, 0xa3, 0xfd, 0x16, 0xc8, 0x4d, + 0x3a, 0x21, 0x50, 0x08, 0x69, 0x1f, 0x8d, 0x7e, 0xc9, 0x35, 0xe7, 0x74, 0x0a, 0x92, 0x16, 0xe6, + 0x02, 0x4e, 0xee, 0xc2, 0x7a, 0xa4, 0xe4, 0x68, 0xbc, 0x34, 0xe7, 0x15, 0x93, 0x4c, 0xc7, 0xdb, + 0x7e, 0x07, 0xd5, 0x9b, 0xf2, 0x31, 0x39, 0x83, 0x0d, 0xb6, 0x90, 0x49, 0xbb, 0xf2, 0x07, 0x95, + 0x2c, 0x5d, 0xb4, 0x07, 0xb0, 0x3b, 0xed, 0x5d, 0xb6, 0xa9, 0xcf, 0x64, 0xc8, 0x70, 0x61, 0x5d, + 0xad, 0xc5, 0x75, 0xbd, 0x07, 0x5b, 0x37, 0xf6, 0x34, 0x67, 0xfc, 0x6f, 0xb2, 0xa5, 0x0d, 0xdd, + 0x86, 0xd5, 0x70, 0x22, 0x67, 0xea, 0x2b, 0xb8, 0x49, 0x60, 0x7f, 0xb4, 0xa6, 0xff, 0xfa, 0x65, + 0xe4, 0x2b, 0xca, 0xf1, 0x94, 0x6a, 0xfa, 0xbb, 0x2f, 0xd6, 0x60, 0x2d, 0xa2, 0x63, 0x21, 0x69, + 0xd2, 0xc3, 0x8a, 0x3b, 0x0d, 0xc9, 0x23, 0xf8, 0x0f, 0x47, 0xc8, 0x06, 0x9a, 0x76, 0x05, 0xa6, + 0xa3, 0xea, 0xe9, 0x9e, 0xc2, 0xb8, 0x27, 0x45, 0x32, 0x95, 0x79, 0x77, 0x2f, 0xa3, 0x24, 0x93, + 0xfb, 0x62, 0x4a, 0x38, 0x79, 0xfa, 0xed, 0xaa, 0x6e, 0x5d, 0x5e, 0xd5, 0xad, 0x1f, 0x57, 0x75, + 0xeb, 0xd3, 0x75, 0x7d, 0xe5, 0xf2, 0xba, 0xbe, 0xf2, 0xfd, 0xba, 0xbe, 0xf2, 0xa6, 0xed, 0x07, + 0xba, 0x37, 0xe8, 0xb6, 0x98, 0xec, 0x3b, 0x11, 0xfa, 0xfe, 0xf8, 0xc3, 0xd0, 0x89, 0x65, 0xbf, + 0x8f, 0x22, 0x40, 0xe5, 0x0c, 0x8f, 0x9c, 0xd1, 0xdc, 0x5b, 0xea, 0xe8, 0x71, 0x84, 0x71, 0xf7, + 0x1f, 0xf3, 0x5a, 0x3e, 0xf8, 0x19, 0x00, 0x00, 0xff, 0xff, 0x0c, 0xb6, 0xb6, 0x93, 0x74, 0x05, + 0x00, 0x00, +} + +func (m *AxelarCork) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AxelarCork) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AxelarCork) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Deadline != 0 { + i = encodeVarintAxelarcork(dAtA, i, uint64(m.Deadline)) + i-- + dAtA[i] = 0x20 + } + if len(m.TargetContractAddress) > 0 { + i -= len(m.TargetContractAddress) + copy(dAtA[i:], m.TargetContractAddress) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.TargetContractAddress))) + i-- + dAtA[i] = 0x1a + } + if m.ChainId != 0 { + i = encodeVarintAxelarcork(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + if len(m.EncodedContractCall) > 0 { + i -= len(m.EncodedContractCall) + copy(dAtA[i:], m.EncodedContractCall) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.EncodedContractCall))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ScheduledAxelarCork) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ScheduledAxelarCork) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ScheduledAxelarCork) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x22 + } + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0x1a + } + if m.BlockHeight != 0 { + i = encodeVarintAxelarcork(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x10 + } + if m.Cork != nil { + { + size, err := m.Cork.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAxelarcork(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ScheduledAxelarCorks) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ScheduledAxelarCorks) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ScheduledAxelarCorks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ScheduledCorks) > 0 { + for iNdEx := len(m.ScheduledCorks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ScheduledCorks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAxelarcork(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *AxelarCorkResult) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AxelarCorkResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AxelarCorkResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ApprovalPercentage) > 0 { + i -= len(m.ApprovalPercentage) + copy(dAtA[i:], m.ApprovalPercentage) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.ApprovalPercentage))) + i-- + dAtA[i] = 0x22 + } + if m.Approved { + i-- + if m.Approved { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.BlockHeight != 0 { + i = encodeVarintAxelarcork(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x10 + } + if m.Cork != nil { + { + size, err := m.Cork.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAxelarcork(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AxelarCorkResults) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AxelarCorkResults) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AxelarCorkResults) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CorkResults) > 0 { + for iNdEx := len(m.CorkResults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CorkResults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAxelarcork(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *CellarIDSet) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CellarIDSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CellarIDSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ids) > 0 { + for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ids[iNdEx]) + copy(dAtA[i:], m.Ids[iNdEx]) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.Ids[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Chain != nil { + { + size, err := m.Chain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAxelarcork(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChainConfiguration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChainConfiguration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProxyAddress) > 0 { + i -= len(m.ProxyAddress) + copy(dAtA[i:], m.ProxyAddress) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.ProxyAddress))) + i-- + dAtA[i] = 0x1a + } + if m.Id != 0 { + i = encodeVarintAxelarcork(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChainConfigurations) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ChainConfigurations) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainConfigurations) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Configurations) > 0 { + for iNdEx := len(m.Configurations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Configurations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAxelarcork(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *AxelarContractCallNonce) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AxelarContractCallNonce) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AxelarContractCallNonce) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Nonce != 0 { + i = encodeVarintAxelarcork(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x18 + } + if len(m.ContractAddress) > 0 { + i -= len(m.ContractAddress) + copy(dAtA[i:], m.ContractAddress) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.ContractAddress))) + i-- + dAtA[i] = 0x12 + } + if m.ChainId != 0 { + i = encodeVarintAxelarcork(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AxelarUpgradeData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AxelarUpgradeData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AxelarUpgradeData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ExecutableHeightThreshold != 0 { + i = encodeVarintAxelarcork(dAtA, i, uint64(m.ExecutableHeightThreshold)) + i-- + dAtA[i] = 0x18 + } + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintAxelarcork(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x12 + } + if m.ChainId != 0 { + i = encodeVarintAxelarcork(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAxelarcork(dAtA []byte, offset int, v uint64) int { + offset -= sovAxelarcork(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AxelarCork) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EncodedContractCall) + if l > 0 { + n += 1 + l + sovAxelarcork(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovAxelarcork(uint64(m.ChainId)) + } + l = len(m.TargetContractAddress) + if l > 0 { + n += 1 + l + sovAxelarcork(uint64(l)) + } + if m.Deadline != 0 { + n += 1 + sovAxelarcork(uint64(m.Deadline)) + } + return n +} + +func (m *ScheduledAxelarCork) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Cork != nil { + l = m.Cork.Size() + n += 1 + l + sovAxelarcork(uint64(l)) + } + if m.BlockHeight != 0 { + n += 1 + sovAxelarcork(uint64(m.BlockHeight)) + } + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovAxelarcork(uint64(l)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovAxelarcork(uint64(l)) + } + return n +} + +func (m *ScheduledAxelarCorks) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ScheduledCorks) > 0 { + for _, e := range m.ScheduledCorks { + l = e.Size() + n += 1 + l + sovAxelarcork(uint64(l)) + } + } + return n +} + +func (m *AxelarCorkResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Cork != nil { + l = m.Cork.Size() + n += 1 + l + sovAxelarcork(uint64(l)) + } + if m.BlockHeight != 0 { + n += 1 + sovAxelarcork(uint64(m.BlockHeight)) + } + if m.Approved { + n += 2 + } + l = len(m.ApprovalPercentage) + if l > 0 { + n += 1 + l + sovAxelarcork(uint64(l)) + } + return n +} + +func (m *AxelarCorkResults) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.CorkResults) > 0 { + for _, e := range m.CorkResults { + l = e.Size() + n += 1 + l + sovAxelarcork(uint64(l)) + } + } + return n +} + +func (m *CellarIDSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Chain != nil { + l = m.Chain.Size() + n += 1 + l + sovAxelarcork(uint64(l)) + } + if len(m.Ids) > 0 { + for _, s := range m.Ids { + l = len(s) + n += 1 + l + sovAxelarcork(uint64(l)) + } + } + return n +} + +func (m *ChainConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovAxelarcork(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovAxelarcork(uint64(m.Id)) + } + l = len(m.ProxyAddress) + if l > 0 { + n += 1 + l + sovAxelarcork(uint64(l)) + } + return n +} + +func (m *ChainConfigurations) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Configurations) > 0 { + for _, e := range m.Configurations { + l = e.Size() + n += 1 + l + sovAxelarcork(uint64(l)) + } + } + return n +} + +func (m *AxelarContractCallNonce) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovAxelarcork(uint64(m.ChainId)) + } + l = len(m.ContractAddress) + if l > 0 { + n += 1 + l + sovAxelarcork(uint64(l)) + } + if m.Nonce != 0 { + n += 1 + sovAxelarcork(uint64(m.Nonce)) + } + return n +} + +func (m *AxelarUpgradeData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovAxelarcork(uint64(m.ChainId)) + } + l = len(m.Payload) + if l > 0 { + n += 1 + l + sovAxelarcork(uint64(l)) + } + if m.ExecutableHeightThreshold != 0 { + n += 1 + sovAxelarcork(uint64(m.ExecutableHeightThreshold)) + } + return n +} + +func sovAxelarcork(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAxelarcork(x uint64) (n int) { + return sovAxelarcork(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AxelarCork) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AxelarCork: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AxelarCork: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EncodedContractCall", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EncodedContractCall = append(m.EncodedContractCall[:0], dAtA[iNdEx:postIndex]...) + if m.EncodedContractCall == nil { + m.EncodedContractCall = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Deadline", wireType) + } + m.Deadline = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Deadline |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ScheduledAxelarCork) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ScheduledAxelarCork: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ScheduledAxelarCork: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cork", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Cork == nil { + m.Cork = &AxelarCork{} + } + if err := m.Cork.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ScheduledAxelarCorks) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ScheduledAxelarCorks: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ScheduledAxelarCorks: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ScheduledCorks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ScheduledCorks = append(m.ScheduledCorks, &ScheduledAxelarCork{}) + if err := m.ScheduledCorks[len(m.ScheduledCorks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AxelarCorkResult) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AxelarCorkResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AxelarCorkResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cork", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Cork == nil { + m.Cork = &AxelarCork{} + } + if err := m.Cork.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Approved", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Approved = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApprovalPercentage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ApprovalPercentage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AxelarCorkResults) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AxelarCorkResults: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AxelarCorkResults: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorkResults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CorkResults = append(m.CorkResults, &AxelarCorkResult{}) + if err := m.CorkResults[len(m.CorkResults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CellarIDSet) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CellarIDSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CellarIDSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Chain == nil { + m.Chain = &ChainConfiguration{} + } + if err := m.Chain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ids = append(m.Ids, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChainConfiguration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChainConfiguration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProxyAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProxyAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChainConfigurations) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChainConfigurations: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainConfigurations: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configurations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Configurations = append(m.Configurations, &ChainConfiguration{}) + if err := m.Configurations[len(m.Configurations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AxelarContractCallNonce) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AxelarContractCallNonce: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AxelarContractCallNonce: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AxelarUpgradeData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AxelarUpgradeData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AxelarUpgradeData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAxelarcork + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAxelarcork + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutableHeightThreshold", wireType) + } + m.ExecutableHeightThreshold = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExecutableHeightThreshold |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAxelarcork(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAxelarcork + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAxelarcork(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAxelarcork + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAxelarcork + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAxelarcork + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAxelarcork + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAxelarcork = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAxelarcork = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAxelarcork = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/axelarcork/types/chain_config.go b/x/axelarcork/types/chain_config.go new file mode 100644 index 00000000..74b759be --- /dev/null +++ b/x/axelarcork/types/chain_config.go @@ -0,0 +1,21 @@ +package types + +import ( + "fmt" +) + +func (cc ChainConfiguration) ValidateBasic() error { + if cc.ProxyAddress == "" { + return fmt.Errorf("proxy address cannot be empty") + } + + if cc.Id == 0 { + return fmt.Errorf("chain ID cannot be zero") + } + + if cc.Name == "" { + return fmt.Errorf("chain name cannot be empty") + } + + return nil +} diff --git a/x/axelarcork/types/codec.go b/x/axelarcork/types/codec.go new file mode 100644 index 00000000..9246c2a0 --- /dev/null +++ b/x/axelarcork/types/codec.go @@ -0,0 +1,61 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +// RegisterLegacyAminoCodec registers the vesting interfaces and concrete types on the +// provided LegacyAmino codec. These types are used for Amino JSON serialization +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgScheduleAxelarCorkRequest{}, "axelarcork/MsgScheduleAxelarCorkRequest", nil) + cdc.RegisterConcrete(&MsgRelayAxelarCorkRequest{}, "axelarcork/MsgRelayAxelarCorkRequest", nil) + cdc.RegisterConcrete(&MsgBumpAxelarCorkGasRequest{}, "axelarcork/MsgBumpAxelarCorkGasRequest", nil) + cdc.RegisterConcrete(&MsgCancelAxelarCorkRequest{}, "axelarcork/MsgCancelAxelarCorkRequest", nil) + cdc.RegisterConcrete(&MsgRelayAxelarProxyUpgradeRequest{}, "axelarcork/MsgRelayAxelarProxyUpgradeRequest", nil) +} + +var ( + amino = codec.NewLegacyAmino() + // ModuleCdc Note, the codec should ONLY be used in certain instances of tests and for + // JSON encoding as Amino is still used for that purpose. + // + // The actual codec used for serialization should be provided to x/staking and + // defined at the application level. + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + amino.Seal() +} + +// RegisterInterfaces registers the cork proto files +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgScheduleAxelarCorkRequest{}, + &MsgRelayAxelarCorkRequest{}, + &MsgBumpAxelarCorkGasRequest{}, + &MsgCancelAxelarCorkRequest{}, + &MsgRelayAxelarProxyUpgradeRequest{}, + ) + + registry.RegisterImplementations((*govtypes.Content)(nil), + &AxelarScheduledCorkProposal{}, + &AddChainConfigurationProposal{}, + &RemoveChainConfigurationProposal{}, + &AxelarCommunityPoolSpendProposal{}, + &AddAxelarManagedCellarIDsProposal{}, + &RemoveAxelarManagedCellarIDsProposal{}, + &UpgradeAxelarProxyContractProposal{}, + &CancelAxelarProxyContractUpgradeProposal{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/axelarcork/types/errors.go b/x/axelarcork/types/errors.go new file mode 100644 index 00000000..fe8639f4 --- /dev/null +++ b/x/axelarcork/types/errors.go @@ -0,0 +1,16 @@ +package types + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/cork module sentinel errors +var ( + ErrInvalidEVMAddress = sdkerrors.Register(ModuleName, 2, "invalid evm address") + ErrUnmanagedCellarAddress = sdkerrors.Register(ModuleName, 3, "cork sent to address that has not passed governance") + ErrEmptyContractCall = sdkerrors.Register(ModuleName, 4, "cork has an empty contract call body") + ErrSchedulingInThePast = sdkerrors.Register(ModuleName, 5, "cork is trying to be scheduled for a block that has already passed") + ErrInvalidJSON = sdkerrors.Register(ModuleName, 6, "invalid json") + ErrValuelessSend = sdkerrors.Register(ModuleName, 7, "transferring an empty token amount") + ErrDisabled = sdkerrors.Register(ModuleName, 8, "axelar disabled") +) diff --git a/x/axelarcork/types/event.pb.go b/x/axelarcork/types/event.pb.go new file mode 100644 index 00000000..e674b632 --- /dev/null +++ b/x/axelarcork/types/event.pb.go @@ -0,0 +1,494 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: axelarcork/v1/event.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ScheduleCorkEvent struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Validator string `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` + Cork string `protobuf:"bytes,3,opt,name=cork,proto3" json:"cork,omitempty"` + BlockHeight uint64 `protobuf:"varint,4,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + ChainId uint64 `protobuf:"varint,5,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *ScheduleCorkEvent) Reset() { *m = ScheduleCorkEvent{} } +func (m *ScheduleCorkEvent) String() string { return proto.CompactTextString(m) } +func (*ScheduleCorkEvent) ProtoMessage() {} +func (*ScheduleCorkEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_568389573c9d22fd, []int{0} +} +func (m *ScheduleCorkEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ScheduleCorkEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ScheduleCorkEvent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ScheduleCorkEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_ScheduleCorkEvent.Merge(m, src) +} +func (m *ScheduleCorkEvent) XXX_Size() int { + return m.Size() +} +func (m *ScheduleCorkEvent) XXX_DiscardUnknown() { + xxx_messageInfo_ScheduleCorkEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_ScheduleCorkEvent proto.InternalMessageInfo + +func (m *ScheduleCorkEvent) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *ScheduleCorkEvent) GetValidator() string { + if m != nil { + return m.Validator + } + return "" +} + +func (m *ScheduleCorkEvent) GetCork() string { + if m != nil { + return m.Cork + } + return "" +} + +func (m *ScheduleCorkEvent) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *ScheduleCorkEvent) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func init() { + proto.RegisterType((*ScheduleCorkEvent)(nil), "axelarcork.v1.ScheduleCorkEvent") +} + +func init() { proto.RegisterFile("axelarcork/v1/event.proto", fileDescriptor_568389573c9d22fd) } + +var fileDescriptor_568389573c9d22fd = []byte{ + // 264 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xbf, 0x4e, 0xc3, 0x30, + 0x10, 0xc6, 0x6b, 0x08, 0x85, 0x1a, 0x18, 0xb0, 0x10, 0x4a, 0x11, 0xb2, 0x0a, 0x53, 0xa7, 0x58, + 0x85, 0x81, 0x1d, 0x84, 0x04, 0x12, 0x53, 0xd9, 0x58, 0xaa, 0xfc, 0x39, 0x39, 0x26, 0x4e, 0x2e, + 0x72, 0x5c, 0xab, 0x7d, 0x0b, 0x76, 0x5e, 0x88, 0xb1, 0x23, 0x23, 0x4a, 0x5e, 0x04, 0xc5, 0x20, + 0x95, 0xed, 0xfb, 0x7e, 0x3f, 0xcb, 0xa7, 0x3b, 0x3a, 0x8e, 0x57, 0xa0, 0x63, 0x93, 0xa2, 0x29, + 0x84, 0x9b, 0x09, 0x70, 0x50, 0xd9, 0xa8, 0x36, 0x68, 0x91, 0x1d, 0x6f, 0x55, 0xe4, 0x66, 0xe7, + 0xa7, 0x12, 0x25, 0x7a, 0x23, 0xfa, 0xf4, 0xfb, 0xe8, 0xea, 0x83, 0xd0, 0x93, 0x97, 0x34, 0x87, + 0x6c, 0xa9, 0xe1, 0x1e, 0x4d, 0xf1, 0xd0, 0x7f, 0xc0, 0xce, 0xe8, 0xb0, 0x51, 0xb2, 0x02, 0x13, + 0x92, 0x09, 0x99, 0x8e, 0xe6, 0x7f, 0x8d, 0x5d, 0xd0, 0x91, 0x8b, 0xb5, 0xca, 0x62, 0x8b, 0x26, + 0xdc, 0xf1, 0x6a, 0x0b, 0x18, 0xa3, 0x41, 0x3f, 0x2c, 0xdc, 0xf5, 0xc2, 0x67, 0x76, 0x49, 0x8f, + 0x12, 0x8d, 0x69, 0xb1, 0xc8, 0x41, 0xc9, 0xdc, 0x86, 0xc1, 0x84, 0x4c, 0x83, 0xf9, 0xa1, 0x67, + 0x8f, 0x1e, 0xb1, 0x31, 0x3d, 0x48, 0xf3, 0x58, 0x55, 0x0b, 0x95, 0x85, 0x7b, 0x5e, 0xef, 0xfb, + 0xfe, 0x94, 0xdd, 0x3d, 0x7f, 0xb6, 0x9c, 0x6c, 0x5a, 0x4e, 0xbe, 0x5b, 0x4e, 0xde, 0x3b, 0x3e, + 0xd8, 0x74, 0x7c, 0xf0, 0xd5, 0xf1, 0xc1, 0xeb, 0xb5, 0x54, 0x36, 0x5f, 0x26, 0x51, 0x8a, 0xa5, + 0xa8, 0x41, 0xca, 0xf5, 0x9b, 0x13, 0x0d, 0x96, 0x25, 0x68, 0x05, 0x46, 0xb8, 0x5b, 0xb1, 0x12, + 0xff, 0x2e, 0x63, 0xd7, 0x35, 0x34, 0xc9, 0xd0, 0xaf, 0x7c, 0xf3, 0x13, 0x00, 0x00, 0xff, 0xff, + 0x1a, 0x10, 0x35, 0x2f, 0x34, 0x01, 0x00, 0x00, +} + +func (m *ScheduleCorkEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ScheduleCorkEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ScheduleCorkEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x28 + } + if m.BlockHeight != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x20 + } + if len(m.Cork) > 0 { + i -= len(m.Cork) + copy(dAtA[i:], m.Cork) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Cork))) + i-- + dAtA[i] = 0x1a + } + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ScheduleCorkEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Cork) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.BlockHeight != 0 { + n += 1 + sovEvent(uint64(m.BlockHeight)) + } + if m.ChainId != 0 { + n += 1 + sovEvent(uint64(m.ChainId)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ScheduleCorkEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ScheduleCorkEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ScheduleCorkEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cork", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cork = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvent + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvent + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvent + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/axelarcork/types/expected_keepers.go b/x/axelarcork/types/expected_keepers.go new file mode 100644 index 00000000..8e2bc9d1 --- /dev/null +++ b/x/axelarcork/types/expected_keepers.go @@ -0,0 +1,67 @@ +package types + +//go:generate mockgen --source=x/axelarcork/types/expected_keepers.go --destination=x/axelarcork/tests/mocks/expected_keepers_mocks.go --package=mocks + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" +) + +// AccountKeeper defines the expected account keeper. +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + + GetModuleAddress(name string) sdk.AccAddress + GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI + + SetModuleAccount(sdk.Context, authtypes.ModuleAccountI) +} + +type ICS4Wrapper interface { + WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, acknowledgement ibcexported.Acknowledgement) error + SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error +} + +// ChannelKeeper defines the channel contract that must be fulfilled when +// creating a x/ratelimit keeper. +type ChannelKeeper interface { + GetChannel(ctx sdk.Context, portID string, channelID string) (channeltypes.Channel, bool) + GetChannelClientState(ctx sdk.Context, portID string, channelID string) (string, ibcexported.ClientState, error) +} + +// StakingKeeper defines the expected staking keeper methods +type StakingKeeper interface { + GetBondedValidatorsByPower(ctx sdk.Context) []stakingtypes.Validator + GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress) int64 + GetLastTotalPower(ctx sdk.Context) (power sdk.Int) + IterateValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + IterateBondedValidatorsByPower(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + IterateLastValidators(sdk.Context, func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI + ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI + Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) + Jail(sdk.Context, sdk.ConsAddress) + PowerReduction(ctx sdk.Context) sdk.Int +} + +type TransferKeeper interface { + Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) +} + +type DistributionKeeper interface { + GetFeePool(ctx sdk.Context) (feePool distributiontypes.FeePool) + SetFeePool(ctx sdk.Context, feePool distributiontypes.FeePool) +} + +// GravityKeeper defines the expected gravity keeper methods +type GravityKeeper interface { + GetOrchestratorValidatorAddress(ctx sdk.Context, orchAddr sdk.AccAddress) sdk.ValAddress +} diff --git a/x/axelarcork/types/genesis.go b/x/axelarcork/types/genesis.go new file mode 100644 index 00000000..8c3b4749 --- /dev/null +++ b/x/axelarcork/types/genesis.go @@ -0,0 +1,56 @@ +package types + +const DefaultParamspace = ModuleName + +// DefaultGenesisState get raw genesis raw message for testing +func DefaultGenesisState() GenesisState { + defaultParams := DefaultParams() + return GenesisState{ + Params: &defaultParams, + ChainConfigurations: ChainConfigurations{}, + CellarIds: []*CellarIDSet{}, + ScheduledCorks: &ScheduledAxelarCorks{}, + CorkResults: &AxelarCorkResults{}, + AxelarContractCallNonces: []*AxelarContractCallNonce{}, + AxelarUpgradeData: []*AxelarUpgradeData{}, + } +} + +// Validate performs a basic stateless validation of the genesis fields. +func (gs GenesisState) Validate() error { + if err := gs.Params.ValidateBasic(); err != nil { + return err + } + + for _, cc := range gs.ChainConfigurations.Configurations { + if err := cc.ValidateBasic(); err != nil { + return err + } + } + + for _, sc := range gs.ScheduledCorks.ScheduledCorks { + if err := sc.Cork.ValidateBasic(); err != nil { + return err + } + } + + for _, cr := range gs.CorkResults.CorkResults { + if err := cr.Cork.ValidateBasic(); err != nil { + return err + } + } + + for _, ccn := range gs.AxelarContractCallNonces { + if err := ccn.ValidateBasic(); err != nil { + return err + } + } + + for _, aud := range gs.AxelarUpgradeData { + if err := aud.ValidateBasic(); err != nil { + return err + } + } + + return nil +} diff --git a/x/axelarcork/types/genesis.pb.go b/x/axelarcork/types/genesis.pb.go new file mode 100644 index 00000000..8714dd1a --- /dev/null +++ b/x/axelarcork/types/genesis.pb.go @@ -0,0 +1,1147 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: axelarcork/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState - all cork state that must be provided at genesis +type GenesisState struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + ChainConfigurations ChainConfigurations `protobuf:"bytes,2,opt,name=chain_configurations,json=chainConfigurations,proto3" json:"chain_configurations"` + CellarIds []*CellarIDSet `protobuf:"bytes,3,rep,name=cellar_ids,json=cellarIds,proto3" json:"cellar_ids,omitempty"` + ScheduledCorks *ScheduledAxelarCorks `protobuf:"bytes,4,opt,name=scheduled_corks,json=scheduledCorks,proto3" json:"scheduled_corks,omitempty"` + CorkResults *AxelarCorkResults `protobuf:"bytes,5,opt,name=cork_results,json=corkResults,proto3" json:"cork_results,omitempty"` + AxelarContractCallNonces []*AxelarContractCallNonce `protobuf:"bytes,6,rep,name=axelar_contract_call_nonces,json=axelarContractCallNonces,proto3" json:"axelar_contract_call_nonces,omitempty"` + AxelarUpgradeData []*AxelarUpgradeData `protobuf:"bytes,7,rep,name=axelar_upgrade_data,json=axelarUpgradeData,proto3" json:"axelar_upgrade_data,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_8d754a1cfeef5947, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +func (m *GenesisState) GetChainConfigurations() ChainConfigurations { + if m != nil { + return m.ChainConfigurations + } + return ChainConfigurations{} +} + +func (m *GenesisState) GetCellarIds() []*CellarIDSet { + if m != nil { + return m.CellarIds + } + return nil +} + +func (m *GenesisState) GetScheduledCorks() *ScheduledAxelarCorks { + if m != nil { + return m.ScheduledCorks + } + return nil +} + +func (m *GenesisState) GetCorkResults() *AxelarCorkResults { + if m != nil { + return m.CorkResults + } + return nil +} + +func (m *GenesisState) GetAxelarContractCallNonces() []*AxelarContractCallNonce { + if m != nil { + return m.AxelarContractCallNonces + } + return nil +} + +func (m *GenesisState) GetAxelarUpgradeData() []*AxelarUpgradeData { + if m != nil { + return m.AxelarUpgradeData + } + return nil +} + +type Params struct { + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty" yaml:"enabled"` + IbcChannel string `protobuf:"bytes,2,opt,name=ibc_channel,json=ibcChannel,proto3" json:"ibc_channel,omitempty" yaml:"ibc_channel"` + IbcPort string `protobuf:"bytes,3,opt,name=ibc_port,json=ibcPort,proto3" json:"ibc_port,omitempty" yaml:"ibc_port"` + GmpAccount string `protobuf:"bytes,4,opt,name=gmp_account,json=gmpAccount,proto3" json:"gmp_account,omitempty" yaml:"gmp_account"` + ExecutorAccount string `protobuf:"bytes,5,opt,name=executor_account,json=executorAccount,proto3" json:"executor_account,omitempty" yaml:"executor_account"` + TimeoutDuration uint64 `protobuf:"varint,6,opt,name=timeout_duration,json=timeoutDuration,proto3" json:"timeout_duration,omitempty" yaml:"timeout_duration"` + CorkTimeoutBlocks uint64 `protobuf:"varint,7,opt,name=cork_timeout_blocks,json=corkTimeoutBlocks,proto3" json:"cork_timeout_blocks,omitempty" yaml:"cork_timeout_blocks"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_8d754a1cfeef5947, []int{1} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func (m *Params) GetIbcChannel() string { + if m != nil { + return m.IbcChannel + } + return "" +} + +func (m *Params) GetIbcPort() string { + if m != nil { + return m.IbcPort + } + return "" +} + +func (m *Params) GetGmpAccount() string { + if m != nil { + return m.GmpAccount + } + return "" +} + +func (m *Params) GetExecutorAccount() string { + if m != nil { + return m.ExecutorAccount + } + return "" +} + +func (m *Params) GetTimeoutDuration() uint64 { + if m != nil { + return m.TimeoutDuration + } + return 0 +} + +func (m *Params) GetCorkTimeoutBlocks() uint64 { + if m != nil { + return m.CorkTimeoutBlocks + } + return 0 +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "axelarcork.v1.GenesisState") + proto.RegisterType((*Params)(nil), "axelarcork.v1.Params") +} + +func init() { proto.RegisterFile("axelarcork/v1/genesis.proto", fileDescriptor_8d754a1cfeef5947) } + +var fileDescriptor_8d754a1cfeef5947 = []byte{ + // 623 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xd1, 0x4e, 0xdb, 0x3c, + 0x1c, 0xc5, 0xdb, 0xaf, 0xa5, 0x05, 0x97, 0x8f, 0x0e, 0x97, 0x6d, 0x51, 0x91, 0xd2, 0x2a, 0x93, + 0x26, 0x2e, 0xb6, 0x46, 0xb0, 0x0b, 0xb4, 0xdd, 0xd1, 0xa2, 0x4d, 0x48, 0x08, 0x21, 0xb3, 0xdd, + 0x6c, 0x17, 0x91, 0xe3, 0x78, 0x69, 0x86, 0x13, 0x47, 0xb6, 0x53, 0xc1, 0x5b, 0xec, 0x15, 0xf6, + 0x16, 0x7b, 0x04, 0x2e, 0xb9, 0xdc, 0x55, 0x35, 0xc1, 0x1b, 0xf4, 0x09, 0xa6, 0xd8, 0x29, 0x6d, + 0x33, 0x76, 0x17, 0x9f, 0xf3, 0x3b, 0xc7, 0x49, 0xfc, 0x97, 0xc1, 0x2e, 0xbe, 0xa2, 0x0c, 0x0b, + 0xc2, 0xc5, 0xa5, 0x3b, 0xd9, 0x77, 0x43, 0x9a, 0x50, 0x19, 0xc9, 0x41, 0x2a, 0xb8, 0xe2, 0xf0, + 0xff, 0x85, 0x39, 0x98, 0xec, 0x77, 0xed, 0x55, 0x76, 0xc9, 0xd4, 0x78, 0x77, 0x27, 0xe4, 0x21, + 0xd7, 0x8f, 0x6e, 0xfe, 0x64, 0x54, 0xe7, 0x47, 0x1d, 0x6c, 0x7e, 0x30, 0xb5, 0x17, 0x0a, 0x2b, + 0x0a, 0x5f, 0x83, 0x46, 0x8a, 0x05, 0x8e, 0xa5, 0x55, 0xed, 0x57, 0xf7, 0x5a, 0x07, 0x4f, 0x07, + 0x2b, 0xdb, 0x0c, 0xce, 0xb5, 0x89, 0x0a, 0x08, 0x7e, 0x01, 0x3b, 0x64, 0x8c, 0xa3, 0xc4, 0x23, + 0x3c, 0xf9, 0x1a, 0x85, 0x99, 0xc0, 0x2a, 0xe2, 0x89, 0xb4, 0xfe, 0xd3, 0x61, 0xa7, 0x14, 0x1e, + 0xe5, 0xe8, 0x68, 0x85, 0x1c, 0xd6, 0x6f, 0xa6, 0xbd, 0x0a, 0xea, 0x90, 0xbf, 0x2d, 0xf8, 0x16, + 0x00, 0x42, 0x19, 0xc3, 0xc2, 0x8b, 0x02, 0x69, 0xd5, 0xfa, 0xb5, 0xbd, 0xd6, 0x41, 0xb7, 0x5c, + 0xa9, 0x81, 0x93, 0xe3, 0x0b, 0xaa, 0xd0, 0x86, 0xa1, 0x4f, 0x02, 0x09, 0x4f, 0x41, 0x5b, 0x92, + 0x31, 0x0d, 0x32, 0x46, 0x03, 0x2f, 0x67, 0xa5, 0x55, 0xd7, 0xaf, 0xf4, 0xa2, 0x94, 0xbf, 0x98, + 0x53, 0x47, 0x5a, 0x1e, 0xe5, 0x28, 0xda, 0x7a, 0xc8, 0xea, 0x35, 0x1c, 0x81, 0xcd, 0x9c, 0xf7, + 0x04, 0x95, 0x19, 0x53, 0xd2, 0x5a, 0xd3, 0x55, 0xfd, 0x52, 0xd5, 0xa2, 0x01, 0x19, 0x0e, 0xb5, + 0xc8, 0x62, 0x01, 0xe9, 0xfc, 0x38, 0xf3, 0x7f, 0xa5, 0x04, 0x26, 0xca, 0x23, 0x98, 0x31, 0x2f, + 0xe1, 0x09, 0xa1, 0xd2, 0x6a, 0xe8, 0xcf, 0x7b, 0xf9, 0x8f, 0x4e, 0x13, 0x18, 0x61, 0xc6, 0xce, + 0x72, 0x1c, 0x59, 0xf8, 0x71, 0x43, 0xc2, 0x73, 0xd0, 0x29, 0xb6, 0xc9, 0xd2, 0x50, 0xe0, 0x80, + 0x7a, 0x01, 0x56, 0xd8, 0x6a, 0xea, 0xfa, 0xc7, 0x5f, 0xf9, 0x93, 0x01, 0x8f, 0xb1, 0xc2, 0x68, + 0x1b, 0x97, 0x25, 0xe7, 0x67, 0x0d, 0x34, 0xcc, 0xb1, 0xc3, 0x57, 0xa0, 0x49, 0x13, 0xec, 0x33, + 0x1a, 0xe8, 0xf1, 0x58, 0x1f, 0xc2, 0xd9, 0xb4, 0xb7, 0x75, 0x8d, 0x63, 0xf6, 0xce, 0x29, 0x0c, + 0x07, 0xcd, 0x11, 0x78, 0x08, 0x5a, 0x91, 0x4f, 0x3c, 0x32, 0xc6, 0x49, 0x42, 0x99, 0x9e, 0x89, + 0x8d, 0xe1, 0xb3, 0xd9, 0xb4, 0x07, 0x4d, 0x62, 0xc9, 0x74, 0x10, 0x88, 0x7c, 0x32, 0x32, 0x0b, + 0x38, 0x00, 0xeb, 0xb9, 0x97, 0x72, 0xa1, 0xac, 0x9a, 0x4e, 0x75, 0x66, 0xd3, 0x5e, 0x7b, 0x91, + 0xca, 0x1d, 0x07, 0x35, 0x23, 0x9f, 0x9c, 0x73, 0xa1, 0xf2, 0x8d, 0xc2, 0x38, 0xf5, 0x30, 0x21, + 0x3c, 0x4b, 0x94, 0x3e, 0xe9, 0x95, 0x8d, 0x96, 0x4c, 0x07, 0x81, 0x30, 0x4e, 0x8f, 0xcc, 0x02, + 0xbe, 0x07, 0x4f, 0xe8, 0x15, 0x25, 0x99, 0xe2, 0xe2, 0x21, 0xbd, 0xa6, 0xd3, 0xbb, 0xb3, 0x69, + 0xef, 0x79, 0xf1, 0x61, 0x25, 0xc2, 0x41, 0xed, 0xb9, 0xb4, 0xd4, 0xa3, 0xa2, 0x98, 0xf2, 0x4c, + 0x79, 0x41, 0x31, 0xbe, 0x56, 0xa3, 0x5f, 0xdd, 0xab, 0x2f, 0xf7, 0x94, 0x09, 0x07, 0xb5, 0x0b, + 0xe9, 0xb8, 0x50, 0xe0, 0x19, 0xe8, 0xe8, 0x41, 0x9b, 0xa3, 0x3e, 0xe3, 0xe4, 0x52, 0x5a, 0x4d, + 0x5d, 0x65, 0xcf, 0xa6, 0xbd, 0xae, 0xa9, 0x7a, 0x04, 0x72, 0xd0, 0x76, 0xae, 0x7e, 0x34, 0xe2, + 0x50, 0x6b, 0xc3, 0xd3, 0x9b, 0x3b, 0xbb, 0x7a, 0x7b, 0x67, 0x57, 0x7f, 0xdf, 0xd9, 0xd5, 0xef, + 0xf7, 0x76, 0xe5, 0xf6, 0xde, 0xae, 0xfc, 0xba, 0xb7, 0x2b, 0x9f, 0x0f, 0xc2, 0x48, 0x8d, 0x33, + 0x7f, 0x40, 0x78, 0xec, 0xa6, 0x34, 0x0c, 0xaf, 0xbf, 0x4d, 0x5c, 0xc9, 0xe3, 0x98, 0xb2, 0x88, + 0x0a, 0x77, 0x72, 0xe8, 0x5e, 0x2d, 0x5d, 0x21, 0xae, 0xba, 0x4e, 0xa9, 0xf4, 0x1b, 0xfa, 0xce, + 0x78, 0xf3, 0x27, 0x00, 0x00, 0xff, 0xff, 0x89, 0x37, 0x67, 0xd6, 0x97, 0x04, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AxelarUpgradeData) > 0 { + for iNdEx := len(m.AxelarUpgradeData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AxelarUpgradeData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.AxelarContractCallNonces) > 0 { + for iNdEx := len(m.AxelarContractCallNonces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AxelarContractCallNonces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.CorkResults != nil { + { + size, err := m.CorkResults.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ScheduledCorks != nil { + { + size, err := m.ScheduledCorks.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.CellarIds) > 0 { + for iNdEx := len(m.CellarIds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CellarIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.ChainConfigurations.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CorkTimeoutBlocks != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.CorkTimeoutBlocks)) + i-- + dAtA[i] = 0x38 + } + if m.TimeoutDuration != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.TimeoutDuration)) + i-- + dAtA[i] = 0x30 + } + if len(m.ExecutorAccount) > 0 { + i -= len(m.ExecutorAccount) + copy(dAtA[i:], m.ExecutorAccount) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ExecutorAccount))) + i-- + dAtA[i] = 0x2a + } + if len(m.GmpAccount) > 0 { + i -= len(m.GmpAccount) + copy(dAtA[i:], m.GmpAccount) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.GmpAccount))) + i-- + dAtA[i] = 0x22 + } + if len(m.IbcPort) > 0 { + i -= len(m.IbcPort) + copy(dAtA[i:], m.IbcPort) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.IbcPort))) + i-- + dAtA[i] = 0x1a + } + if len(m.IbcChannel) > 0 { + i -= len(m.IbcChannel) + copy(dAtA[i:], m.IbcChannel) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.IbcChannel))) + i-- + dAtA[i] = 0x12 + } + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.ChainConfigurations.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.CellarIds) > 0 { + for _, e := range m.CellarIds { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.ScheduledCorks != nil { + l = m.ScheduledCorks.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.CorkResults != nil { + l = m.CorkResults.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.AxelarContractCallNonces) > 0 { + for _, e := range m.AxelarContractCallNonces { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AxelarUpgradeData) > 0 { + for _, e := range m.AxelarUpgradeData { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Enabled { + n += 2 + } + l = len(m.IbcChannel) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.IbcPort) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.GmpAccount) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ExecutorAccount) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.TimeoutDuration != 0 { + n += 1 + sovGenesis(uint64(m.TimeoutDuration)) + } + if m.CorkTimeoutBlocks != 0 { + n += 1 + sovGenesis(uint64(m.CorkTimeoutBlocks)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainConfigurations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ChainConfigurations.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CellarIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CellarIds = append(m.CellarIds, &CellarIDSet{}) + if err := m.CellarIds[len(m.CellarIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ScheduledCorks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ScheduledCorks == nil { + m.ScheduledCorks = &ScheduledAxelarCorks{} + } + if err := m.ScheduledCorks.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorkResults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CorkResults == nil { + m.CorkResults = &AxelarCorkResults{} + } + if err := m.CorkResults.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AxelarContractCallNonces", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AxelarContractCallNonces = append(m.AxelarContractCallNonces, &AxelarContractCallNonce{}) + if err := m.AxelarContractCallNonces[len(m.AxelarContractCallNonces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AxelarUpgradeData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AxelarUpgradeData = append(m.AxelarUpgradeData, &AxelarUpgradeData{}) + if err := m.AxelarUpgradeData[len(m.AxelarUpgradeData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IbcChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IbcPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IbcPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GmpAccount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GmpAccount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutorAccount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecutorAccount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutDuration", wireType) + } + m.TimeoutDuration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutDuration |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CorkTimeoutBlocks", wireType) + } + m.CorkTimeoutBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CorkTimeoutBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/axelarcork/types/keys.go b/x/axelarcork/types/keys.go new file mode 100644 index 00000000..d0f41e55 --- /dev/null +++ b/x/axelarcork/types/keys.go @@ -0,0 +1,120 @@ +package types + +import ( + "bytes" + "encoding/binary" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" +) + +const ( + // ModuleName is the module name constant used in many places + ModuleName = "axelarcork" + + // StoreKey is the store key string for oracle + StoreKey = ModuleName + + // RouterKey is the message route for oracle + RouterKey = ModuleName + + // QuerierRoute is the querier route for oracle + QuerierRoute = ModuleName +) + +// Keys for cork store, with -> +const ( + _ = byte(iota) + + // CorkForAddressKeyPrefix -
-> + CorkForAddressKeyPrefix // key for corks + + // CellarIDsKeyPrefix - -> []string + CellarIDsKeyPrefix + + // ScheduledCorkKeyPrefix -
-> + ScheduledCorkKeyPrefix + + // CorkResultPrefix - -> AxelarCorkResult + CorkResultPrefix + + // ChainConfigurationPrefix - -> ChainConfiguration + ChainConfigurationPrefix + + // WinningCorkPrefix - -> AxelarCork + WinningCorkPrefix + + // AxelarContractCallNoncePrefix - -> + AxelarContractCallNoncePrefix + + // AxelarProxyUpgradeDataPrefix - -> + AxelarProxyUpgradeDataPrefix +) + +// GetCorkValidatorKeyPrefix returns the key prefix for cork commits for a validator +func GetCorkValidatorKeyPrefix(chainID uint64, val sdk.ValAddress) []byte { + cid := make([]byte, 8) + binary.BigEndian.PutUint64(cid, chainID) + return bytes.Join([][]byte{{CorkForAddressKeyPrefix}, cid, val.Bytes()}, []byte{}) +} + +func MakeCellarIDsKey(chainID uint64) []byte { + cid := make([]byte, 8) + binary.BigEndian.PutUint64(cid, chainID) + return bytes.Join([][]byte{{CellarIDsKeyPrefix}, cid}, []byte{}) +} + +func GetScheduledAxelarCorkKeyPrefix(chainID uint64) []byte { + cid := make([]byte, 8) + binary.BigEndian.PutUint64(cid, chainID) + return bytes.Join([][]byte{{ScheduledCorkKeyPrefix}, cid}, []byte{}) +} + +func GetScheduledAxelarCorkKeyByBlockHeightPrefix(chainID uint64, blockHeight uint64) []byte { + return append(GetScheduledAxelarCorkKeyPrefix(chainID), sdk.Uint64ToBigEndian(blockHeight)...) +} + +func GetScheduledAxelarCorkKey(chainID uint64, blockHeight uint64, id []byte, val sdk.ValAddress, contract common.Address, deadline uint64) []byte { + blockHeightBytes := sdk.Uint64ToBigEndian(blockHeight) + return bytes.Join([][]byte{GetScheduledAxelarCorkKeyPrefix(chainID), blockHeightBytes, id, val.Bytes(), contract.Bytes(), sdk.Uint64ToBigEndian(deadline)}, []byte{}) +} + +func GetAxelarCorkResultPrefix(chainID uint64) []byte { + cid := make([]byte, 8) + binary.BigEndian.PutUint64(cid, chainID) + return bytes.Join([][]byte{{CorkResultPrefix}, cid}, []byte{}) +} + +func GetAxelarCorkResultKey(chainID uint64, id []byte) []byte { + return append(GetAxelarCorkResultPrefix(chainID), id...) +} + +func ChainConfigurationKey(chainID uint64) []byte { + cid := make([]byte, 8) + binary.BigEndian.PutUint64(cid, chainID) + return bytes.Join([][]byte{{ChainConfigurationPrefix}, cid}, []byte{}) +} + +func GetWinningAxelarCorkKeyPrefix(chainID uint64) []byte { + cid := make([]byte, 8) + binary.BigEndian.PutUint64(cid, chainID) + return bytes.Join([][]byte{{WinningCorkPrefix}, cid}, []byte{}) +} + +func GetWinningAxelarCorkKey(chainID uint64, blockheight uint64, address common.Address, deadline uint64) []byte { + bh := make([]byte, 8) + binary.BigEndian.PutUint64(bh, blockheight) + return bytes.Join([][]byte{GetWinningAxelarCorkKeyPrefix(chainID), bh, address.Bytes(), sdk.Uint64ToBigEndian(deadline)}, []byte{}) +} + +func GetAxelarContractCallNonceKey(chainID uint64, contractAddress common.Address) []byte { + cid := make([]byte, 8) + binary.BigEndian.PutUint64(cid, chainID) + return bytes.Join([][]byte{{AxelarContractCallNoncePrefix}, cid, contractAddress.Bytes()}, []byte{}) +} + +func GetAxelarProxyUpgradeDataKey(chainID uint64) []byte { + cid := make([]byte, 8) + binary.BigEndian.PutUint64(cid, chainID) + return bytes.Join([][]byte{{AxelarProxyUpgradeDataPrefix}, cid}, []byte{}) +} diff --git a/x/axelarcork/types/msgs.go b/x/axelarcork/types/msgs.go new file mode 100644 index 00000000..7ecdafc1 --- /dev/null +++ b/x/axelarcork/types/msgs.go @@ -0,0 +1,231 @@ +package types + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/ethereum/go-ethereum/common" +) + +var ( + _ sdk.Msg = &MsgScheduleAxelarCorkRequest{} +) + +const ( + TypeMsgScheduleCorkRequest = "axelar_cork_schedule" + TypeMsgRelayCorkRequest = "axelar_cork_relay" + TypeMsgBumpCorkGasRequest = "axelar_cork_bump_gas" + TypeMsgCancelAxelarCorkRequest = "axelar_cancel_cork" + TypeMsgRelayAxelarProxyUpgradeRequest = "axelar_proxy_upgrade_relay" +) + +//////////////////////////// +// MsgScheduleAxelarCorkRequest // +//////////////////////////// + +// NewMsgScheduleCorkRequest return a new MsgScheduleAxelarCorkRequest +func NewMsgScheduleCorkRequest(chainID uint64, body []byte, address common.Address, deadline uint64, blockHeight uint64, signer sdk.AccAddress) (*MsgScheduleAxelarCorkRequest, error) { + return &MsgScheduleAxelarCorkRequest{ + Cork: &AxelarCork{ + ChainId: chainID, + EncodedContractCall: body, + TargetContractAddress: address.String(), + Deadline: deadline, + }, + BlockHeight: blockHeight, + Signer: signer.String(), + }, nil +} + +// Route implements sdk.Msg +func (m *MsgScheduleAxelarCorkRequest) Route() string { return ModuleName } + +// Type implements sdk.Msg +func (m *MsgScheduleAxelarCorkRequest) Type() string { return TypeMsgScheduleCorkRequest } + +// ValidateBasic implements sdk.Msg +func (m *MsgScheduleAxelarCorkRequest) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Signer); err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, err.Error()) + } + + return m.Cork.ValidateBasic() +} + +// GetSignBytes implements sdk.Msg +func (m *MsgScheduleAxelarCorkRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +// GetSigners implements sdk.Msg +func (m *MsgScheduleAxelarCorkRequest) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{m.MustGetSigner()} +} + +// MustGetSigner returns the signer address +func (m *MsgScheduleAxelarCorkRequest) MustGetSigner() sdk.AccAddress { + addr, err := sdk.AccAddressFromBech32(m.Signer) + if err != nil { + panic(err) + } + return addr +} + +///////////////////////// +// MsgRelayAxelarCorkRequest // +///////////////////////// + +// Route implements sdk.Msg +func (m *MsgRelayAxelarCorkRequest) Route() string { return ModuleName } + +// Type implements sdk.Msg +func (m *MsgRelayAxelarCorkRequest) Type() string { return TypeMsgRelayCorkRequest } + +// ValidateBasic implements sdk.Msg +func (m *MsgRelayAxelarCorkRequest) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Signer); err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, err.Error()) + } + + if m.TargetContractAddress == "" { + return fmt.Errorf("cannot relay a cork to an empty address") + } + + return nil +} + +// GetSignBytes implements sdk.Msg +func (m *MsgRelayAxelarCorkRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +// GetSigners implements sdk.Msg +func (m *MsgRelayAxelarCorkRequest) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{m.MustGetSigner()} +} + +// MustGetSigner returns the signer address +func (m *MsgRelayAxelarCorkRequest) MustGetSigner() sdk.AccAddress { + addr, err := sdk.AccAddressFromBech32(m.Signer) + if err != nil { + panic(err) + } + return addr +} + +/////////////////////////////// +// MsgRelayAxelarProxyUpgradeRequest // +/////////////////////////////// + +// Route implements sdk.Msg +func (m *MsgRelayAxelarProxyUpgradeRequest) Route() string { return ModuleName } + +// Type implements sdk.Msg +func (m *MsgRelayAxelarProxyUpgradeRequest) Type() string { + return TypeMsgRelayAxelarProxyUpgradeRequest +} + +// ValidateBasic implements sdk.Msg +func (m *MsgRelayAxelarProxyUpgradeRequest) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Signer); err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, err.Error()) + } + + return nil +} + +// GetSignBytes implements sdk.Msg +func (m *MsgRelayAxelarProxyUpgradeRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +// GetSigners implements sdk.Msg +func (m *MsgRelayAxelarProxyUpgradeRequest) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{m.MustGetSigner()} +} + +// MustGetSigner returns the signer address +func (m *MsgRelayAxelarProxyUpgradeRequest) MustGetSigner() sdk.AccAddress { + addr, err := sdk.AccAddressFromBech32(m.Signer) + if err != nil { + panic(err) + } + return addr +} + +/////////////////////////// +// MsgBumpAxelarCorkGasRequest // +/////////////////////////// + +// Route implements sdk.Msg +func (m *MsgBumpAxelarCorkGasRequest) Route() string { return ModuleName } + +// Type implements sdk.Msg +func (m *MsgBumpAxelarCorkGasRequest) Type() string { return TypeMsgBumpCorkGasRequest } + +// ValidateBasic implements sdk.Msg +func (m *MsgBumpAxelarCorkGasRequest) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Signer); err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, err.Error()) + } + + return nil +} + +// GetSignBytes implements sdk.Msg +func (m *MsgBumpAxelarCorkGasRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +// GetSigners implements sdk.Msg +func (m *MsgBumpAxelarCorkGasRequest) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{m.MustGetSigner()} +} + +// MustGetSigner returns the signer address +func (m *MsgBumpAxelarCorkGasRequest) MustGetSigner() sdk.AccAddress { + addr, err := sdk.AccAddressFromBech32(m.Signer) + if err != nil { + panic(err) + } + return addr +} + +/////////////////////////// +// MsgCancelAxelarCorkRequest // +/////////////////////////// + +// Route implements sdk.Msg +func (m *MsgCancelAxelarCorkRequest) Route() string { return ModuleName } + +// Type implements sdk.Msg +func (m *MsgCancelAxelarCorkRequest) Type() string { return TypeMsgBumpCorkGasRequest } + +// ValidateBasic implements sdk.Msg +func (m *MsgCancelAxelarCorkRequest) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Signer); err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, err.Error()) + } + + return nil +} + +// GetSignBytes implements sdk.Msg +func (m *MsgCancelAxelarCorkRequest) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m)) +} + +// GetSigners implements sdk.Msg +func (m *MsgCancelAxelarCorkRequest) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{m.MustGetSigner()} +} + +// MustGetSigner returns the signer address +func (m *MsgCancelAxelarCorkRequest) MustGetSigner() sdk.AccAddress { + addr, err := sdk.AccAddressFromBech32(m.Signer) + if err != nil { + panic(err) + } + return addr +} diff --git a/x/axelarcork/types/params.go b/x/axelarcork/types/params.go new file mode 100644 index 00000000..13805a80 --- /dev/null +++ b/x/axelarcork/types/params.go @@ -0,0 +1,181 @@ +package types + +import ( + "errors" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + "github.com/ethereum/go-ethereum/common" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +// Parameter keys +var ( + KeyEnabled = []byte("enabled") + KeyIBCChannel = []byte("ibcchannel") + KeyIBCPort = []byte("ibcport") + KeyGMPAccount = []byte("gmpaccount") + KeyExecutorAccount = []byte("executoraccount") + KeyTimeoutDuration = []byte("timeoutduration") + KeyCorkTimeoutBlocks = []byte("corktimeoutblocks") +) + +var _ paramtypes.ParamSet = &Params{} + +// ParamKeyTable returns the parameter key table. +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// DefaultParams returns default oracle parameters +func DefaultParams() Params { + return Params{ + Enabled: false, + IbcChannel: "", + IbcPort: "", + GmpAccount: "", + ExecutorAccount: "", + TimeoutDuration: 0, + CorkTimeoutBlocks: 10000, + } +} + +// ParamSetPairs returns the parameter set pairs. +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyEnabled, &p.Enabled, validateEnabled), + paramtypes.NewParamSetPair(KeyIBCChannel, &p.IbcChannel, validateIBCChannel), + paramtypes.NewParamSetPair(KeyIBCPort, &p.IbcPort, validateIBCPort), + paramtypes.NewParamSetPair(KeyGMPAccount, &p.GmpAccount, validateGMPAccount), + paramtypes.NewParamSetPair(KeyExecutorAccount, &p.ExecutorAccount, validateExecutorAccount), + paramtypes.NewParamSetPair(KeyTimeoutDuration, &p.TimeoutDuration, validateTimeoutDuration), + paramtypes.NewParamSetPair(KeyCorkTimeoutBlocks, &p.CorkTimeoutBlocks, validateCorkTimeoutBlocks), + } +} + +// ValidateBasic performs basic validation on oracle parameters. +func (p *Params) ValidateBasic() error { + if err := validateEnabled(p.Enabled); err != nil { + return err + } + + if p.Enabled { + if err := validateIBCChannel(p.IbcChannel); err != nil { + return err + } + if err := validateIBCPort(p.IbcPort); err != nil { + return err + } + if err := validateGMPAccount(p.GmpAccount); err != nil { + return err + } + if err := validateExecutorAccount(p.ExecutorAccount); err != nil { + return err + } + if err := validateTimeoutDuration(p.TimeoutDuration); err != nil { + return err + } + if err := validateCorkTimeoutBlocks(p.CorkTimeoutBlocks); err != nil { + return err + } + } + + return nil +} + +func validateEnabled(i interface{}) error { + _, ok := i.(bool) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + return nil +} + +func validateIBCChannel(i interface{}) error { + ibcChannel, ok := i.(string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if err := host.ChannelIdentifierValidator(ibcChannel); err != nil { + return err + } + + return nil +} + +func validateIBCPort(i interface{}) error { + ibcPort, ok := i.(string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if err := host.PortIdentifierValidator(ibcPort); err != nil { + return err + } + + return nil +} + +func validateGMPAccount(i interface{}) error { + gmpAcc, ok := i.(string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if gmpAcc == "" { + return errors.New("gmp account cannot be empty") + } + + if _, err := sdk.AccAddressFromBech32(gmpAcc); err != nil { + return err + } + + return nil +} + +func validateExecutorAccount(i interface{}) error { + execAcc, ok := i.(string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if execAcc == "" { + return errors.New("executor account cannot be empty") + } + + if !common.IsHexAddress(execAcc) { + return errors.New("invalid executor account address") + } + + return nil +} + +func validateTimeoutDuration(i interface{}) error { + timeout, ok := i.(uint64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if timeout == 0 { + return errors.New("timeout duration cannot be zero") + } + + return nil +} + +func validateCorkTimeoutBlocks(i interface{}) error { + timeout, ok := i.(uint64) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if timeout == 0 { + return errors.New("timeout blocks cannot be zero") + } + + return nil +} diff --git a/x/axelarcork/types/params_test.go b/x/axelarcork/types/params_test.go new file mode 100644 index 00000000..4b844963 --- /dev/null +++ b/x/axelarcork/types/params_test.go @@ -0,0 +1,53 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestParamsValidate(t *testing.T) { + testCases := []struct { + name string + params Params + expPass bool + }{ + { + name: "default", + params: DefaultParams(), + expPass: true, + }, + { + name: "fake-configuration", + params: Params{ + Enabled: true, + IbcChannel: "test-channel", + IbcPort: "test-port", + GmpAccount: "test-account", + ExecutorAccount: "test-executor", + TimeoutDuration: 0, + }, + expPass: false, + }, + { + name: "empty", + params: Params{}, + expPass: true, + }, + { + name: "empty enabled", + params: Params{Enabled: true}, + expPass: false, + }, + } + + for _, tc := range testCases { + + err := tc.params.ValidateBasic() + if tc.expPass { + require.NoError(t, err, tc.name) + } else { + require.Error(t, err, tc.name) + } + } +} diff --git a/x/axelarcork/types/proposal.go b/x/axelarcork/types/proposal.go new file mode 100644 index 00000000..7598a00a --- /dev/null +++ b/x/axelarcork/types/proposal.go @@ -0,0 +1,295 @@ +package types + +import ( + "encoding/json" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/ethereum/go-ethereum/common" +) + +const ( + ProposalTypeAddManagedCellarIDs = "AddAxelarManagedCellarIDs" + + ProposalTypeRemoveManagedCellarIDs = "RemoveAxelarManagedCellarIDs" + ProposalTypeScheduledCork = "AxelarScheduledCork" + ProposalTypeCommunitySpend = "AxelarCommunitySpend" + ProposalTypeAddChainConfiguration = "AddAxelarChainConfiguration" + ProposalTypeRemoveChainConfiguration = "RemoveAxelarChainConfiguration" + ProposalTypeUpgradeAxelarProxyContract = "UpgradeAxelarProxyContract" + ProposalTypeCancelAxelarProxyContractUpgrade = "CancelAxelarProxyContractUpgrade" +) + +var _ govtypes.Content = &AddAxelarManagedCellarIDsProposal{} +var _ govtypes.Content = &RemoveAxelarManagedCellarIDsProposal{} +var _ govtypes.Content = &AxelarScheduledCorkProposal{} +var _ govtypes.Content = &AxelarCommunityPoolSpendProposal{} +var _ govtypes.Content = &AddChainConfigurationProposal{} +var _ govtypes.Content = &RemoveChainConfigurationProposal{} +var _ govtypes.Content = &UpgradeAxelarProxyContractProposal{} +var _ govtypes.Content = &CancelAxelarProxyContractUpgradeProposal{} + +func init() { + govtypes.RegisterProposalType(ProposalTypeAddManagedCellarIDs) + govtypes.RegisterProposalTypeCodec(&AddAxelarManagedCellarIDsProposal{}, "sommelier/AddAxelarManagedCellarIDsProposal") + + govtypes.RegisterProposalType(ProposalTypeRemoveManagedCellarIDs) + govtypes.RegisterProposalTypeCodec(&RemoveAxelarManagedCellarIDsProposal{}, "sommelier/RemoveAxelarManagedCellarIDsProposal") + + govtypes.RegisterProposalType(ProposalTypeScheduledCork) + govtypes.RegisterProposalTypeCodec(&AxelarScheduledCorkProposal{}, "sommelier/AxelarScheduledCorkProposal") + + govtypes.RegisterProposalType(ProposalTypeAddChainConfiguration) + govtypes.RegisterProposalTypeCodec(&AddChainConfigurationProposal{}, "sommelier/AddAxelarChainConfigurationProposal") + + govtypes.RegisterProposalType(ProposalTypeRemoveChainConfiguration) + govtypes.RegisterProposalTypeCodec(&RemoveChainConfigurationProposal{}, "sommelier/RemoveAxelarChainConfigurationProposal") + + govtypes.RegisterProposalType(ProposalTypeCommunitySpend) + govtypes.RegisterProposalTypeCodec(&AxelarCommunityPoolSpendProposal{}, "sommelier/AxelarCommunitySpendProposal") + + govtypes.RegisterProposalType(ProposalTypeUpgradeAxelarProxyContract) + govtypes.RegisterProposalTypeCodec(&UpgradeAxelarProxyContractProposal{}, "sommelier/UpgradeAxelarProxyContractProposal") + + govtypes.RegisterProposalType(ProposalTypeCancelAxelarProxyContractUpgrade) + govtypes.RegisterProposalTypeCodec(&CancelAxelarProxyContractUpgradeProposal{}, "sommelier/CancelAxelarProxyContractUpgradeProposal") +} + +func NewAddManagedCellarIDsProposal(title string, description string, chainID uint64, cellarIds *CellarIDSet) *AddAxelarManagedCellarIDsProposal { + return &AddAxelarManagedCellarIDsProposal{ + Title: title, + Description: description, + CellarIds: cellarIds, + ChainId: chainID, + } +} + +func (m *AddAxelarManagedCellarIDsProposal) ProposalRoute() string { + return RouterKey +} + +func (m *AddAxelarManagedCellarIDsProposal) ProposalType() string { + return ProposalTypeAddManagedCellarIDs +} + +func (m *AddAxelarManagedCellarIDsProposal) ValidateBasic() error { + if err := govtypes.ValidateAbstract(m); err != nil { + return err + } + + if len(m.CellarIds.Ids) == 0 { + return fmt.Errorf("can't have an add prosoposal with no cellars") + } + + return nil +} + +func NewRemoveManagedCellarIDsProposal(title string, description string, chainID uint64, cellarIds *CellarIDSet) *RemoveAxelarManagedCellarIDsProposal { + return &RemoveAxelarManagedCellarIDsProposal{ + Title: title, + Description: description, + CellarIds: cellarIds, + ChainId: chainID, + } +} + +func (m *RemoveAxelarManagedCellarIDsProposal) ProposalRoute() string { + return RouterKey +} + +func (m *RemoveAxelarManagedCellarIDsProposal) ProposalType() string { + return ProposalTypeRemoveManagedCellarIDs +} + +func (m *RemoveAxelarManagedCellarIDsProposal) ValidateBasic() error { + if err := govtypes.ValidateAbstract(m); err != nil { + return err + } + + if len(m.CellarIds.Ids) == 0 { + return fmt.Errorf("can't have a remove prosoposal with no cellars") + } + + return nil +} + +func NewAxelarScheduledCorkProposal(title string, description string, blockHeight uint64, chainID uint64, targetContractAddress string, contractCallProtoJSON string) *AxelarScheduledCorkProposal { + return &AxelarScheduledCorkProposal{ + Title: title, + Description: description, + BlockHeight: blockHeight, + ChainId: chainID, + TargetContractAddress: targetContractAddress, + ContractCallProtoJson: contractCallProtoJSON, + } +} + +func (m *AxelarScheduledCorkProposal) ProposalRoute() string { + return RouterKey +} + +func (m *AxelarScheduledCorkProposal) ProposalType() string { + return ProposalTypeScheduledCork +} + +func (m *AxelarScheduledCorkProposal) ValidateBasic() error { + if err := govtypes.ValidateAbstract(m); err != nil { + return err + } + + if len(m.ContractCallProtoJson) == 0 { + return sdkerrors.Wrapf(ErrInvalidJSON, "cannot have empty contract call") + } + + if !json.Valid([]byte(m.ContractCallProtoJson)) { + return sdkerrors.Wrapf(ErrInvalidJSON, "%s", m.ContractCallProtoJson) + } + + if !common.IsHexAddress(m.TargetContractAddress) { + return sdkerrors.Wrapf(ErrInvalidEVMAddress, "%s", m.TargetContractAddress) + } + + return nil +} + +func NewAxelarCommunitySpendProposal(title string, description string, recipient string, chainID uint64, amount sdk.Coin) *AxelarCommunityPoolSpendProposal { + return &AxelarCommunityPoolSpendProposal{ + Title: title, + Description: description, + Recipient: recipient, + ChainId: chainID, + Amount: amount, + } +} + +func (m *AxelarCommunityPoolSpendProposal) ProposalRoute() string { + return RouterKey +} + +func (m *AxelarCommunityPoolSpendProposal) ProposalType() string { + return ProposalTypeCommunitySpend +} + +func (m *AxelarCommunityPoolSpendProposal) ValidateBasic() error { + if err := govtypes.ValidateAbstract(m); err != nil { + return err + } + + if m.Amount.Amount.IsZero() { + return ErrValuelessSend + } + + if !common.IsHexAddress(m.Recipient) { + return sdkerrors.Wrapf(ErrInvalidEVMAddress, "%s", m.Recipient) + } + + return nil +} + +func NewAddChainConfigurationProposal(title string, description string, configuration ChainConfiguration) *AddChainConfigurationProposal { + return &AddChainConfigurationProposal{ + Title: title, + Description: description, + ChainConfiguration: &configuration, + } +} + +func (m *AddChainConfigurationProposal) ProposalRoute() string { + return RouterKey +} + +func (m *AddChainConfigurationProposal) ProposalType() string { + return ProposalTypeAddChainConfiguration +} + +func (m *AddChainConfigurationProposal) ValidateBasic() error { + if err := govtypes.ValidateAbstract(m); err != nil { + return err + } + + if err := m.ChainConfiguration.ValidateBasic(); err != nil { + return err + } + + return nil +} + +func NewRemoveChainConfigurationProposal(title string, description string, chainID uint64) *RemoveChainConfigurationProposal { + return &RemoveChainConfigurationProposal{ + Title: title, + Description: description, + ChainId: chainID, + } +} + +func (m *RemoveChainConfigurationProposal) ProposalRoute() string { + return RouterKey +} + +func (m *RemoveChainConfigurationProposal) ProposalType() string { + return ProposalTypeRemoveChainConfiguration +} + +func (m *RemoveChainConfigurationProposal) ValidateBasic() error { + if err := govtypes.ValidateAbstract(m); err != nil { + return err + } + + return nil +} + +func NewUpgradeAxelarProxyContractProposal(title string, description string, chainID uint64, newProxyAddress string) *UpgradeAxelarProxyContractProposal { + return &UpgradeAxelarProxyContractProposal{ + Title: title, + Description: description, + ChainId: chainID, + NewProxyAddress: newProxyAddress, + } +} + +func (m *UpgradeAxelarProxyContractProposal) ProposalRoute() string { + return RouterKey +} + +func (m *UpgradeAxelarProxyContractProposal) ProposalType() string { + return ProposalTypeUpgradeAxelarProxyContract +} + +func (m *UpgradeAxelarProxyContractProposal) ValidateBasic() error { + if err := govtypes.ValidateAbstract(m); err != nil { + return err + } + + if !common.IsHexAddress(m.NewProxyAddress) { + return sdkerrors.Wrapf(ErrInvalidEVMAddress, "%s", m.NewProxyAddress) + } + + return nil +} + +func NewCancelAxelarProxyContractUpgradeProposal(title string, description string, chainID uint64) *CancelAxelarProxyContractUpgradeProposal { + return &CancelAxelarProxyContractUpgradeProposal{ + Title: title, + Description: description, + ChainId: chainID, + } +} + +func (m *CancelAxelarProxyContractUpgradeProposal) ProposalRoute() string { + return RouterKey +} + +func (m *CancelAxelarProxyContractUpgradeProposal) ProposalType() string { + return ProposalTypeCancelAxelarProxyContractUpgrade +} + +func (m *CancelAxelarProxyContractUpgradeProposal) ValidateBasic() error { + if err := govtypes.ValidateAbstract(m); err != nil { + return err + } + + return nil +} diff --git a/x/axelarcork/types/proposal.pb.go b/x/axelarcork/types/proposal.pb.go new file mode 100644 index 00000000..08e78097 --- /dev/null +++ b/x/axelarcork/types/proposal.pb.go @@ -0,0 +1,5695 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: axelarcork/v1/proposal.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type AddAxelarManagedCellarIDsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + CellarIds *CellarIDSet `protobuf:"bytes,4,opt,name=cellar_ids,json=cellarIds,proto3" json:"cellar_ids,omitempty"` +} + +func (m *AddAxelarManagedCellarIDsProposal) Reset() { *m = AddAxelarManagedCellarIDsProposal{} } +func (m *AddAxelarManagedCellarIDsProposal) String() string { return proto.CompactTextString(m) } +func (*AddAxelarManagedCellarIDsProposal) ProtoMessage() {} +func (*AddAxelarManagedCellarIDsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{0} +} +func (m *AddAxelarManagedCellarIDsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddAxelarManagedCellarIDsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddAxelarManagedCellarIDsProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddAxelarManagedCellarIDsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddAxelarManagedCellarIDsProposal.Merge(m, src) +} +func (m *AddAxelarManagedCellarIDsProposal) XXX_Size() int { + return m.Size() +} +func (m *AddAxelarManagedCellarIDsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AddAxelarManagedCellarIDsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AddAxelarManagedCellarIDsProposal proto.InternalMessageInfo + +func (m *AddAxelarManagedCellarIDsProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *AddAxelarManagedCellarIDsProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *AddAxelarManagedCellarIDsProposal) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *AddAxelarManagedCellarIDsProposal) GetCellarIds() *CellarIDSet { + if m != nil { + return m.CellarIds + } + return nil +} + +// AddManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands +type AddAxelarManagedCellarIDsProposalWithDeposit struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + CellarIds *CellarIDSet `protobuf:"bytes,4,opt,name=cellar_ids,json=cellarIds,proto3" json:"cellar_ids,omitempty"` + Deposit string `protobuf:"bytes,5,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) Reset() { + *m = AddAxelarManagedCellarIDsProposalWithDeposit{} +} +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) String() string { + return proto.CompactTextString(m) +} +func (*AddAxelarManagedCellarIDsProposalWithDeposit) ProtoMessage() {} +func (*AddAxelarManagedCellarIDsProposalWithDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{1} +} +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddAxelarManagedCellarIDsProposalWithDeposit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddAxelarManagedCellarIDsProposalWithDeposit.Merge(m, src) +} +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) XXX_Size() int { + return m.Size() +} +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_AddAxelarManagedCellarIDsProposalWithDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_AddAxelarManagedCellarIDsProposalWithDeposit proto.InternalMessageInfo + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) GetCellarIds() *CellarIDSet { + if m != nil { + return m.CellarIds + } + return nil +} + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) GetDeposit() string { + if m != nil { + return m.Deposit + } + return "" +} + +type RemoveAxelarManagedCellarIDsProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + CellarIds *CellarIDSet `protobuf:"bytes,4,opt,name=cellar_ids,json=cellarIds,proto3" json:"cellar_ids,omitempty"` +} + +func (m *RemoveAxelarManagedCellarIDsProposal) Reset() { *m = RemoveAxelarManagedCellarIDsProposal{} } +func (m *RemoveAxelarManagedCellarIDsProposal) String() string { return proto.CompactTextString(m) } +func (*RemoveAxelarManagedCellarIDsProposal) ProtoMessage() {} +func (*RemoveAxelarManagedCellarIDsProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{2} +} +func (m *RemoveAxelarManagedCellarIDsProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RemoveAxelarManagedCellarIDsProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RemoveAxelarManagedCellarIDsProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RemoveAxelarManagedCellarIDsProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveAxelarManagedCellarIDsProposal.Merge(m, src) +} +func (m *RemoveAxelarManagedCellarIDsProposal) XXX_Size() int { + return m.Size() +} +func (m *RemoveAxelarManagedCellarIDsProposal) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveAxelarManagedCellarIDsProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveAxelarManagedCellarIDsProposal proto.InternalMessageInfo + +func (m *RemoveAxelarManagedCellarIDsProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *RemoveAxelarManagedCellarIDsProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *RemoveAxelarManagedCellarIDsProposal) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *RemoveAxelarManagedCellarIDsProposal) GetCellarIds() *CellarIDSet { + if m != nil { + return m.CellarIds + } + return nil +} + +// RemoveManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands +type RemoveAxelarManagedCellarIDsProposalWithDeposit struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + CellarIds *CellarIDSet `protobuf:"bytes,4,opt,name=cellar_ids,json=cellarIds,proto3" json:"cellar_ids,omitempty"` + Deposit string `protobuf:"bytes,5,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) Reset() { + *m = RemoveAxelarManagedCellarIDsProposalWithDeposit{} +} +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) String() string { + return proto.CompactTextString(m) +} +func (*RemoveAxelarManagedCellarIDsProposalWithDeposit) ProtoMessage() {} +func (*RemoveAxelarManagedCellarIDsProposalWithDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{3} +} +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RemoveAxelarManagedCellarIDsProposalWithDeposit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveAxelarManagedCellarIDsProposalWithDeposit.Merge(m, src) +} +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) XXX_Size() int { + return m.Size() +} +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveAxelarManagedCellarIDsProposalWithDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveAxelarManagedCellarIDsProposalWithDeposit proto.InternalMessageInfo + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) GetCellarIds() *CellarIDSet { + if m != nil { + return m.CellarIds + } + return nil +} + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) GetDeposit() string { + if m != nil { + return m.Deposit + } + return "" +} + +type AxelarScheduledCorkProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + BlockHeight uint64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + ChainId uint64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + TargetContractAddress string `protobuf:"bytes,5,opt,name=target_contract_address,json=targetContractAddress,proto3" json:"target_contract_address,omitempty"` + // + // The JSON representation of a ScheduleRequest defined in the Steward protos + // + // Example: The following is the JSON form of a ScheduleRequest containing a steward.v2.cellar_v1.TrustPosition + // message, which maps to the `trustPosition(address)` function of the the V1 Cellar contract. + // + // { + // "cellar_id": "0x1234567890000000000000000000000000000000", + // "cellar_v1": { + // "trust_position": { + // "erc20_address": "0x1234567890000000000000000000000000000000" + // } + // }, + // "block_height": 1000000 + // } + // + // You can use the Steward CLI to generate the required JSON rather than constructing it by hand + // https://github.com/peggyjv/steward + ContractCallProtoJson string `protobuf:"bytes,6,opt,name=contract_call_proto_json,json=contractCallProtoJson,proto3" json:"contract_call_proto_json,omitempty"` + // unix timestamp before which the contract call must be executed. + // enforced by the Axelar proxy contract + Deadline uint64 `protobuf:"varint,7,opt,name=deadline,proto3" json:"deadline,omitempty"` +} + +func (m *AxelarScheduledCorkProposal) Reset() { *m = AxelarScheduledCorkProposal{} } +func (m *AxelarScheduledCorkProposal) String() string { return proto.CompactTextString(m) } +func (*AxelarScheduledCorkProposal) ProtoMessage() {} +func (*AxelarScheduledCorkProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{4} +} +func (m *AxelarScheduledCorkProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AxelarScheduledCorkProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AxelarScheduledCorkProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AxelarScheduledCorkProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AxelarScheduledCorkProposal.Merge(m, src) +} +func (m *AxelarScheduledCorkProposal) XXX_Size() int { + return m.Size() +} +func (m *AxelarScheduledCorkProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AxelarScheduledCorkProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AxelarScheduledCorkProposal proto.InternalMessageInfo + +func (m *AxelarScheduledCorkProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *AxelarScheduledCorkProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *AxelarScheduledCorkProposal) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *AxelarScheduledCorkProposal) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *AxelarScheduledCorkProposal) GetTargetContractAddress() string { + if m != nil { + return m.TargetContractAddress + } + return "" +} + +func (m *AxelarScheduledCorkProposal) GetContractCallProtoJson() string { + if m != nil { + return m.ContractCallProtoJson + } + return "" +} + +func (m *AxelarScheduledCorkProposal) GetDeadline() uint64 { + if m != nil { + return m.Deadline + } + return 0 +} + +// ScheduledCorkProposalWithDeposit is a specific definition for CLI commands +type AxelarScheduledCorkProposalWithDeposit struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + BlockHeight uint64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + ChainId uint64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + TargetContractAddress string `protobuf:"bytes,5,opt,name=target_contract_address,json=targetContractAddress,proto3" json:"target_contract_address,omitempty"` + ContractCallProtoJson string `protobuf:"bytes,6,opt,name=contract_call_proto_json,json=contractCallProtoJson,proto3" json:"contract_call_proto_json,omitempty"` + Deadline uint64 `protobuf:"varint,7,opt,name=deadline,proto3" json:"deadline,omitempty"` + Deposit string `protobuf:"bytes,8,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *AxelarScheduledCorkProposalWithDeposit) Reset() { + *m = AxelarScheduledCorkProposalWithDeposit{} +} +func (m *AxelarScheduledCorkProposalWithDeposit) String() string { return proto.CompactTextString(m) } +func (*AxelarScheduledCorkProposalWithDeposit) ProtoMessage() {} +func (*AxelarScheduledCorkProposalWithDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{5} +} +func (m *AxelarScheduledCorkProposalWithDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AxelarScheduledCorkProposalWithDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AxelarScheduledCorkProposalWithDeposit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AxelarScheduledCorkProposalWithDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_AxelarScheduledCorkProposalWithDeposit.Merge(m, src) +} +func (m *AxelarScheduledCorkProposalWithDeposit) XXX_Size() int { + return m.Size() +} +func (m *AxelarScheduledCorkProposalWithDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_AxelarScheduledCorkProposalWithDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_AxelarScheduledCorkProposalWithDeposit proto.InternalMessageInfo + +func (m *AxelarScheduledCorkProposalWithDeposit) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *AxelarScheduledCorkProposalWithDeposit) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *AxelarScheduledCorkProposalWithDeposit) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *AxelarScheduledCorkProposalWithDeposit) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *AxelarScheduledCorkProposalWithDeposit) GetTargetContractAddress() string { + if m != nil { + return m.TargetContractAddress + } + return "" +} + +func (m *AxelarScheduledCorkProposalWithDeposit) GetContractCallProtoJson() string { + if m != nil { + return m.ContractCallProtoJson + } + return "" +} + +func (m *AxelarScheduledCorkProposalWithDeposit) GetDeadline() uint64 { + if m != nil { + return m.Deadline + } + return 0 +} + +func (m *AxelarScheduledCorkProposalWithDeposit) GetDeposit() string { + if m != nil { + return m.Deposit + } + return "" +} + +type AxelarCommunityPoolSpendProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` + ChainId uint64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Amount types.Coin `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount"` +} + +func (m *AxelarCommunityPoolSpendProposal) Reset() { *m = AxelarCommunityPoolSpendProposal{} } +func (m *AxelarCommunityPoolSpendProposal) String() string { return proto.CompactTextString(m) } +func (*AxelarCommunityPoolSpendProposal) ProtoMessage() {} +func (*AxelarCommunityPoolSpendProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{6} +} +func (m *AxelarCommunityPoolSpendProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AxelarCommunityPoolSpendProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AxelarCommunityPoolSpendProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AxelarCommunityPoolSpendProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AxelarCommunityPoolSpendProposal.Merge(m, src) +} +func (m *AxelarCommunityPoolSpendProposal) XXX_Size() int { + return m.Size() +} +func (m *AxelarCommunityPoolSpendProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AxelarCommunityPoolSpendProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AxelarCommunityPoolSpendProposal proto.InternalMessageInfo + +func (m *AxelarCommunityPoolSpendProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *AxelarCommunityPoolSpendProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *AxelarCommunityPoolSpendProposal) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *AxelarCommunityPoolSpendProposal) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *AxelarCommunityPoolSpendProposal) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +// This format of the community spend Ethereum proposal is specifically for +// the CLI to allow simple text serialization. +type AxelarCommunityPoolSpendProposalForCLI struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` + ChainId uint64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty" yaml:"chain_id"` + ChainName string `protobuf:"bytes,5,opt,name=chain_name,json=chainName,proto3" json:"chain_name,omitempty" yaml:"chain_name"` + Amount string `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty" yaml:"amount"` + Deposit string `protobuf:"bytes,7,opt,name=deposit,proto3" json:"deposit,omitempty" yaml:"deposit"` +} + +func (m *AxelarCommunityPoolSpendProposalForCLI) Reset() { + *m = AxelarCommunityPoolSpendProposalForCLI{} +} +func (m *AxelarCommunityPoolSpendProposalForCLI) String() string { return proto.CompactTextString(m) } +func (*AxelarCommunityPoolSpendProposalForCLI) ProtoMessage() {} +func (*AxelarCommunityPoolSpendProposalForCLI) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{7} +} +func (m *AxelarCommunityPoolSpendProposalForCLI) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AxelarCommunityPoolSpendProposalForCLI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AxelarCommunityPoolSpendProposalForCLI.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AxelarCommunityPoolSpendProposalForCLI) XXX_Merge(src proto.Message) { + xxx_messageInfo_AxelarCommunityPoolSpendProposalForCLI.Merge(m, src) +} +func (m *AxelarCommunityPoolSpendProposalForCLI) XXX_Size() int { + return m.Size() +} +func (m *AxelarCommunityPoolSpendProposalForCLI) XXX_DiscardUnknown() { + xxx_messageInfo_AxelarCommunityPoolSpendProposalForCLI.DiscardUnknown(m) +} + +var xxx_messageInfo_AxelarCommunityPoolSpendProposalForCLI proto.InternalMessageInfo + +type AddChainConfigurationProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainConfiguration *ChainConfiguration `protobuf:"bytes,3,opt,name=chain_configuration,json=chainConfiguration,proto3" json:"chain_configuration,omitempty"` +} + +func (m *AddChainConfigurationProposal) Reset() { *m = AddChainConfigurationProposal{} } +func (m *AddChainConfigurationProposal) String() string { return proto.CompactTextString(m) } +func (*AddChainConfigurationProposal) ProtoMessage() {} +func (*AddChainConfigurationProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{8} +} +func (m *AddChainConfigurationProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddChainConfigurationProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddChainConfigurationProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddChainConfigurationProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddChainConfigurationProposal.Merge(m, src) +} +func (m *AddChainConfigurationProposal) XXX_Size() int { + return m.Size() +} +func (m *AddChainConfigurationProposal) XXX_DiscardUnknown() { + xxx_messageInfo_AddChainConfigurationProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_AddChainConfigurationProposal proto.InternalMessageInfo + +func (m *AddChainConfigurationProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *AddChainConfigurationProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *AddChainConfigurationProposal) GetChainConfiguration() *ChainConfiguration { + if m != nil { + return m.ChainConfiguration + } + return nil +} + +type AddChainConfigurationProposalWithDeposit struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainConfiguration *ChainConfiguration `protobuf:"bytes,3,opt,name=chain_configuration,json=chainConfiguration,proto3" json:"chain_configuration,omitempty"` + Deposit string `protobuf:"bytes,4,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *AddChainConfigurationProposalWithDeposit) Reset() { + *m = AddChainConfigurationProposalWithDeposit{} +} +func (m *AddChainConfigurationProposalWithDeposit) String() string { return proto.CompactTextString(m) } +func (*AddChainConfigurationProposalWithDeposit) ProtoMessage() {} +func (*AddChainConfigurationProposalWithDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{9} +} +func (m *AddChainConfigurationProposalWithDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddChainConfigurationProposalWithDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddChainConfigurationProposalWithDeposit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddChainConfigurationProposalWithDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddChainConfigurationProposalWithDeposit.Merge(m, src) +} +func (m *AddChainConfigurationProposalWithDeposit) XXX_Size() int { + return m.Size() +} +func (m *AddChainConfigurationProposalWithDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_AddChainConfigurationProposalWithDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_AddChainConfigurationProposalWithDeposit proto.InternalMessageInfo + +func (m *AddChainConfigurationProposalWithDeposit) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *AddChainConfigurationProposalWithDeposit) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *AddChainConfigurationProposalWithDeposit) GetChainConfiguration() *ChainConfiguration { + if m != nil { + return m.ChainConfiguration + } + return nil +} + +func (m *AddChainConfigurationProposalWithDeposit) GetDeposit() string { + if m != nil { + return m.Deposit + } + return "" +} + +type RemoveChainConfigurationProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *RemoveChainConfigurationProposal) Reset() { *m = RemoveChainConfigurationProposal{} } +func (m *RemoveChainConfigurationProposal) String() string { return proto.CompactTextString(m) } +func (*RemoveChainConfigurationProposal) ProtoMessage() {} +func (*RemoveChainConfigurationProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{10} +} +func (m *RemoveChainConfigurationProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RemoveChainConfigurationProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RemoveChainConfigurationProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RemoveChainConfigurationProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveChainConfigurationProposal.Merge(m, src) +} +func (m *RemoveChainConfigurationProposal) XXX_Size() int { + return m.Size() +} +func (m *RemoveChainConfigurationProposal) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveChainConfigurationProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveChainConfigurationProposal proto.InternalMessageInfo + +func (m *RemoveChainConfigurationProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *RemoveChainConfigurationProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *RemoveChainConfigurationProposal) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +type RemoveChainConfigurationProposalWithDeposit struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Deposit string `protobuf:"bytes,4,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *RemoveChainConfigurationProposalWithDeposit) Reset() { + *m = RemoveChainConfigurationProposalWithDeposit{} +} +func (m *RemoveChainConfigurationProposalWithDeposit) String() string { + return proto.CompactTextString(m) +} +func (*RemoveChainConfigurationProposalWithDeposit) ProtoMessage() {} +func (*RemoveChainConfigurationProposalWithDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{11} +} +func (m *RemoveChainConfigurationProposalWithDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RemoveChainConfigurationProposalWithDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RemoveChainConfigurationProposalWithDeposit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RemoveChainConfigurationProposalWithDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveChainConfigurationProposalWithDeposit.Merge(m, src) +} +func (m *RemoveChainConfigurationProposalWithDeposit) XXX_Size() int { + return m.Size() +} +func (m *RemoveChainConfigurationProposalWithDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveChainConfigurationProposalWithDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveChainConfigurationProposalWithDeposit proto.InternalMessageInfo + +func (m *RemoveChainConfigurationProposalWithDeposit) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *RemoveChainConfigurationProposalWithDeposit) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *RemoveChainConfigurationProposalWithDeposit) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *RemoveChainConfigurationProposalWithDeposit) GetDeposit() string { + if m != nil { + return m.Deposit + } + return "" +} + +type UpgradeAxelarProxyContractProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + NewProxyAddress string `protobuf:"bytes,4,opt,name=new_proxy_address,json=newProxyAddress,proto3" json:"new_proxy_address,omitempty"` +} + +func (m *UpgradeAxelarProxyContractProposal) Reset() { *m = UpgradeAxelarProxyContractProposal{} } +func (m *UpgradeAxelarProxyContractProposal) String() string { return proto.CompactTextString(m) } +func (*UpgradeAxelarProxyContractProposal) ProtoMessage() {} +func (*UpgradeAxelarProxyContractProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{12} +} +func (m *UpgradeAxelarProxyContractProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpgradeAxelarProxyContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpgradeAxelarProxyContractProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpgradeAxelarProxyContractProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpgradeAxelarProxyContractProposal.Merge(m, src) +} +func (m *UpgradeAxelarProxyContractProposal) XXX_Size() int { + return m.Size() +} +func (m *UpgradeAxelarProxyContractProposal) XXX_DiscardUnknown() { + xxx_messageInfo_UpgradeAxelarProxyContractProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_UpgradeAxelarProxyContractProposal proto.InternalMessageInfo + +func (m *UpgradeAxelarProxyContractProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *UpgradeAxelarProxyContractProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *UpgradeAxelarProxyContractProposal) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *UpgradeAxelarProxyContractProposal) GetNewProxyAddress() string { + if m != nil { + return m.NewProxyAddress + } + return "" +} + +type UpgradeAxelarProxyContractProposalWithDeposit struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + NewProxyAddress string `protobuf:"bytes,4,opt,name=new_proxy_address,json=newProxyAddress,proto3" json:"new_proxy_address,omitempty"` + Deposit string `protobuf:"bytes,5,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) Reset() { + *m = UpgradeAxelarProxyContractProposalWithDeposit{} +} +func (m *UpgradeAxelarProxyContractProposalWithDeposit) String() string { + return proto.CompactTextString(m) +} +func (*UpgradeAxelarProxyContractProposalWithDeposit) ProtoMessage() {} +func (*UpgradeAxelarProxyContractProposalWithDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{13} +} +func (m *UpgradeAxelarProxyContractProposalWithDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpgradeAxelarProxyContractProposalWithDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpgradeAxelarProxyContractProposalWithDeposit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UpgradeAxelarProxyContractProposalWithDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpgradeAxelarProxyContractProposalWithDeposit.Merge(m, src) +} +func (m *UpgradeAxelarProxyContractProposalWithDeposit) XXX_Size() int { + return m.Size() +} +func (m *UpgradeAxelarProxyContractProposalWithDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_UpgradeAxelarProxyContractProposalWithDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_UpgradeAxelarProxyContractProposalWithDeposit proto.InternalMessageInfo + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) GetNewProxyAddress() string { + if m != nil { + return m.NewProxyAddress + } + return "" +} + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) GetDeposit() string { + if m != nil { + return m.Deposit + } + return "" +} + +type CancelAxelarProxyContractUpgradeProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *CancelAxelarProxyContractUpgradeProposal) Reset() { + *m = CancelAxelarProxyContractUpgradeProposal{} +} +func (m *CancelAxelarProxyContractUpgradeProposal) String() string { return proto.CompactTextString(m) } +func (*CancelAxelarProxyContractUpgradeProposal) ProtoMessage() {} +func (*CancelAxelarProxyContractUpgradeProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{14} +} +func (m *CancelAxelarProxyContractUpgradeProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CancelAxelarProxyContractUpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CancelAxelarProxyContractUpgradeProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CancelAxelarProxyContractUpgradeProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_CancelAxelarProxyContractUpgradeProposal.Merge(m, src) +} +func (m *CancelAxelarProxyContractUpgradeProposal) XXX_Size() int { + return m.Size() +} +func (m *CancelAxelarProxyContractUpgradeProposal) XXX_DiscardUnknown() { + xxx_messageInfo_CancelAxelarProxyContractUpgradeProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_CancelAxelarProxyContractUpgradeProposal proto.InternalMessageInfo + +func (m *CancelAxelarProxyContractUpgradeProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *CancelAxelarProxyContractUpgradeProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *CancelAxelarProxyContractUpgradeProposal) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +type CancelAxelarProxyContractUpgradeProposalWithDeposit struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + ChainId uint64 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Deposit string `protobuf:"bytes,4,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) Reset() { + *m = CancelAxelarProxyContractUpgradeProposalWithDeposit{} +} +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) String() string { + return proto.CompactTextString(m) +} +func (*CancelAxelarProxyContractUpgradeProposalWithDeposit) ProtoMessage() {} +func (*CancelAxelarProxyContractUpgradeProposalWithDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_5ffc5027adef0afd, []int{15} +} +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CancelAxelarProxyContractUpgradeProposalWithDeposit.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_CancelAxelarProxyContractUpgradeProposalWithDeposit.Merge(m, src) +} +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) XXX_Size() int { + return m.Size() +} +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_CancelAxelarProxyContractUpgradeProposalWithDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_CancelAxelarProxyContractUpgradeProposalWithDeposit proto.InternalMessageInfo + +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) GetDeposit() string { + if m != nil { + return m.Deposit + } + return "" +} + +func init() { + proto.RegisterType((*AddAxelarManagedCellarIDsProposal)(nil), "axelarcork.v1.AddAxelarManagedCellarIDsProposal") + proto.RegisterType((*AddAxelarManagedCellarIDsProposalWithDeposit)(nil), "axelarcork.v1.AddAxelarManagedCellarIDsProposalWithDeposit") + proto.RegisterType((*RemoveAxelarManagedCellarIDsProposal)(nil), "axelarcork.v1.RemoveAxelarManagedCellarIDsProposal") + proto.RegisterType((*RemoveAxelarManagedCellarIDsProposalWithDeposit)(nil), "axelarcork.v1.RemoveAxelarManagedCellarIDsProposalWithDeposit") + proto.RegisterType((*AxelarScheduledCorkProposal)(nil), "axelarcork.v1.AxelarScheduledCorkProposal") + proto.RegisterType((*AxelarScheduledCorkProposalWithDeposit)(nil), "axelarcork.v1.AxelarScheduledCorkProposalWithDeposit") + proto.RegisterType((*AxelarCommunityPoolSpendProposal)(nil), "axelarcork.v1.AxelarCommunityPoolSpendProposal") + proto.RegisterType((*AxelarCommunityPoolSpendProposalForCLI)(nil), "axelarcork.v1.AxelarCommunityPoolSpendProposalForCLI") + proto.RegisterType((*AddChainConfigurationProposal)(nil), "axelarcork.v1.AddChainConfigurationProposal") + proto.RegisterType((*AddChainConfigurationProposalWithDeposit)(nil), "axelarcork.v1.AddChainConfigurationProposalWithDeposit") + proto.RegisterType((*RemoveChainConfigurationProposal)(nil), "axelarcork.v1.RemoveChainConfigurationProposal") + proto.RegisterType((*RemoveChainConfigurationProposalWithDeposit)(nil), "axelarcork.v1.RemoveChainConfigurationProposalWithDeposit") + proto.RegisterType((*UpgradeAxelarProxyContractProposal)(nil), "axelarcork.v1.UpgradeAxelarProxyContractProposal") + proto.RegisterType((*UpgradeAxelarProxyContractProposalWithDeposit)(nil), "axelarcork.v1.UpgradeAxelarProxyContractProposalWithDeposit") + proto.RegisterType((*CancelAxelarProxyContractUpgradeProposal)(nil), "axelarcork.v1.CancelAxelarProxyContractUpgradeProposal") + proto.RegisterType((*CancelAxelarProxyContractUpgradeProposalWithDeposit)(nil), "axelarcork.v1.CancelAxelarProxyContractUpgradeProposalWithDeposit") +} + +func init() { proto.RegisterFile("axelarcork/v1/proposal.proto", fileDescriptor_5ffc5027adef0afd) } + +var fileDescriptor_5ffc5027adef0afd = []byte{ + // 928 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xa4, 0x6e, 0x12, 0x8f, 0x53, 0xda, 0x6c, 0x53, 0xd8, 0x86, 0xe2, 0x75, 0x46, 0xa8, + 0x32, 0x50, 0x76, 0x15, 0x17, 0x11, 0xc8, 0x2d, 0xde, 0x0a, 0x11, 0x54, 0x50, 0xb4, 0x11, 0x42, + 0xe2, 0x62, 0x8d, 0x77, 0x86, 0xf5, 0x34, 0xbb, 0x33, 0xab, 0xdd, 0xb5, 0x1b, 0x1f, 0x38, 0xd3, + 0x23, 0x47, 0xc4, 0xc9, 0x82, 0x23, 0x27, 0x24, 0xfe, 0x02, 0x52, 0x8e, 0x39, 0x21, 0xe0, 0x60, + 0xa1, 0xe4, 0xc2, 0xd9, 0xbf, 0x00, 0x79, 0x66, 0xd7, 0x59, 0x37, 0x8d, 0x53, 0x94, 0x5a, 0x90, + 0xde, 0x3c, 0xef, 0x9b, 0xd9, 0xf9, 0xbe, 0xef, 0xbd, 0x99, 0x37, 0x86, 0x77, 0xf0, 0x3e, 0xf5, + 0x71, 0xe4, 0x8a, 0x68, 0xcf, 0xea, 0xae, 0x5b, 0x61, 0x24, 0x42, 0x11, 0x63, 0xdf, 0x0c, 0x23, + 0x91, 0x08, 0xed, 0xda, 0x09, 0x6a, 0x76, 0xd7, 0x57, 0x2b, 0x93, 0x93, 0x73, 0xa0, 0x9c, 0xbe, + 0xba, 0xe2, 0x09, 0x4f, 0xc8, 0x9f, 0xd6, 0xe8, 0x57, 0x1a, 0xad, 0xb8, 0x22, 0x0e, 0x44, 0x6c, + 0xb5, 0x70, 0x4c, 0xad, 0xee, 0x7a, 0x8b, 0x26, 0x78, 0xdd, 0x72, 0x05, 0xe3, 0x0a, 0x47, 0x3f, + 0x03, 0xb8, 0xb6, 0x45, 0xc8, 0x96, 0xfc, 0xda, 0xa7, 0x98, 0x63, 0x8f, 0x12, 0x9b, 0xfa, 0x3e, + 0x8e, 0xb6, 0x1f, 0xc4, 0x3b, 0x29, 0x21, 0x6d, 0x05, 0x5e, 0x4d, 0x58, 0xe2, 0x53, 0x1d, 0x54, + 0x41, 0xad, 0xe4, 0xa8, 0x81, 0x56, 0x85, 0x65, 0x42, 0x63, 0x37, 0x62, 0x61, 0xc2, 0x04, 0xd7, + 0xe7, 0x24, 0x96, 0x0f, 0x69, 0xb7, 0xe1, 0xa2, 0xdb, 0xc6, 0x8c, 0x37, 0x19, 0xd1, 0xaf, 0x54, + 0x41, 0xad, 0xe8, 0x2c, 0xc8, 0xf1, 0x36, 0xd1, 0x3e, 0x84, 0xd0, 0x95, 0xfb, 0x34, 0x19, 0x89, + 0xf5, 0x62, 0x15, 0xd4, 0xca, 0xf5, 0x55, 0x73, 0x42, 0xb2, 0x99, 0x11, 0xd9, 0xa5, 0x89, 0x53, + 0x52, 0xb3, 0xb7, 0x49, 0x8c, 0x7e, 0x03, 0xf0, 0xde, 0xb9, 0x9c, 0xbf, 0x60, 0x49, 0xfb, 0x01, + 0x0d, 0x45, 0xcc, 0x92, 0xff, 0x17, 0x7d, 0x4d, 0x87, 0x0b, 0x44, 0x11, 0xd3, 0xaf, 0xca, 0x3d, + 0xb3, 0x21, 0xfa, 0x05, 0xc0, 0x37, 0x1d, 0x1a, 0x88, 0x2e, 0xbd, 0x54, 0xf9, 0xf8, 0x03, 0x40, + 0xeb, 0x79, 0x68, 0x5f, 0xc6, 0x94, 0xf4, 0xe7, 0xe0, 0xeb, 0x4a, 0xd5, 0xae, 0xdb, 0xa6, 0xa4, + 0xe3, 0x53, 0x62, 0x8b, 0x68, 0xef, 0xc2, 0x99, 0x58, 0x83, 0x4b, 0x2d, 0x5f, 0xb8, 0x7b, 0xcd, + 0x36, 0x65, 0x5e, 0x3b, 0x49, 0xb5, 0x94, 0x65, 0xec, 0x63, 0x19, 0x9a, 0x90, 0x5a, 0x9c, 0x94, + 0xfa, 0x3e, 0x7c, 0x2d, 0xc1, 0x91, 0x47, 0x93, 0xa6, 0x2b, 0x78, 0x12, 0x61, 0x37, 0x69, 0x62, + 0x42, 0x22, 0x1a, 0xc7, 0x29, 0xff, 0x5b, 0x0a, 0xb6, 0x53, 0x74, 0x4b, 0x81, 0xda, 0x06, 0xd4, + 0xc7, 0x0b, 0x5c, 0xec, 0xfb, 0x4d, 0x79, 0x09, 0x34, 0x1f, 0xc5, 0x82, 0xeb, 0xf3, 0x6a, 0x61, + 0x86, 0xdb, 0xd8, 0xf7, 0x77, 0x46, 0xe8, 0x27, 0xb1, 0xe0, 0xda, 0x2a, 0x5c, 0x24, 0x14, 0x13, + 0x9f, 0x71, 0xaa, 0x2f, 0x48, 0x2e, 0xe3, 0x31, 0xfa, 0x75, 0x0e, 0xde, 0x9d, 0x62, 0xd1, 0x8b, + 0xc8, 0xfa, 0xcb, 0xe3, 0x56, 0xbe, 0xd4, 0x16, 0x27, 0x4b, 0xed, 0x4f, 0x00, 0xab, 0xca, 0x47, + 0x5b, 0x04, 0x41, 0x87, 0xb3, 0xa4, 0xb7, 0x23, 0x84, 0xbf, 0x1b, 0x52, 0x4e, 0x2e, 0x5c, 0x6f, + 0x77, 0x60, 0x29, 0xa2, 0x2e, 0x0b, 0x19, 0xe5, 0xca, 0xbe, 0x92, 0x73, 0x12, 0x98, 0x66, 0xde, + 0x06, 0x9c, 0xc7, 0x81, 0xe8, 0x70, 0x75, 0x32, 0xca, 0xf5, 0xdb, 0xa6, 0xea, 0x28, 0xe6, 0xa8, + 0xa3, 0x98, 0x69, 0x47, 0x31, 0x6d, 0xc1, 0x78, 0xa3, 0x78, 0x30, 0x30, 0x0a, 0x4e, 0x3a, 0x7d, + 0x73, 0xe9, 0x49, 0xdf, 0x00, 0xdf, 0xf5, 0x0d, 0xf0, 0x77, 0xdf, 0x28, 0xa0, 0x6f, 0xae, 0x64, + 0x45, 0x72, 0xb6, 0xb8, 0x8f, 0x44, 0x64, 0x3f, 0xdc, 0xd6, 0xee, 0x4e, 0x48, 0x6c, 0xdc, 0x18, + 0x0e, 0x8c, 0xa5, 0x1e, 0x0e, 0xfc, 0x4d, 0x24, 0xc3, 0x28, 0x13, 0xfd, 0xc1, 0x33, 0x44, 0x37, + 0x5e, 0x1d, 0x0e, 0x0c, 0x4d, 0xcd, 0xce, 0x81, 0x68, 0xd2, 0x8c, 0xfa, 0x29, 0x33, 0x1a, 0x2b, + 0xc3, 0x81, 0x71, 0x43, 0xad, 0x1b, 0x43, 0x28, 0x6f, 0x91, 0xf9, 0xb4, 0x45, 0x8d, 0x9b, 0xc3, + 0x81, 0x71, 0x5d, 0x2d, 0xc9, 0x10, 0x74, 0xe2, 0xdb, 0x7b, 0x10, 0xaa, 0x28, 0xc7, 0x01, 0x55, + 0x75, 0xd6, 0xb8, 0x35, 0x1c, 0x18, 0xcb, 0xf9, 0x15, 0x23, 0x0c, 0x39, 0x25, 0x39, 0xf8, 0x0c, + 0x07, 0x54, 0x7b, 0x6b, 0xec, 0xb6, 0x2c, 0xb0, 0xc6, 0xf2, 0x70, 0x60, 0x5c, 0x53, 0x2b, 0x54, + 0x1c, 0x65, 0xfe, 0x6a, 0xf7, 0x4e, 0x0a, 0x69, 0x41, 0xce, 0xd5, 0x86, 0x03, 0xe3, 0x95, 0x4c, + 0xba, 0x2a, 0xa9, 0x71, 0x71, 0x6d, 0x2e, 0x3e, 0xe9, 0x1b, 0x85, 0x51, 0x36, 0xd0, 0x4f, 0x00, + 0xbe, 0xb1, 0x45, 0x88, 0x3d, 0xda, 0xd3, 0x16, 0xfc, 0x2b, 0xe6, 0x75, 0x22, 0x3c, 0xb2, 0xe5, + 0xc2, 0x35, 0xe6, 0xc0, 0x9b, 0x4a, 0x96, 0x9b, 0xff, 0xac, 0x34, 0xb8, 0x5c, 0x5f, 0x7b, 0xfa, + 0x26, 0x3e, 0xb5, 0xbf, 0xa3, 0xb9, 0xa7, 0x62, 0xe8, 0x10, 0xc0, 0xda, 0x54, 0xb6, 0x2f, 0xe2, + 0x7a, 0x99, 0x01, 0xf1, 0xfc, 0x39, 0x2f, 0x4e, 0x9e, 0xf3, 0x0e, 0xac, 0xaa, 0x6e, 0x39, 0x83, + 0x14, 0x9c, 0xdd, 0x1e, 0xd1, 0xf7, 0x00, 0xbe, 0x73, 0xde, 0xbe, 0x33, 0xee, 0xd0, 0x67, 0x7b, + 0xf2, 0x23, 0x80, 0xe8, 0xf3, 0xd0, 0x8b, 0x30, 0x49, 0xdf, 0x10, 0x3b, 0x91, 0xd8, 0xef, 0x65, + 0x17, 0xf2, 0x2c, 0xdf, 0x3d, 0x6f, 0xc3, 0x65, 0x4e, 0x1f, 0x8f, 0xae, 0xf6, 0xfd, 0xde, 0xb8, + 0x2d, 0x28, 0x76, 0xd7, 0x39, 0x7d, 0x2c, 0x79, 0xa4, 0x0d, 0x01, 0x1d, 0x00, 0xf8, 0xee, 0xf9, + 0x2c, 0x67, 0x6c, 0xe2, 0xbf, 0x20, 0x3c, 0xe5, 0x5d, 0xf3, 0x35, 0xac, 0xd9, 0x98, 0xbb, 0xd4, + 0x7f, 0x86, 0x90, 0x54, 0xe2, 0x2c, 0x8b, 0xf1, 0x07, 0x00, 0xef, 0x3f, 0xef, 0xfe, 0xff, 0x55, + 0x51, 0x36, 0x1e, 0x1e, 0x1c, 0x55, 0xc0, 0xe1, 0x51, 0x05, 0xfc, 0x75, 0x54, 0x01, 0xdf, 0x1e, + 0x57, 0x0a, 0x87, 0xc7, 0x95, 0xc2, 0xef, 0xc7, 0x95, 0xc2, 0x97, 0x75, 0x8f, 0x25, 0xed, 0x4e, + 0xcb, 0x74, 0x45, 0x60, 0x85, 0xd4, 0xf3, 0x7a, 0x8f, 0xba, 0x56, 0x2c, 0x82, 0x80, 0xfa, 0x8c, + 0x46, 0x56, 0x77, 0xc3, 0xda, 0xcf, 0xfd, 0x3f, 0xb3, 0x92, 0x5e, 0x48, 0xe3, 0xd6, 0xbc, 0x7c, + 0x3d, 0xdc, 0xff, 0x27, 0x00, 0x00, 0xff, 0xff, 0x9e, 0xe2, 0x07, 0xeb, 0xf5, 0x0d, 0x00, 0x00, +} + +func (m *AddAxelarManagedCellarIDsProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddAxelarManagedCellarIDsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddAxelarManagedCellarIDsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CellarIds != nil { + { + size, err := m.CellarIds.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposit) > 0 { + i -= len(m.Deposit) + copy(dAtA[i:], m.Deposit) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Deposit))) + i-- + dAtA[i] = 0x2a + } + if m.CellarIds != nil { + { + size, err := m.CellarIds.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemoveAxelarManagedCellarIDsProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveAxelarManagedCellarIDsProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveAxelarManagedCellarIDsProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CellarIds != nil { + { + size, err := m.CellarIds.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposit) > 0 { + i -= len(m.Deposit) + copy(dAtA[i:], m.Deposit) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Deposit))) + i-- + dAtA[i] = 0x2a + } + if m.CellarIds != nil { + { + size, err := m.CellarIds.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AxelarScheduledCorkProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AxelarScheduledCorkProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AxelarScheduledCorkProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Deadline != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.Deadline)) + i-- + dAtA[i] = 0x38 + } + if len(m.ContractCallProtoJson) > 0 { + i -= len(m.ContractCallProtoJson) + copy(dAtA[i:], m.ContractCallProtoJson) + i = encodeVarintProposal(dAtA, i, uint64(len(m.ContractCallProtoJson))) + i-- + dAtA[i] = 0x32 + } + if len(m.TargetContractAddress) > 0 { + i -= len(m.TargetContractAddress) + copy(dAtA[i:], m.TargetContractAddress) + i = encodeVarintProposal(dAtA, i, uint64(len(m.TargetContractAddress))) + i-- + dAtA[i] = 0x2a + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x20 + } + if m.BlockHeight != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AxelarScheduledCorkProposalWithDeposit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AxelarScheduledCorkProposalWithDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AxelarScheduledCorkProposalWithDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposit) > 0 { + i -= len(m.Deposit) + copy(dAtA[i:], m.Deposit) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Deposit))) + i-- + dAtA[i] = 0x42 + } + if m.Deadline != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.Deadline)) + i-- + dAtA[i] = 0x38 + } + if len(m.ContractCallProtoJson) > 0 { + i -= len(m.ContractCallProtoJson) + copy(dAtA[i:], m.ContractCallProtoJson) + i = encodeVarintProposal(dAtA, i, uint64(len(m.ContractCallProtoJson))) + i-- + dAtA[i] = 0x32 + } + if len(m.TargetContractAddress) > 0 { + i -= len(m.TargetContractAddress) + copy(dAtA[i:], m.TargetContractAddress) + i = encodeVarintProposal(dAtA, i, uint64(len(m.TargetContractAddress))) + i-- + dAtA[i] = 0x2a + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x20 + } + if m.BlockHeight != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AxelarCommunityPoolSpendProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AxelarCommunityPoolSpendProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AxelarCommunityPoolSpendProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x20 + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AxelarCommunityPoolSpendProposalForCLI) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AxelarCommunityPoolSpendProposalForCLI) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AxelarCommunityPoolSpendProposalForCLI) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposit) > 0 { + i -= len(m.Deposit) + copy(dAtA[i:], m.Deposit) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Deposit))) + i-- + dAtA[i] = 0x3a + } + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x32 + } + if len(m.ChainName) > 0 { + i -= len(m.ChainName) + copy(dAtA[i:], m.ChainName) + i = encodeVarintProposal(dAtA, i, uint64(len(m.ChainName))) + i-- + dAtA[i] = 0x2a + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x20 + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddChainConfigurationProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddChainConfigurationProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddChainConfigurationProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainConfiguration != nil { + { + size, err := m.ChainConfiguration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddChainConfigurationProposalWithDeposit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AddChainConfigurationProposalWithDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddChainConfigurationProposalWithDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposit) > 0 { + i -= len(m.Deposit) + copy(dAtA[i:], m.Deposit) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Deposit))) + i-- + dAtA[i] = 0x22 + } + if m.ChainConfiguration != nil { + { + size, err := m.ChainConfiguration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposal(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemoveChainConfigurationProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveChainConfigurationProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveChainConfigurationProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemoveChainConfigurationProposalWithDeposit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveChainConfigurationProposalWithDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveChainConfigurationProposalWithDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposit) > 0 { + i -= len(m.Deposit) + copy(dAtA[i:], m.Deposit) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Deposit))) + i-- + dAtA[i] = 0x22 + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpgradeAxelarProxyContractProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpgradeAxelarProxyContractProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpgradeAxelarProxyContractProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NewProxyAddress) > 0 { + i -= len(m.NewProxyAddress) + copy(dAtA[i:], m.NewProxyAddress) + i = encodeVarintProposal(dAtA, i, uint64(len(m.NewProxyAddress))) + i-- + dAtA[i] = 0x22 + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposit) > 0 { + i -= len(m.Deposit) + copy(dAtA[i:], m.Deposit) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Deposit))) + i-- + dAtA[i] = 0x2a + } + if len(m.NewProxyAddress) > 0 { + i -= len(m.NewProxyAddress) + copy(dAtA[i:], m.NewProxyAddress) + i = encodeVarintProposal(dAtA, i, uint64(len(m.NewProxyAddress))) + i-- + dAtA[i] = 0x22 + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CancelAxelarProxyContractUpgradeProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CancelAxelarProxyContractUpgradeProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CancelAxelarProxyContractUpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposit) > 0 { + i -= len(m.Deposit) + copy(dAtA[i:], m.Deposit) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Deposit))) + i-- + dAtA[i] = 0x22 + } + if m.ChainId != 0 { + i = encodeVarintProposal(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x18 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { + offset -= sovProposal(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AddAxelarManagedCellarIDsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + if m.CellarIds != nil { + l = m.CellarIds.Size() + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + if m.CellarIds != nil { + l = m.CellarIds.Size() + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Deposit) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *RemoveAxelarManagedCellarIDsProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + if m.CellarIds != nil { + l = m.CellarIds.Size() + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + if m.CellarIds != nil { + l = m.CellarIds.Size() + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Deposit) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *AxelarScheduledCorkProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.BlockHeight != 0 { + n += 1 + sovProposal(uint64(m.BlockHeight)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + l = len(m.TargetContractAddress) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.ContractCallProtoJson) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.Deadline != 0 { + n += 1 + sovProposal(uint64(m.Deadline)) + } + return n +} + +func (m *AxelarScheduledCorkProposalWithDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.BlockHeight != 0 { + n += 1 + sovProposal(uint64(m.BlockHeight)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + l = len(m.TargetContractAddress) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.ContractCallProtoJson) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.Deadline != 0 { + n += 1 + sovProposal(uint64(m.Deadline)) + } + l = len(m.Deposit) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *AxelarCommunityPoolSpendProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + l = m.Amount.Size() + n += 1 + l + sovProposal(uint64(l)) + return n +} + +func (m *AxelarCommunityPoolSpendProposalForCLI) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + l = len(m.ChainName) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Deposit) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *AddChainConfigurationProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainConfiguration != nil { + l = m.ChainConfiguration.Size() + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *AddChainConfigurationProposalWithDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainConfiguration != nil { + l = m.ChainConfiguration.Size() + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Deposit) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *RemoveChainConfigurationProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + return n +} + +func (m *RemoveChainConfigurationProposalWithDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + l = len(m.Deposit) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *UpgradeAxelarProxyContractProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + l = len(m.NewProxyAddress) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *UpgradeAxelarProxyContractProposalWithDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + l = len(m.NewProxyAddress) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Deposit) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func (m *CancelAxelarProxyContractUpgradeProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + return n +} + +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovProposal(uint64(m.ChainId)) + } + l = len(m.Deposit) + if l > 0 { + n += 1 + l + sovProposal(uint64(l)) + } + return n +} + +func sovProposal(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozProposal(x uint64) (n int) { + return sovProposal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AddAxelarManagedCellarIDsProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddAxelarManagedCellarIDsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddAxelarManagedCellarIDsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CellarIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CellarIds == nil { + m.CellarIds = &CellarIDSet{} + } + if err := m.CellarIds.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddAxelarManagedCellarIDsProposalWithDeposit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddAxelarManagedCellarIDsProposalWithDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddAxelarManagedCellarIDsProposalWithDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CellarIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CellarIds == nil { + m.CellarIds = &CellarIDSet{} + } + if err := m.CellarIds.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveAxelarManagedCellarIDsProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoveAxelarManagedCellarIDsProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveAxelarManagedCellarIDsProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CellarIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CellarIds == nil { + m.CellarIds = &CellarIDSet{} + } + if err := m.CellarIds.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveAxelarManagedCellarIDsProposalWithDeposit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoveAxelarManagedCellarIDsProposalWithDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveAxelarManagedCellarIDsProposalWithDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CellarIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CellarIds == nil { + m.CellarIds = &CellarIDSet{} + } + if err := m.CellarIds.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AxelarScheduledCorkProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AxelarScheduledCorkProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AxelarScheduledCorkProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractCallProtoJson", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractCallProtoJson = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Deadline", wireType) + } + m.Deadline = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Deadline |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AxelarScheduledCorkProposalWithDeposit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AxelarScheduledCorkProposalWithDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AxelarScheduledCorkProposalWithDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractCallProtoJson", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractCallProtoJson = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Deadline", wireType) + } + m.Deadline = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Deadline |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AxelarCommunityPoolSpendProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AxelarCommunityPoolSpendProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AxelarCommunityPoolSpendProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AxelarCommunityPoolSpendProposalForCLI) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AxelarCommunityPoolSpendProposalForCLI: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AxelarCommunityPoolSpendProposalForCLI: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddChainConfigurationProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddChainConfigurationProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddChainConfigurationProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainConfiguration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ChainConfiguration == nil { + m.ChainConfiguration = &ChainConfiguration{} + } + if err := m.ChainConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddChainConfigurationProposalWithDeposit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AddChainConfigurationProposalWithDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddChainConfigurationProposalWithDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainConfiguration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ChainConfiguration == nil { + m.ChainConfiguration = &ChainConfiguration{} + } + if err := m.ChainConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveChainConfigurationProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoveChainConfigurationProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveChainConfigurationProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveChainConfigurationProposalWithDeposit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoveChainConfigurationProposalWithDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveChainConfigurationProposalWithDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpgradeAxelarProxyContractProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpgradeAxelarProxyContractProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpgradeAxelarProxyContractProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewProxyAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewProxyAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpgradeAxelarProxyContractProposalWithDeposit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpgradeAxelarProxyContractProposalWithDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpgradeAxelarProxyContractProposalWithDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewProxyAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewProxyAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CancelAxelarProxyContractUpgradeProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CancelAxelarProxyContractUpgradeProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CancelAxelarProxyContractUpgradeProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CancelAxelarProxyContractUpgradeProposalWithDeposit) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CancelAxelarProxyContractUpgradeProposalWithDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CancelAxelarProxyContractUpgradeProposalWithDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposal + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposal + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposal(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposal + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipProposal(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProposal + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProposal + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProposal + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthProposal + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupProposal + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthProposal + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthProposal = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowProposal = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupProposal = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/axelarcork/types/proposal_test.go b/x/axelarcork/types/proposal_test.go new file mode 100644 index 00000000..c55a00f2 --- /dev/null +++ b/x/axelarcork/types/proposal_test.go @@ -0,0 +1,77 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" +) + +func TestScheduledCorkProposalValidation(t *testing.T) { + testCases := []struct { + name string + scheduledCorkProposal AxelarScheduledCorkProposal + expPass bool + err error + }{ + { + name: "Happy path", + scheduledCorkProposal: AxelarScheduledCorkProposal{ + Title: "Scheduled AxelarCork", + Description: "Schedules a cork via governance", + BlockHeight: 1, + ContractCallProtoJson: "{\"thing\":1}", + TargetContractAddress: "0x0000000000000000000000000000000000000000", + }, + expPass: true, + err: nil, + }, + { + name: "Contract address invalid", + scheduledCorkProposal: AxelarScheduledCorkProposal{ + Title: "Scheduled AxelarCork", + Description: "Schedules a cork via governance", + BlockHeight: 1, + ContractCallProtoJson: "{\"thing\":1}", + TargetContractAddress: "0x01", + }, + expPass: false, + err: sdkerrors.Wrapf(ErrInvalidEVMAddress, "0x01"), + }, + { + name: "Empty proto JSON", + scheduledCorkProposal: AxelarScheduledCorkProposal{ + Title: "Scheduled AxelarCork", + Description: "Schedules a cork via governance", + BlockHeight: 1, + ContractCallProtoJson: "", + TargetContractAddress: "0x0000000000000000000000000000000000000000", + }, + expPass: false, + err: sdkerrors.Wrap(ErrInvalidJSON, "cannot have empty contract call"), + }, + { + name: "Invalid JSON", + scheduledCorkProposal: AxelarScheduledCorkProposal{ + Title: "Scheduled AxelarCork", + Description: "Schedules a cork via governance", + BlockHeight: 1, + ContractCallProtoJson: "[}", + TargetContractAddress: "0x0000000000000000000000000000000000000000", + }, + expPass: false, + err: sdkerrors.Wrapf(ErrInvalidJSON, "[}"), + }, + } + + for _, tc := range testCases { + err := tc.scheduledCorkProposal.ValidateBasic() + if tc.expPass { + require.NoError(t, err, tc.name) + require.Nil(t, err) + } else { + require.Error(t, err, tc.name) + require.Equal(t, tc.err.Error(), err.Error()) + } + } +} diff --git a/x/axelarcork/types/query.pb.go b/x/axelarcork/types/query.pb.go new file mode 100644 index 00000000..2f6dcc11 --- /dev/null +++ b/x/axelarcork/types/query.pb.go @@ -0,0 +1,4731 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: axelarcork/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is the request type for the Query/Params gRPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsRequest is the response type for the Query/Params gRPC method. +type QueryParamsResponse struct { + // allocation parameters + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// QueryCellarIDs is the request type for Query/QueryCellarIDs gRPC method. +type QueryCellarIDsRequest struct { +} + +func (m *QueryCellarIDsRequest) Reset() { *m = QueryCellarIDsRequest{} } +func (m *QueryCellarIDsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCellarIDsRequest) ProtoMessage() {} +func (*QueryCellarIDsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{2} +} +func (m *QueryCellarIDsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCellarIDsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCellarIDsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCellarIDsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCellarIDsRequest.Merge(m, src) +} +func (m *QueryCellarIDsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCellarIDsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCellarIDsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCellarIDsRequest proto.InternalMessageInfo + +// QueryCellarIDsResponse is the response type for Query/QueryCellarIDs gRPC method. +type QueryCellarIDsResponse struct { + CellarIds []*CellarIDSet `protobuf:"bytes,1,rep,name=cellar_ids,json=cellarIds,proto3" json:"cellar_ids,omitempty"` +} + +func (m *QueryCellarIDsResponse) Reset() { *m = QueryCellarIDsResponse{} } +func (m *QueryCellarIDsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCellarIDsResponse) ProtoMessage() {} +func (*QueryCellarIDsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{3} +} +func (m *QueryCellarIDsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCellarIDsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCellarIDsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCellarIDsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCellarIDsResponse.Merge(m, src) +} +func (m *QueryCellarIDsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCellarIDsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCellarIDsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCellarIDsResponse proto.InternalMessageInfo + +func (m *QueryCellarIDsResponse) GetCellarIds() []*CellarIDSet { + if m != nil { + return m.CellarIds + } + return nil +} + +// QueryCellarIDsByChainIDRequest is the request type for Query/QueryCellarIDsByChainID gRPC method. +type QueryCellarIDsByChainIDRequest struct { + ChainId uint64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryCellarIDsByChainIDRequest) Reset() { *m = QueryCellarIDsByChainIDRequest{} } +func (m *QueryCellarIDsByChainIDRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCellarIDsByChainIDRequest) ProtoMessage() {} +func (*QueryCellarIDsByChainIDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{4} +} +func (m *QueryCellarIDsByChainIDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCellarIDsByChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCellarIDsByChainIDRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCellarIDsByChainIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCellarIDsByChainIDRequest.Merge(m, src) +} +func (m *QueryCellarIDsByChainIDRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCellarIDsByChainIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCellarIDsByChainIDRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCellarIDsByChainIDRequest proto.InternalMessageInfo + +func (m *QueryCellarIDsByChainIDRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +// QueryCellarIDsByChainIDResponse is the response type for Query/QueryCellarIDsByChainID gRPC method. +type QueryCellarIDsByChainIDResponse struct { + CellarIds []string `protobuf:"bytes,1,rep,name=cellar_ids,json=cellarIds,proto3" json:"cellar_ids,omitempty"` +} + +func (m *QueryCellarIDsByChainIDResponse) Reset() { *m = QueryCellarIDsByChainIDResponse{} } +func (m *QueryCellarIDsByChainIDResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCellarIDsByChainIDResponse) ProtoMessage() {} +func (*QueryCellarIDsByChainIDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{5} +} +func (m *QueryCellarIDsByChainIDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCellarIDsByChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCellarIDsByChainIDResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCellarIDsByChainIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCellarIDsByChainIDResponse.Merge(m, src) +} +func (m *QueryCellarIDsByChainIDResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCellarIDsByChainIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCellarIDsByChainIDResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCellarIDsByChainIDResponse proto.InternalMessageInfo + +func (m *QueryCellarIDsByChainIDResponse) GetCellarIds() []string { + if m != nil { + return m.CellarIds + } + return nil +} + +// QueryScheduledCorksRequest +type QueryScheduledCorksRequest struct { + ChainId uint64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryScheduledCorksRequest) Reset() { *m = QueryScheduledCorksRequest{} } +func (m *QueryScheduledCorksRequest) String() string { return proto.CompactTextString(m) } +func (*QueryScheduledCorksRequest) ProtoMessage() {} +func (*QueryScheduledCorksRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{6} +} +func (m *QueryScheduledCorksRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryScheduledCorksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryScheduledCorksRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryScheduledCorksRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryScheduledCorksRequest.Merge(m, src) +} +func (m *QueryScheduledCorksRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryScheduledCorksRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryScheduledCorksRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryScheduledCorksRequest proto.InternalMessageInfo + +func (m *QueryScheduledCorksRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +// QueryScheduledCorksResponse +type QueryScheduledCorksResponse struct { + Corks []*ScheduledAxelarCork `protobuf:"bytes,1,rep,name=corks,proto3" json:"corks,omitempty"` +} + +func (m *QueryScheduledCorksResponse) Reset() { *m = QueryScheduledCorksResponse{} } +func (m *QueryScheduledCorksResponse) String() string { return proto.CompactTextString(m) } +func (*QueryScheduledCorksResponse) ProtoMessage() {} +func (*QueryScheduledCorksResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{7} +} +func (m *QueryScheduledCorksResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryScheduledCorksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryScheduledCorksResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryScheduledCorksResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryScheduledCorksResponse.Merge(m, src) +} +func (m *QueryScheduledCorksResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryScheduledCorksResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryScheduledCorksResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryScheduledCorksResponse proto.InternalMessageInfo + +func (m *QueryScheduledCorksResponse) GetCorks() []*ScheduledAxelarCork { + if m != nil { + return m.Corks + } + return nil +} + +// QueryScheduledBlockHeightsRequest +type QueryScheduledBlockHeightsRequest struct { + ChainId uint64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryScheduledBlockHeightsRequest) Reset() { *m = QueryScheduledBlockHeightsRequest{} } +func (m *QueryScheduledBlockHeightsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryScheduledBlockHeightsRequest) ProtoMessage() {} +func (*QueryScheduledBlockHeightsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{8} +} +func (m *QueryScheduledBlockHeightsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryScheduledBlockHeightsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryScheduledBlockHeightsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryScheduledBlockHeightsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryScheduledBlockHeightsRequest.Merge(m, src) +} +func (m *QueryScheduledBlockHeightsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryScheduledBlockHeightsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryScheduledBlockHeightsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryScheduledBlockHeightsRequest proto.InternalMessageInfo + +func (m *QueryScheduledBlockHeightsRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +// QueryScheduledBlockHeightsResponse +type QueryScheduledBlockHeightsResponse struct { + BlockHeights []uint64 `protobuf:"varint,1,rep,packed,name=block_heights,json=blockHeights,proto3" json:"block_heights,omitempty"` +} + +func (m *QueryScheduledBlockHeightsResponse) Reset() { *m = QueryScheduledBlockHeightsResponse{} } +func (m *QueryScheduledBlockHeightsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryScheduledBlockHeightsResponse) ProtoMessage() {} +func (*QueryScheduledBlockHeightsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{9} +} +func (m *QueryScheduledBlockHeightsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryScheduledBlockHeightsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryScheduledBlockHeightsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryScheduledBlockHeightsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryScheduledBlockHeightsResponse.Merge(m, src) +} +func (m *QueryScheduledBlockHeightsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryScheduledBlockHeightsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryScheduledBlockHeightsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryScheduledBlockHeightsResponse proto.InternalMessageInfo + +func (m *QueryScheduledBlockHeightsResponse) GetBlockHeights() []uint64 { + if m != nil { + return m.BlockHeights + } + return nil +} + +// QueryScheduledCorksByBlockHeightRequest +type QueryScheduledCorksByBlockHeightRequest struct { + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryScheduledCorksByBlockHeightRequest) Reset() { + *m = QueryScheduledCorksByBlockHeightRequest{} +} +func (m *QueryScheduledCorksByBlockHeightRequest) String() string { return proto.CompactTextString(m) } +func (*QueryScheduledCorksByBlockHeightRequest) ProtoMessage() {} +func (*QueryScheduledCorksByBlockHeightRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{10} +} +func (m *QueryScheduledCorksByBlockHeightRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryScheduledCorksByBlockHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryScheduledCorksByBlockHeightRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryScheduledCorksByBlockHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryScheduledCorksByBlockHeightRequest.Merge(m, src) +} +func (m *QueryScheduledCorksByBlockHeightRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryScheduledCorksByBlockHeightRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryScheduledCorksByBlockHeightRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryScheduledCorksByBlockHeightRequest proto.InternalMessageInfo + +func (m *QueryScheduledCorksByBlockHeightRequest) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *QueryScheduledCorksByBlockHeightRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +// QueryScheduledCorksByBlockHeightResponse +type QueryScheduledCorksByBlockHeightResponse struct { + Corks []*ScheduledAxelarCork `protobuf:"bytes,1,rep,name=corks,proto3" json:"corks,omitempty"` +} + +func (m *QueryScheduledCorksByBlockHeightResponse) Reset() { + *m = QueryScheduledCorksByBlockHeightResponse{} +} +func (m *QueryScheduledCorksByBlockHeightResponse) String() string { return proto.CompactTextString(m) } +func (*QueryScheduledCorksByBlockHeightResponse) ProtoMessage() {} +func (*QueryScheduledCorksByBlockHeightResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{11} +} +func (m *QueryScheduledCorksByBlockHeightResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryScheduledCorksByBlockHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryScheduledCorksByBlockHeightResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryScheduledCorksByBlockHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryScheduledCorksByBlockHeightResponse.Merge(m, src) +} +func (m *QueryScheduledCorksByBlockHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryScheduledCorksByBlockHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryScheduledCorksByBlockHeightResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryScheduledCorksByBlockHeightResponse proto.InternalMessageInfo + +func (m *QueryScheduledCorksByBlockHeightResponse) GetCorks() []*ScheduledAxelarCork { + if m != nil { + return m.Corks + } + return nil +} + +// QueryScheduledCorksByIDRequest +type QueryScheduledCorksByIDRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryScheduledCorksByIDRequest) Reset() { *m = QueryScheduledCorksByIDRequest{} } +func (m *QueryScheduledCorksByIDRequest) String() string { return proto.CompactTextString(m) } +func (*QueryScheduledCorksByIDRequest) ProtoMessage() {} +func (*QueryScheduledCorksByIDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{12} +} +func (m *QueryScheduledCorksByIDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryScheduledCorksByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryScheduledCorksByIDRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryScheduledCorksByIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryScheduledCorksByIDRequest.Merge(m, src) +} +func (m *QueryScheduledCorksByIDRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryScheduledCorksByIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryScheduledCorksByIDRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryScheduledCorksByIDRequest proto.InternalMessageInfo + +func (m *QueryScheduledCorksByIDRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *QueryScheduledCorksByIDRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +// QueryScheduledCorksByIDResponse +type QueryScheduledCorksByIDResponse struct { + Corks []*ScheduledAxelarCork `protobuf:"bytes,1,rep,name=corks,proto3" json:"corks,omitempty"` +} + +func (m *QueryScheduledCorksByIDResponse) Reset() { *m = QueryScheduledCorksByIDResponse{} } +func (m *QueryScheduledCorksByIDResponse) String() string { return proto.CompactTextString(m) } +func (*QueryScheduledCorksByIDResponse) ProtoMessage() {} +func (*QueryScheduledCorksByIDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{13} +} +func (m *QueryScheduledCorksByIDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryScheduledCorksByIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryScheduledCorksByIDResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryScheduledCorksByIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryScheduledCorksByIDResponse.Merge(m, src) +} +func (m *QueryScheduledCorksByIDResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryScheduledCorksByIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryScheduledCorksByIDResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryScheduledCorksByIDResponse proto.InternalMessageInfo + +func (m *QueryScheduledCorksByIDResponse) GetCorks() []*ScheduledAxelarCork { + if m != nil { + return m.Corks + } + return nil +} + +type QueryCorkResultRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryCorkResultRequest) Reset() { *m = QueryCorkResultRequest{} } +func (m *QueryCorkResultRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCorkResultRequest) ProtoMessage() {} +func (*QueryCorkResultRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{14} +} +func (m *QueryCorkResultRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCorkResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCorkResultRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCorkResultRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCorkResultRequest.Merge(m, src) +} +func (m *QueryCorkResultRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCorkResultRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCorkResultRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCorkResultRequest proto.InternalMessageInfo + +func (m *QueryCorkResultRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *QueryCorkResultRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +type QueryCorkResultResponse struct { + CorkResult *AxelarCorkResult `protobuf:"bytes,1,opt,name=corkResult,proto3" json:"corkResult,omitempty"` +} + +func (m *QueryCorkResultResponse) Reset() { *m = QueryCorkResultResponse{} } +func (m *QueryCorkResultResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCorkResultResponse) ProtoMessage() {} +func (*QueryCorkResultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{15} +} +func (m *QueryCorkResultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCorkResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCorkResultResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCorkResultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCorkResultResponse.Merge(m, src) +} +func (m *QueryCorkResultResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCorkResultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCorkResultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCorkResultResponse proto.InternalMessageInfo + +func (m *QueryCorkResultResponse) GetCorkResult() *AxelarCorkResult { + if m != nil { + return m.CorkResult + } + return nil +} + +type QueryCorkResultsRequest struct { + ChainId uint64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryCorkResultsRequest) Reset() { *m = QueryCorkResultsRequest{} } +func (m *QueryCorkResultsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCorkResultsRequest) ProtoMessage() {} +func (*QueryCorkResultsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{16} +} +func (m *QueryCorkResultsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCorkResultsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCorkResultsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCorkResultsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCorkResultsRequest.Merge(m, src) +} +func (m *QueryCorkResultsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCorkResultsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCorkResultsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCorkResultsRequest proto.InternalMessageInfo + +func (m *QueryCorkResultsRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +type QueryCorkResultsResponse struct { + CorkResults []*AxelarCorkResult `protobuf:"bytes,1,rep,name=corkResults,proto3" json:"corkResults,omitempty"` +} + +func (m *QueryCorkResultsResponse) Reset() { *m = QueryCorkResultsResponse{} } +func (m *QueryCorkResultsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCorkResultsResponse) ProtoMessage() {} +func (*QueryCorkResultsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{17} +} +func (m *QueryCorkResultsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCorkResultsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCorkResultsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCorkResultsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCorkResultsResponse.Merge(m, src) +} +func (m *QueryCorkResultsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCorkResultsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCorkResultsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCorkResultsResponse proto.InternalMessageInfo + +func (m *QueryCorkResultsResponse) GetCorkResults() []*AxelarCorkResult { + if m != nil { + return m.CorkResults + } + return nil +} + +type QueryChainConfigurationsRequest struct { +} + +func (m *QueryChainConfigurationsRequest) Reset() { *m = QueryChainConfigurationsRequest{} } +func (m *QueryChainConfigurationsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryChainConfigurationsRequest) ProtoMessage() {} +func (*QueryChainConfigurationsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{18} +} +func (m *QueryChainConfigurationsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChainConfigurationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChainConfigurationsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryChainConfigurationsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChainConfigurationsRequest.Merge(m, src) +} +func (m *QueryChainConfigurationsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryChainConfigurationsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChainConfigurationsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChainConfigurationsRequest proto.InternalMessageInfo + +type QueryChainConfigurationsResponse struct { + Configurations []*ChainConfiguration `protobuf:"bytes,1,rep,name=configurations,proto3" json:"configurations,omitempty"` +} + +func (m *QueryChainConfigurationsResponse) Reset() { *m = QueryChainConfigurationsResponse{} } +func (m *QueryChainConfigurationsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryChainConfigurationsResponse) ProtoMessage() {} +func (*QueryChainConfigurationsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{19} +} +func (m *QueryChainConfigurationsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChainConfigurationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChainConfigurationsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryChainConfigurationsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChainConfigurationsResponse.Merge(m, src) +} +func (m *QueryChainConfigurationsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryChainConfigurationsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChainConfigurationsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChainConfigurationsResponse proto.InternalMessageInfo + +func (m *QueryChainConfigurationsResponse) GetConfigurations() []*ChainConfiguration { + if m != nil { + return m.Configurations + } + return nil +} + +type QueryAxelarContractCallNoncesRequest struct { +} + +func (m *QueryAxelarContractCallNoncesRequest) Reset() { *m = QueryAxelarContractCallNoncesRequest{} } +func (m *QueryAxelarContractCallNoncesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAxelarContractCallNoncesRequest) ProtoMessage() {} +func (*QueryAxelarContractCallNoncesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{20} +} +func (m *QueryAxelarContractCallNoncesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAxelarContractCallNoncesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAxelarContractCallNoncesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAxelarContractCallNoncesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAxelarContractCallNoncesRequest.Merge(m, src) +} +func (m *QueryAxelarContractCallNoncesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAxelarContractCallNoncesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAxelarContractCallNoncesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAxelarContractCallNoncesRequest proto.InternalMessageInfo + +type QueryAxelarContractCallNoncesResponse struct { + ContractCallNonces []*AxelarContractCallNonce `protobuf:"bytes,1,rep,name=contract_call_nonces,json=contractCallNonces,proto3" json:"contract_call_nonces,omitempty"` +} + +func (m *QueryAxelarContractCallNoncesResponse) Reset() { *m = QueryAxelarContractCallNoncesResponse{} } +func (m *QueryAxelarContractCallNoncesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAxelarContractCallNoncesResponse) ProtoMessage() {} +func (*QueryAxelarContractCallNoncesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{21} +} +func (m *QueryAxelarContractCallNoncesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAxelarContractCallNoncesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAxelarContractCallNoncesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAxelarContractCallNoncesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAxelarContractCallNoncesResponse.Merge(m, src) +} +func (m *QueryAxelarContractCallNoncesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAxelarContractCallNoncesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAxelarContractCallNoncesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAxelarContractCallNoncesResponse proto.InternalMessageInfo + +func (m *QueryAxelarContractCallNoncesResponse) GetContractCallNonces() []*AxelarContractCallNonce { + if m != nil { + return m.ContractCallNonces + } + return nil +} + +type QueryAxelarProxyUpgradeDataRequest struct { +} + +func (m *QueryAxelarProxyUpgradeDataRequest) Reset() { *m = QueryAxelarProxyUpgradeDataRequest{} } +func (m *QueryAxelarProxyUpgradeDataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAxelarProxyUpgradeDataRequest) ProtoMessage() {} +func (*QueryAxelarProxyUpgradeDataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{22} +} +func (m *QueryAxelarProxyUpgradeDataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAxelarProxyUpgradeDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAxelarProxyUpgradeDataRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAxelarProxyUpgradeDataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAxelarProxyUpgradeDataRequest.Merge(m, src) +} +func (m *QueryAxelarProxyUpgradeDataRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAxelarProxyUpgradeDataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAxelarProxyUpgradeDataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAxelarProxyUpgradeDataRequest proto.InternalMessageInfo + +type QueryAxelarProxyUpgradeDataResponse struct { + ProxyUpgradeData []*AxelarUpgradeData `protobuf:"bytes,1,rep,name=proxy_upgrade_data,json=proxyUpgradeData,proto3" json:"proxy_upgrade_data,omitempty"` +} + +func (m *QueryAxelarProxyUpgradeDataResponse) Reset() { *m = QueryAxelarProxyUpgradeDataResponse{} } +func (m *QueryAxelarProxyUpgradeDataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAxelarProxyUpgradeDataResponse) ProtoMessage() {} +func (*QueryAxelarProxyUpgradeDataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7d10e4f1065c484f, []int{23} +} +func (m *QueryAxelarProxyUpgradeDataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAxelarProxyUpgradeDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAxelarProxyUpgradeDataResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAxelarProxyUpgradeDataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAxelarProxyUpgradeDataResponse.Merge(m, src) +} +func (m *QueryAxelarProxyUpgradeDataResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAxelarProxyUpgradeDataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAxelarProxyUpgradeDataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAxelarProxyUpgradeDataResponse proto.InternalMessageInfo + +func (m *QueryAxelarProxyUpgradeDataResponse) GetProxyUpgradeData() []*AxelarUpgradeData { + if m != nil { + return m.ProxyUpgradeData + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "axelarcork.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "axelarcork.v1.QueryParamsResponse") + proto.RegisterType((*QueryCellarIDsRequest)(nil), "axelarcork.v1.QueryCellarIDsRequest") + proto.RegisterType((*QueryCellarIDsResponse)(nil), "axelarcork.v1.QueryCellarIDsResponse") + proto.RegisterType((*QueryCellarIDsByChainIDRequest)(nil), "axelarcork.v1.QueryCellarIDsByChainIDRequest") + proto.RegisterType((*QueryCellarIDsByChainIDResponse)(nil), "axelarcork.v1.QueryCellarIDsByChainIDResponse") + proto.RegisterType((*QueryScheduledCorksRequest)(nil), "axelarcork.v1.QueryScheduledCorksRequest") + proto.RegisterType((*QueryScheduledCorksResponse)(nil), "axelarcork.v1.QueryScheduledCorksResponse") + proto.RegisterType((*QueryScheduledBlockHeightsRequest)(nil), "axelarcork.v1.QueryScheduledBlockHeightsRequest") + proto.RegisterType((*QueryScheduledBlockHeightsResponse)(nil), "axelarcork.v1.QueryScheduledBlockHeightsResponse") + proto.RegisterType((*QueryScheduledCorksByBlockHeightRequest)(nil), "axelarcork.v1.QueryScheduledCorksByBlockHeightRequest") + proto.RegisterType((*QueryScheduledCorksByBlockHeightResponse)(nil), "axelarcork.v1.QueryScheduledCorksByBlockHeightResponse") + proto.RegisterType((*QueryScheduledCorksByIDRequest)(nil), "axelarcork.v1.QueryScheduledCorksByIDRequest") + proto.RegisterType((*QueryScheduledCorksByIDResponse)(nil), "axelarcork.v1.QueryScheduledCorksByIDResponse") + proto.RegisterType((*QueryCorkResultRequest)(nil), "axelarcork.v1.QueryCorkResultRequest") + proto.RegisterType((*QueryCorkResultResponse)(nil), "axelarcork.v1.QueryCorkResultResponse") + proto.RegisterType((*QueryCorkResultsRequest)(nil), "axelarcork.v1.QueryCorkResultsRequest") + proto.RegisterType((*QueryCorkResultsResponse)(nil), "axelarcork.v1.QueryCorkResultsResponse") + proto.RegisterType((*QueryChainConfigurationsRequest)(nil), "axelarcork.v1.QueryChainConfigurationsRequest") + proto.RegisterType((*QueryChainConfigurationsResponse)(nil), "axelarcork.v1.QueryChainConfigurationsResponse") + proto.RegisterType((*QueryAxelarContractCallNoncesRequest)(nil), "axelarcork.v1.QueryAxelarContractCallNoncesRequest") + proto.RegisterType((*QueryAxelarContractCallNoncesResponse)(nil), "axelarcork.v1.QueryAxelarContractCallNoncesResponse") + proto.RegisterType((*QueryAxelarProxyUpgradeDataRequest)(nil), "axelarcork.v1.QueryAxelarProxyUpgradeDataRequest") + proto.RegisterType((*QueryAxelarProxyUpgradeDataResponse)(nil), "axelarcork.v1.QueryAxelarProxyUpgradeDataResponse") +} + +func init() { proto.RegisterFile("axelarcork/v1/query.proto", fileDescriptor_7d10e4f1065c484f) } + +var fileDescriptor_7d10e4f1065c484f = []byte{ + // 1107 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x97, 0xdf, 0x6f, 0xdb, 0x54, + 0x14, 0xc7, 0xeb, 0xd2, 0x0d, 0x7a, 0xb2, 0x95, 0xea, 0xd0, 0xb1, 0xd5, 0x65, 0x69, 0xe3, 0xfe, + 0xa4, 0xa3, 0x71, 0x93, 0x6c, 0x74, 0x68, 0x12, 0xb0, 0xa4, 0x12, 0x04, 0xd0, 0x18, 0xa9, 0x10, + 0x68, 0x08, 0x59, 0x8e, 0x7d, 0x71, 0x4c, 0x1d, 0x3b, 0xb3, 0x9d, 0xd2, 0x68, 0xda, 0x03, 0x3c, + 0xf2, 0x84, 0x80, 0x67, 0xc4, 0xbf, 0x00, 0x12, 0x0f, 0x88, 0x27, 0xde, 0xf6, 0x38, 0x89, 0x17, + 0x9e, 0x10, 0x6a, 0xf7, 0x87, 0x20, 0x5f, 0x5f, 0xa7, 0xfe, 0x99, 0x38, 0xf4, 0xad, 0xbd, 0xe7, + 0x9c, 0xef, 0xf9, 0xdc, 0x9b, 0x9b, 0xf3, 0xbd, 0x81, 0x45, 0xf9, 0x98, 0x18, 0xb2, 0xad, 0x58, + 0xf6, 0xa1, 0x78, 0x54, 0x11, 0x1f, 0xf6, 0x89, 0x3d, 0x28, 0xf7, 0x6c, 0xcb, 0xb5, 0xf0, 0xf2, + 0x59, 0xa8, 0x7c, 0x54, 0xe1, 0x17, 0x34, 0x4b, 0xb3, 0x68, 0x44, 0xf4, 0xfe, 0xf2, 0x93, 0xf8, + 0x57, 0x34, 0xcb, 0xd2, 0x0c, 0x22, 0xca, 0x3d, 0x5d, 0x94, 0x4d, 0xd3, 0x72, 0x65, 0x57, 0xb7, + 0x4c, 0x87, 0x45, 0x97, 0xa2, 0xea, 0x1a, 0x31, 0x89, 0xa3, 0x07, 0xc1, 0x62, 0x34, 0x18, 0xea, + 0x46, 0xe3, 0xc2, 0x02, 0xe0, 0x47, 0x1e, 0xce, 0x7d, 0xd9, 0x96, 0xbb, 0x4e, 0x8b, 0x3c, 0xec, + 0x13, 0xc7, 0x15, 0xde, 0x83, 0x97, 0x22, 0xab, 0x4e, 0xcf, 0x32, 0x1d, 0x82, 0x35, 0xb8, 0xd8, + 0xa3, 0x2b, 0xd7, 0xb8, 0x15, 0x6e, 0xab, 0x50, 0xbd, 0x52, 0x8e, 0xd0, 0x97, 0xfd, 0xf4, 0xfa, + 0xcc, 0x93, 0x7f, 0x96, 0xa7, 0x5a, 0x2c, 0x55, 0xb8, 0x0a, 0x57, 0xa8, 0x56, 0x83, 0x18, 0x86, + 0x6c, 0x37, 0xf7, 0x87, 0x4d, 0x0e, 0xe0, 0xe5, 0x78, 0x80, 0xf5, 0x79, 0x03, 0x40, 0xa1, 0x8b, + 0x92, 0xae, 0x7a, 0xbd, 0x9e, 0xdb, 0x2a, 0x54, 0xf9, 0x58, 0xaf, 0xa0, 0xea, 0x80, 0xb8, 0xad, + 0x59, 0x3f, 0xbb, 0xa9, 0x3a, 0xc2, 0x1d, 0x28, 0x46, 0x45, 0xeb, 0x83, 0x46, 0x47, 0xd6, 0xcd, + 0xe6, 0x3e, 0x6b, 0x8b, 0x8b, 0xf0, 0x82, 0xe2, 0xad, 0x48, 0xba, 0x4a, 0xb7, 0x31, 0xd3, 0x7a, + 0x9e, 0xfe, 0xdf, 0x54, 0x85, 0xb7, 0x61, 0x39, 0xb3, 0x98, 0xa1, 0x5d, 0x4f, 0xa0, 0xcd, 0x86, + 0xdb, 0xef, 0x01, 0x4f, 0x15, 0x0e, 0x94, 0x0e, 0x51, 0xfb, 0x06, 0x51, 0x1b, 0x96, 0x7d, 0xe8, + 0xe4, 0x68, 0xfd, 0x09, 0x2c, 0xa5, 0x16, 0xb2, 0xb6, 0xb7, 0xe1, 0x82, 0xb7, 0xf1, 0xe0, 0x30, + 0x84, 0xd8, 0x61, 0x0c, 0xab, 0xee, 0xd2, 0x65, 0xaf, 0xb6, 0xe5, 0x17, 0x08, 0x6f, 0x42, 0x29, + 0x2a, 0x5c, 0x37, 0x2c, 0xe5, 0xf0, 0x5d, 0xa2, 0x6b, 0x1d, 0x37, 0x0f, 0x58, 0x13, 0x84, 0x51, + 0xf5, 0x8c, 0x6f, 0x15, 0x2e, 0xb7, 0xbd, 0x75, 0xa9, 0xe3, 0x07, 0x28, 0xe7, 0x4c, 0xeb, 0x52, + 0x3b, 0x94, 0x2c, 0x68, 0xb0, 0x99, 0xb2, 0xc7, 0xfa, 0x20, 0xa4, 0x18, 0x00, 0x95, 0xe0, 0x52, + 0x58, 0x8f, 0x41, 0x15, 0x42, 0x72, 0x11, 0xe6, 0xe9, 0x28, 0xb3, 0x0a, 0x5b, 0xe3, 0x1b, 0x9d, + 0xfb, 0x64, 0xdf, 0x67, 0x57, 0x2d, 0xde, 0xe5, 0xec, 0xaa, 0xcd, 0xc1, 0x34, 0x3b, 0xd0, 0xd9, + 0xd6, 0xb4, 0xae, 0x8e, 0x42, 0xfe, 0x8c, 0x5d, 0xbd, 0x34, 0xb1, 0x73, 0x93, 0x36, 0x82, 0x6f, + 0x9a, 0xb7, 0x46, 0x9c, 0xbe, 0xe1, 0xfe, 0x0f, 0xc2, 0x07, 0x70, 0x35, 0x21, 0xc2, 0xc8, 0xde, + 0x02, 0x50, 0x86, 0xab, 0x6c, 0x36, 0x2c, 0xc7, 0xf0, 0x42, 0x54, 0x7e, 0x71, 0xa8, 0x44, 0xb8, + 0x99, 0xd0, 0xce, 0x73, 0x35, 0x3f, 0x87, 0x6b, 0xc9, 0x2a, 0x86, 0x74, 0x17, 0x0a, 0x67, 0xfa, + 0xc1, 0x91, 0x8d, 0x65, 0x0a, 0xd7, 0x08, 0xa5, 0x60, 0x1a, 0x78, 0xed, 0x1a, 0x96, 0xf9, 0x85, + 0xae, 0xf5, 0x6d, 0x7f, 0xf2, 0x06, 0x23, 0xac, 0x0b, 0x2b, 0xd9, 0x29, 0x8c, 0xa4, 0x09, 0x73, + 0x4a, 0x24, 0xc2, 0x60, 0x4a, 0xf1, 0x81, 0x96, 0xd0, 0x68, 0xc5, 0x0a, 0x85, 0x0d, 0x58, 0xa3, + 0xed, 0x02, 0x6e, 0xd3, 0xb5, 0x65, 0xc5, 0x6d, 0xc8, 0x86, 0x71, 0xcf, 0x32, 0x15, 0x32, 0xc4, + 0xfa, 0x9a, 0x83, 0xf5, 0x31, 0x89, 0x0c, 0xee, 0x53, 0x58, 0x50, 0x58, 0x54, 0x52, 0x64, 0xc3, + 0x90, 0x4c, 0x1a, 0x67, 0x88, 0x1b, 0x19, 0xe7, 0x15, 0x93, 0x6b, 0xa1, 0x92, 0xe8, 0x20, 0xac, + 0xb1, 0xb9, 0xe1, 0xd7, 0xdc, 0xb7, 0xad, 0xe3, 0xc1, 0xc7, 0x3d, 0xcd, 0x96, 0x55, 0xb2, 0x2f, + 0xbb, 0x72, 0x40, 0xda, 0x87, 0xd5, 0x91, 0x59, 0x0c, 0xf3, 0x1e, 0x60, 0xcf, 0x8b, 0x49, 0x7d, + 0x3f, 0x28, 0xa9, 0xb2, 0x2b, 0x33, 0xc8, 0x95, 0x54, 0xc8, 0xb0, 0xca, 0x7c, 0x2f, 0xa6, 0x5b, + 0xfd, 0x79, 0x1e, 0x2e, 0xd0, 0xbe, 0xf8, 0x15, 0x14, 0x42, 0x4e, 0x87, 0xf1, 0x0f, 0x25, 0xe9, + 0x8d, 0xbc, 0x30, 0x2a, 0xc5, 0xe7, 0x15, 0x4a, 0xdf, 0xfc, 0xf5, 0xec, 0x87, 0xe9, 0x25, 0x5c, + 0x14, 0x1d, 0xab, 0xdb, 0x25, 0x86, 0x4e, 0x6c, 0x31, 0xb0, 0x60, 0xdf, 0x16, 0xf1, 0x5b, 0x0e, + 0xe6, 0xa2, 0x66, 0x83, 0x6b, 0x69, 0xca, 0x71, 0xdb, 0xe4, 0xd7, 0xc7, 0x64, 0x31, 0x84, 0x1b, + 0x14, 0x61, 0x1d, 0x57, 0x43, 0x08, 0xd1, 0xb7, 0xc0, 0x99, 0x8f, 0xe1, 0x2f, 0x5c, 0xf0, 0x05, + 0x4c, 0x38, 0x1f, 0xee, 0x8c, 0xec, 0x17, 0xb7, 0x57, 0xbe, 0x9c, 0x37, 0x9d, 0x71, 0xee, 0x51, + 0xce, 0x0a, 0x8a, 0x39, 0x38, 0xa5, 0xf6, 0x40, 0x0a, 0x86, 0x01, 0xfe, 0xc4, 0xb1, 0x47, 0x4a, + 0x74, 0x64, 0xe2, 0xab, 0x69, 0x00, 0xa9, 0x7e, 0xcc, 0x6f, 0xe7, 0x49, 0x65, 0x9c, 0xbb, 0x94, + 0x73, 0x1b, 0xb7, 0x32, 0x39, 0x9d, 0xa0, 0x50, 0xa2, 0x53, 0x17, 0xff, 0xe0, 0xe2, 0x8f, 0x81, + 0xb0, 0x75, 0xe2, 0xee, 0xc8, 0xe6, 0x29, 0x2e, 0xcd, 0x57, 0x26, 0xa8, 0x60, 0xd4, 0xb7, 0x29, + 0x75, 0x15, 0x77, 0x73, 0x50, 0x47, 0x0c, 0x1c, 0x9f, 0x71, 0x6c, 0xb6, 0x8d, 0x30, 0x51, 0x7c, + 0x7d, 0xfc, 0x01, 0xa6, 0xd9, 0x3b, 0xbf, 0x37, 0x71, 0x1d, 0xdb, 0xcf, 0x87, 0x74, 0x3f, 0x4d, + 0x7c, 0x27, 0xef, 0xa7, 0xe0, 0x5d, 0x99, 0xf0, 0xc6, 0xc4, 0x47, 0xe1, 0xff, 0x1e, 0xe3, 0x6f, + 0xc1, 0xcd, 0x4f, 0x1a, 0x6f, 0xfa, 0xcd, 0xcf, 0x74, 0xfb, 0xf4, 0x9b, 0x9f, 0xed, 0xe7, 0xc2, + 0x1d, 0xba, 0x97, 0x5b, 0x58, 0x9b, 0x64, 0x2f, 0xba, 0x2a, 0x3e, 0xd2, 0xd5, 0xc7, 0xf8, 0x23, + 0x07, 0x2f, 0xc6, 0xcc, 0x0f, 0xd3, 0x27, 0x43, 0xdc, 0xf3, 0xf9, 0x8d, 0x71, 0x69, 0x8c, 0xaf, + 0x4a, 0xf9, 0x5e, 0xc3, 0xed, 0xec, 0x6f, 0xa6, 0x65, 0x1f, 0x4a, 0xb6, 0x6f, 0x97, 0x3e, 0xd6, + 0xf7, 0x1c, 0xcc, 0xc7, 0x3d, 0x19, 0xc7, 0x34, 0x1c, 0xde, 0xef, 0xcd, 0xb1, 0x79, 0x8c, 0x6c, + 0x87, 0x92, 0x6d, 0xe2, 0x7a, 0x2e, 0x32, 0xfc, 0x95, 0x0b, 0x1e, 0x0a, 0x49, 0x9b, 0xc6, 0xf4, + 0x79, 0x95, 0x69, 0xf9, 0xbc, 0x98, 0x3b, 0x9f, 0xc1, 0xde, 0xa2, 0xb0, 0x22, 0xee, 0x64, 0xc3, + 0xd2, 0x91, 0x16, 0xf5, 0x7a, 0xfc, 0x93, 0x83, 0xeb, 0x23, 0x3d, 0x1c, 0x6b, 0x69, 0x24, 0x63, + 0x9e, 0x06, 0xfc, 0xcd, 0xc9, 0x8a, 0xf2, 0xef, 0x21, 0xe5, 0x15, 0x81, 0xbf, 0x73, 0xec, 0x57, + 0x4d, 0xba, 0xbd, 0x63, 0x25, 0x1b, 0x26, 0xe3, 0xc1, 0xc0, 0x57, 0x27, 0x29, 0x61, 0xf4, 0x35, + 0x4a, 0xbf, 0x83, 0x37, 0x32, 0xe9, 0x93, 0x8f, 0x8b, 0xfa, 0x07, 0x4f, 0x4e, 0x8a, 0xdc, 0xd3, + 0x93, 0x22, 0xf7, 0xef, 0x49, 0x91, 0xfb, 0xee, 0xb4, 0x38, 0xf5, 0xf4, 0xb4, 0x38, 0xf5, 0xf7, + 0x69, 0x71, 0xea, 0x41, 0x55, 0xd3, 0xdd, 0x4e, 0xbf, 0x5d, 0x56, 0xac, 0xae, 0xd8, 0x23, 0x9a, + 0x36, 0xf8, 0xf2, 0x28, 0x24, 0x7c, 0xb4, 0x27, 0x1e, 0x87, 0xd5, 0xdd, 0x41, 0x8f, 0x38, 0xed, + 0x8b, 0xf4, 0xd7, 0x76, 0xed, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb9, 0xf1, 0xab, 0x27, 0x0a, + 0x10, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// 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 { + // QueryParams queries the axelar cork module parameters. + QueryParams(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // QueryCellarIDs queries approved cellar ids of all supported chains + QueryCellarIDs(ctx context.Context, in *QueryCellarIDsRequest, opts ...grpc.CallOption) (*QueryCellarIDsResponse, error) + // QueryCellarIDsByChainID returns all cellars and current tick ranges + QueryCellarIDsByChainID(ctx context.Context, in *QueryCellarIDsByChainIDRequest, opts ...grpc.CallOption) (*QueryCellarIDsByChainIDResponse, error) + // QueryScheduledCorks returns all scheduled corks + QueryScheduledCorks(ctx context.Context, in *QueryScheduledCorksRequest, opts ...grpc.CallOption) (*QueryScheduledCorksResponse, error) + // QueryScheduledBlockHeights returns all scheduled block heights + QueryScheduledBlockHeights(ctx context.Context, in *QueryScheduledBlockHeightsRequest, opts ...grpc.CallOption) (*QueryScheduledBlockHeightsResponse, error) + // QueryScheduledCorks returns all scheduled corks at a block height + QueryScheduledCorksByBlockHeight(ctx context.Context, in *QueryScheduledCorksByBlockHeightRequest, opts ...grpc.CallOption) (*QueryScheduledCorksByBlockHeightResponse, error) + // QueryScheduledCorks returns all scheduled corks with the specified ID + QueryScheduledCorksByID(ctx context.Context, in *QueryScheduledCorksByIDRequest, opts ...grpc.CallOption) (*QueryScheduledCorksByIDResponse, error) + QueryCorkResult(ctx context.Context, in *QueryCorkResultRequest, opts ...grpc.CallOption) (*QueryCorkResultResponse, error) + QueryCorkResults(ctx context.Context, in *QueryCorkResultsRequest, opts ...grpc.CallOption) (*QueryCorkResultsResponse, error) + QueryChainConfigurations(ctx context.Context, in *QueryChainConfigurationsRequest, opts ...grpc.CallOption) (*QueryChainConfigurationsResponse, error) + QueryAxelarContractCallNonces(ctx context.Context, in *QueryAxelarContractCallNoncesRequest, opts ...grpc.CallOption) (*QueryAxelarContractCallNoncesResponse, error) + QueryAxelarProxyUpgradeData(ctx context.Context, in *QueryAxelarProxyUpgradeDataRequest, opts ...grpc.CallOption) (*QueryAxelarProxyUpgradeDataResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) QueryParams(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryCellarIDs(ctx context.Context, in *QueryCellarIDsRequest, opts ...grpc.CallOption) (*QueryCellarIDsResponse, error) { + out := new(QueryCellarIDsResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryCellarIDs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryCellarIDsByChainID(ctx context.Context, in *QueryCellarIDsByChainIDRequest, opts ...grpc.CallOption) (*QueryCellarIDsByChainIDResponse, error) { + out := new(QueryCellarIDsByChainIDResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryCellarIDsByChainID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryScheduledCorks(ctx context.Context, in *QueryScheduledCorksRequest, opts ...grpc.CallOption) (*QueryScheduledCorksResponse, error) { + out := new(QueryScheduledCorksResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryScheduledCorks", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryScheduledBlockHeights(ctx context.Context, in *QueryScheduledBlockHeightsRequest, opts ...grpc.CallOption) (*QueryScheduledBlockHeightsResponse, error) { + out := new(QueryScheduledBlockHeightsResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryScheduledBlockHeights", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryScheduledCorksByBlockHeight(ctx context.Context, in *QueryScheduledCorksByBlockHeightRequest, opts ...grpc.CallOption) (*QueryScheduledCorksByBlockHeightResponse, error) { + out := new(QueryScheduledCorksByBlockHeightResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryScheduledCorksByBlockHeight", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryScheduledCorksByID(ctx context.Context, in *QueryScheduledCorksByIDRequest, opts ...grpc.CallOption) (*QueryScheduledCorksByIDResponse, error) { + out := new(QueryScheduledCorksByIDResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryScheduledCorksByID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryCorkResult(ctx context.Context, in *QueryCorkResultRequest, opts ...grpc.CallOption) (*QueryCorkResultResponse, error) { + out := new(QueryCorkResultResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryCorkResult", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryCorkResults(ctx context.Context, in *QueryCorkResultsRequest, opts ...grpc.CallOption) (*QueryCorkResultsResponse, error) { + out := new(QueryCorkResultsResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryCorkResults", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryChainConfigurations(ctx context.Context, in *QueryChainConfigurationsRequest, opts ...grpc.CallOption) (*QueryChainConfigurationsResponse, error) { + out := new(QueryChainConfigurationsResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryChainConfigurations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAxelarContractCallNonces(ctx context.Context, in *QueryAxelarContractCallNoncesRequest, opts ...grpc.CallOption) (*QueryAxelarContractCallNoncesResponse, error) { + out := new(QueryAxelarContractCallNoncesResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryAxelarContractCallNonces", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAxelarProxyUpgradeData(ctx context.Context, in *QueryAxelarProxyUpgradeDataRequest, opts ...grpc.CallOption) (*QueryAxelarProxyUpgradeDataResponse, error) { + out := new(QueryAxelarProxyUpgradeDataResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Query/QueryAxelarProxyUpgradeData", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // QueryParams queries the axelar cork module parameters. + QueryParams(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // QueryCellarIDs queries approved cellar ids of all supported chains + QueryCellarIDs(context.Context, *QueryCellarIDsRequest) (*QueryCellarIDsResponse, error) + // QueryCellarIDsByChainID returns all cellars and current tick ranges + QueryCellarIDsByChainID(context.Context, *QueryCellarIDsByChainIDRequest) (*QueryCellarIDsByChainIDResponse, error) + // QueryScheduledCorks returns all scheduled corks + QueryScheduledCorks(context.Context, *QueryScheduledCorksRequest) (*QueryScheduledCorksResponse, error) + // QueryScheduledBlockHeights returns all scheduled block heights + QueryScheduledBlockHeights(context.Context, *QueryScheduledBlockHeightsRequest) (*QueryScheduledBlockHeightsResponse, error) + // QueryScheduledCorks returns all scheduled corks at a block height + QueryScheduledCorksByBlockHeight(context.Context, *QueryScheduledCorksByBlockHeightRequest) (*QueryScheduledCorksByBlockHeightResponse, error) + // QueryScheduledCorks returns all scheduled corks with the specified ID + QueryScheduledCorksByID(context.Context, *QueryScheduledCorksByIDRequest) (*QueryScheduledCorksByIDResponse, error) + QueryCorkResult(context.Context, *QueryCorkResultRequest) (*QueryCorkResultResponse, error) + QueryCorkResults(context.Context, *QueryCorkResultsRequest) (*QueryCorkResultsResponse, error) + QueryChainConfigurations(context.Context, *QueryChainConfigurationsRequest) (*QueryChainConfigurationsResponse, error) + QueryAxelarContractCallNonces(context.Context, *QueryAxelarContractCallNoncesRequest) (*QueryAxelarContractCallNoncesResponse, error) + QueryAxelarProxyUpgradeData(context.Context, *QueryAxelarProxyUpgradeDataRequest) (*QueryAxelarProxyUpgradeDataResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) QueryParams(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryParams not implemented") +} +func (*UnimplementedQueryServer) QueryCellarIDs(ctx context.Context, req *QueryCellarIDsRequest) (*QueryCellarIDsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryCellarIDs not implemented") +} +func (*UnimplementedQueryServer) QueryCellarIDsByChainID(ctx context.Context, req *QueryCellarIDsByChainIDRequest) (*QueryCellarIDsByChainIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryCellarIDsByChainID not implemented") +} +func (*UnimplementedQueryServer) QueryScheduledCorks(ctx context.Context, req *QueryScheduledCorksRequest) (*QueryScheduledCorksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryScheduledCorks not implemented") +} +func (*UnimplementedQueryServer) QueryScheduledBlockHeights(ctx context.Context, req *QueryScheduledBlockHeightsRequest) (*QueryScheduledBlockHeightsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryScheduledBlockHeights not implemented") +} +func (*UnimplementedQueryServer) QueryScheduledCorksByBlockHeight(ctx context.Context, req *QueryScheduledCorksByBlockHeightRequest) (*QueryScheduledCorksByBlockHeightResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryScheduledCorksByBlockHeight not implemented") +} +func (*UnimplementedQueryServer) QueryScheduledCorksByID(ctx context.Context, req *QueryScheduledCorksByIDRequest) (*QueryScheduledCorksByIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryScheduledCorksByID not implemented") +} +func (*UnimplementedQueryServer) QueryCorkResult(ctx context.Context, req *QueryCorkResultRequest) (*QueryCorkResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryCorkResult not implemented") +} +func (*UnimplementedQueryServer) QueryCorkResults(ctx context.Context, req *QueryCorkResultsRequest) (*QueryCorkResultsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryCorkResults not implemented") +} +func (*UnimplementedQueryServer) QueryChainConfigurations(ctx context.Context, req *QueryChainConfigurationsRequest) (*QueryChainConfigurationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryChainConfigurations not implemented") +} +func (*UnimplementedQueryServer) QueryAxelarContractCallNonces(ctx context.Context, req *QueryAxelarContractCallNoncesRequest) (*QueryAxelarContractCallNoncesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAxelarContractCallNonces not implemented") +} +func (*UnimplementedQueryServer) QueryAxelarProxyUpgradeData(ctx context.Context, req *QueryAxelarProxyUpgradeDataRequest) (*QueryAxelarProxyUpgradeDataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAxelarProxyUpgradeData not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_QueryParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryParams(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryCellarIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCellarIDsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryCellarIDs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryCellarIDs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryCellarIDs(ctx, req.(*QueryCellarIDsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryCellarIDsByChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCellarIDsByChainIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryCellarIDsByChainID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryCellarIDsByChainID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryCellarIDsByChainID(ctx, req.(*QueryCellarIDsByChainIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryScheduledCorks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryScheduledCorksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryScheduledCorks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryScheduledCorks", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryScheduledCorks(ctx, req.(*QueryScheduledCorksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryScheduledBlockHeights_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryScheduledBlockHeightsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryScheduledBlockHeights(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryScheduledBlockHeights", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryScheduledBlockHeights(ctx, req.(*QueryScheduledBlockHeightsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryScheduledCorksByBlockHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryScheduledCorksByBlockHeightRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryScheduledCorksByBlockHeight(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryScheduledCorksByBlockHeight", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryScheduledCorksByBlockHeight(ctx, req.(*QueryScheduledCorksByBlockHeightRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryScheduledCorksByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryScheduledCorksByIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryScheduledCorksByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryScheduledCorksByID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryScheduledCorksByID(ctx, req.(*QueryScheduledCorksByIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryCorkResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCorkResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryCorkResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryCorkResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryCorkResult(ctx, req.(*QueryCorkResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryCorkResults_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCorkResultsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryCorkResults(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryCorkResults", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryCorkResults(ctx, req.(*QueryCorkResultsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryChainConfigurations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryChainConfigurationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryChainConfigurations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryChainConfigurations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryChainConfigurations(ctx, req.(*QueryChainConfigurationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAxelarContractCallNonces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAxelarContractCallNoncesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAxelarContractCallNonces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryAxelarContractCallNonces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAxelarContractCallNonces(ctx, req.(*QueryAxelarContractCallNoncesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAxelarProxyUpgradeData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAxelarProxyUpgradeDataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAxelarProxyUpgradeData(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Query/QueryAxelarProxyUpgradeData", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAxelarProxyUpgradeData(ctx, req.(*QueryAxelarProxyUpgradeDataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "axelarcork.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryParams", + Handler: _Query_QueryParams_Handler, + }, + { + MethodName: "QueryCellarIDs", + Handler: _Query_QueryCellarIDs_Handler, + }, + { + MethodName: "QueryCellarIDsByChainID", + Handler: _Query_QueryCellarIDsByChainID_Handler, + }, + { + MethodName: "QueryScheduledCorks", + Handler: _Query_QueryScheduledCorks_Handler, + }, + { + MethodName: "QueryScheduledBlockHeights", + Handler: _Query_QueryScheduledBlockHeights_Handler, + }, + { + MethodName: "QueryScheduledCorksByBlockHeight", + Handler: _Query_QueryScheduledCorksByBlockHeight_Handler, + }, + { + MethodName: "QueryScheduledCorksByID", + Handler: _Query_QueryScheduledCorksByID_Handler, + }, + { + MethodName: "QueryCorkResult", + Handler: _Query_QueryCorkResult_Handler, + }, + { + MethodName: "QueryCorkResults", + Handler: _Query_QueryCorkResults_Handler, + }, + { + MethodName: "QueryChainConfigurations", + Handler: _Query_QueryChainConfigurations_Handler, + }, + { + MethodName: "QueryAxelarContractCallNonces", + Handler: _Query_QueryAxelarContractCallNonces_Handler, + }, + { + MethodName: "QueryAxelarProxyUpgradeData", + Handler: _Query_QueryAxelarProxyUpgradeData_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "axelarcork/v1/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryCellarIDsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCellarIDsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCellarIDsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryCellarIDsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCellarIDsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCellarIDsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CellarIds) > 0 { + for iNdEx := len(m.CellarIds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CellarIds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryCellarIDsByChainIDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCellarIDsByChainIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCellarIDsByChainIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryCellarIDsByChainIDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCellarIDsByChainIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCellarIDsByChainIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CellarIds) > 0 { + for iNdEx := len(m.CellarIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CellarIds[iNdEx]) + copy(dAtA[i:], m.CellarIds[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CellarIds[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryScheduledCorksRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryScheduledCorksRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryScheduledCorksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryScheduledCorksResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryScheduledCorksResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryScheduledCorksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Corks) > 0 { + for iNdEx := len(m.Corks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Corks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryScheduledBlockHeightsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryScheduledBlockHeightsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryScheduledBlockHeightsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryScheduledBlockHeightsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryScheduledBlockHeightsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryScheduledBlockHeightsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BlockHeights) > 0 { + dAtA3 := make([]byte, len(m.BlockHeights)*10) + var j2 int + for _, num := range m.BlockHeights { + for num >= 1<<7 { + dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j2++ + } + dAtA3[j2] = uint8(num) + j2++ + } + i -= j2 + copy(dAtA[i:], dAtA3[:j2]) + i = encodeVarintQuery(dAtA, i, uint64(j2)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryScheduledCorksByBlockHeightRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryScheduledCorksByBlockHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryScheduledCorksByBlockHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + if m.BlockHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryScheduledCorksByBlockHeightResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryScheduledCorksByBlockHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryScheduledCorksByBlockHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Corks) > 0 { + for iNdEx := len(m.Corks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Corks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryScheduledCorksByIDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryScheduledCorksByIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryScheduledCorksByIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryScheduledCorksByIDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryScheduledCorksByIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryScheduledCorksByIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Corks) > 0 { + for iNdEx := len(m.Corks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Corks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryCorkResultRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCorkResultRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCorkResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCorkResultResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCorkResultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCorkResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CorkResult != nil { + { + size, err := m.CorkResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCorkResultsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCorkResultsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCorkResultsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryCorkResultsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCorkResultsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCorkResultsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CorkResults) > 0 { + for iNdEx := len(m.CorkResults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CorkResults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryChainConfigurationsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryChainConfigurationsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChainConfigurationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryChainConfigurationsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryChainConfigurationsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChainConfigurationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Configurations) > 0 { + for iNdEx := len(m.Configurations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Configurations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryAxelarContractCallNoncesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAxelarContractCallNoncesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAxelarContractCallNoncesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryAxelarContractCallNoncesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAxelarContractCallNoncesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAxelarContractCallNoncesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ContractCallNonces) > 0 { + for iNdEx := len(m.ContractCallNonces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ContractCallNonces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryAxelarProxyUpgradeDataRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAxelarProxyUpgradeDataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAxelarProxyUpgradeDataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryAxelarProxyUpgradeDataResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAxelarProxyUpgradeDataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAxelarProxyUpgradeDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProxyUpgradeData) > 0 { + for iNdEx := len(m.ProxyUpgradeData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ProxyUpgradeData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryCellarIDsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryCellarIDsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.CellarIds) > 0 { + for _, e := range m.CellarIds { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryCellarIDsByChainIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryCellarIDsByChainIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.CellarIds) > 0 { + for _, s := range m.CellarIds { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryScheduledCorksRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryScheduledCorksResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Corks) > 0 { + for _, e := range m.Corks { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryScheduledBlockHeightsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryScheduledBlockHeightsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BlockHeights) > 0 { + l = 0 + for _, e := range m.BlockHeights { + l += sovQuery(uint64(e)) + } + n += 1 + sovQuery(uint64(l)) + l + } + return n +} + +func (m *QueryScheduledCorksByBlockHeightRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockHeight != 0 { + n += 1 + sovQuery(uint64(m.BlockHeight)) + } + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryScheduledCorksByBlockHeightResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Corks) > 0 { + for _, e := range m.Corks { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryScheduledCorksByIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryScheduledCorksByIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Corks) > 0 { + for _, e := range m.Corks { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryCorkResultRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryCorkResultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CorkResult != nil { + l = m.CorkResult.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCorkResultsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryCorkResultsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.CorkResults) > 0 { + for _, e := range m.CorkResults { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryChainConfigurationsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryChainConfigurationsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Configurations) > 0 { + for _, e := range m.Configurations { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryAxelarContractCallNoncesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAxelarContractCallNoncesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ContractCallNonces) > 0 { + for _, e := range m.ContractCallNonces { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryAxelarProxyUpgradeDataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAxelarProxyUpgradeDataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ProxyUpgradeData) > 0 { + for _, e := range m.ProxyUpgradeData { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCellarIDsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCellarIDsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCellarIDsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCellarIDsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCellarIDsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCellarIDsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CellarIds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CellarIds = append(m.CellarIds, &CellarIDSet{}) + if err := m.CellarIds[len(m.CellarIds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCellarIDsByChainIDRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCellarIDsByChainIDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCellarIDsByChainIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCellarIDsByChainIDResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCellarIDsByChainIDResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCellarIDsByChainIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CellarIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CellarIds = append(m.CellarIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryScheduledCorksRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryScheduledCorksRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryScheduledCorksRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryScheduledCorksResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryScheduledCorksResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryScheduledCorksResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Corks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Corks = append(m.Corks, &ScheduledAxelarCork{}) + if err := m.Corks[len(m.Corks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryScheduledBlockHeightsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryScheduledBlockHeightsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryScheduledBlockHeightsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryScheduledBlockHeightsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryScheduledBlockHeightsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryScheduledBlockHeightsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BlockHeights = append(m.BlockHeights, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.BlockHeights) == 0 { + m.BlockHeights = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BlockHeights = append(m.BlockHeights, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeights", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryScheduledCorksByBlockHeightRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryScheduledCorksByBlockHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryScheduledCorksByBlockHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryScheduledCorksByBlockHeightResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryScheduledCorksByBlockHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryScheduledCorksByBlockHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Corks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Corks = append(m.Corks, &ScheduledAxelarCork{}) + if err := m.Corks[len(m.Corks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryScheduledCorksByIDRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryScheduledCorksByIDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryScheduledCorksByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryScheduledCorksByIDResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryScheduledCorksByIDResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryScheduledCorksByIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Corks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Corks = append(m.Corks, &ScheduledAxelarCork{}) + if err := m.Corks[len(m.Corks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCorkResultRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCorkResultRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCorkResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCorkResultResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCorkResultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCorkResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorkResult", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CorkResult == nil { + m.CorkResult = &AxelarCorkResult{} + } + if err := m.CorkResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCorkResultsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCorkResultsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCorkResultsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCorkResultsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCorkResultsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCorkResultsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorkResults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CorkResults = append(m.CorkResults, &AxelarCorkResult{}) + if err := m.CorkResults[len(m.CorkResults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryChainConfigurationsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryChainConfigurationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChainConfigurationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryChainConfigurationsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryChainConfigurationsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChainConfigurationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configurations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Configurations = append(m.Configurations, &ChainConfiguration{}) + if err := m.Configurations[len(m.Configurations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAxelarContractCallNoncesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAxelarContractCallNoncesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAxelarContractCallNoncesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAxelarContractCallNoncesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAxelarContractCallNoncesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAxelarContractCallNoncesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContractCallNonces", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContractCallNonces = append(m.ContractCallNonces, &AxelarContractCallNonce{}) + if err := m.ContractCallNonces[len(m.ContractCallNonces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAxelarProxyUpgradeDataRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAxelarProxyUpgradeDataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAxelarProxyUpgradeDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAxelarProxyUpgradeDataResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAxelarProxyUpgradeDataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAxelarProxyUpgradeDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProxyUpgradeData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProxyUpgradeData = append(m.ProxyUpgradeData, &AxelarUpgradeData{}) + if err := m.ProxyUpgradeData[len(m.ProxyUpgradeData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/axelarcork/types/query.pb.gw.go b/x/axelarcork/types/query.pb.gw.go new file mode 100644 index 00000000..bf20b023 --- /dev/null +++ b/x/axelarcork/types/query.pb.gw.go @@ -0,0 +1,1102 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: axelarcork/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_QueryParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryParams(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryCellarIDs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCellarIDsRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryCellarIDs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryCellarIDs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCellarIDsRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryCellarIDs(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryCellarIDsByChainID_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryCellarIDsByChainID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCellarIDsByChainIDRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryCellarIDsByChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryCellarIDsByChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryCellarIDsByChainID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCellarIDsByChainIDRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryCellarIDsByChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryCellarIDsByChainID(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryScheduledCorks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryScheduledCorks_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryScheduledCorksRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryScheduledCorks_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryScheduledCorks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryScheduledCorks_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryScheduledCorksRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryScheduledCorks_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryScheduledCorks(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryScheduledBlockHeights_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryScheduledBlockHeights_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryScheduledBlockHeightsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryScheduledBlockHeights_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryScheduledBlockHeights(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryScheduledBlockHeights_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryScheduledBlockHeightsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryScheduledBlockHeights_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryScheduledBlockHeights(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryScheduledCorksByBlockHeight_0 = &utilities.DoubleArray{Encoding: map[string]int{"block_height": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryScheduledCorksByBlockHeight_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryScheduledCorksByBlockHeightRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block_height"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block_height") + } + + protoReq.BlockHeight, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block_height", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryScheduledCorksByBlockHeight_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryScheduledCorksByBlockHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryScheduledCorksByBlockHeight_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryScheduledCorksByBlockHeightRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["block_height"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "block_height") + } + + protoReq.BlockHeight, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "block_height", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryScheduledCorksByBlockHeight_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryScheduledCorksByBlockHeight(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryScheduledCorksByID_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryScheduledCorksByID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryScheduledCorksByIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryScheduledCorksByID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryScheduledCorksByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryScheduledCorksByID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryScheduledCorksByIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryScheduledCorksByID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryScheduledCorksByID(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryCorkResult_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryCorkResult_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCorkResultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryCorkResult_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryCorkResult(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryCorkResult_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCorkResultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryCorkResult_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryCorkResult(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryCorkResults_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryCorkResults_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCorkResultsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryCorkResults_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryCorkResults(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryCorkResults_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCorkResultsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryCorkResults_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryCorkResults(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryChainConfigurations_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChainConfigurationsRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryChainConfigurations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryChainConfigurations_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChainConfigurationsRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryChainConfigurations(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryAxelarContractCallNonces_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAxelarContractCallNoncesRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryAxelarContractCallNonces(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAxelarContractCallNonces_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAxelarContractCallNoncesRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryAxelarContractCallNonces(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryAxelarProxyUpgradeData_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAxelarProxyUpgradeDataRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryAxelarProxyUpgradeData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAxelarProxyUpgradeData_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAxelarProxyUpgradeDataRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryAxelarProxyUpgradeData(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_QueryParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryParams_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCellarIDs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryCellarIDs_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCellarIDs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCellarIDsByChainID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryCellarIDsByChainID_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCellarIDsByChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryScheduledCorks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryScheduledCorks_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryScheduledCorks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryScheduledBlockHeights_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryScheduledBlockHeights_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryScheduledBlockHeights_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryScheduledCorksByBlockHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryScheduledCorksByBlockHeight_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryScheduledCorksByBlockHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryScheduledCorksByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryScheduledCorksByID_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryScheduledCorksByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCorkResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryCorkResult_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCorkResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCorkResults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryCorkResults_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCorkResults_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryChainConfigurations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryChainConfigurations_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryChainConfigurations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAxelarContractCallNonces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAxelarContractCallNonces_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAxelarContractCallNonces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAxelarProxyUpgradeData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryAxelarProxyUpgradeData_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAxelarProxyUpgradeData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_QueryParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryParams_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCellarIDs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryCellarIDs_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCellarIDs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCellarIDsByChainID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryCellarIDsByChainID_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCellarIDsByChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryScheduledCorks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryScheduledCorks_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryScheduledCorks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryScheduledBlockHeights_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryScheduledBlockHeights_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryScheduledBlockHeights_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryScheduledCorksByBlockHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryScheduledCorksByBlockHeight_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryScheduledCorksByBlockHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryScheduledCorksByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryScheduledCorksByID_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryScheduledCorksByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCorkResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryCorkResult_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCorkResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryCorkResults_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryCorkResults_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryCorkResults_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryChainConfigurations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryChainConfigurations_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryChainConfigurations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAxelarContractCallNonces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAxelarContractCallNonces_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAxelarContractCallNonces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAxelarProxyUpgradeData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryAxelarProxyUpgradeData_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryAxelarProxyUpgradeData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_QueryParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sommelier", "cork", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryCellarIDs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sommelier", "axelarcork", "v1", "cellar_ids"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryCellarIDsByChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sommelier", "axelarcork", "v1", "cellar_ids_by_chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryScheduledCorks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sommelier", "axelarcork", "v1", "scheduled_corks"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryScheduledBlockHeights_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sommelier", "axelarcork", "v1", "scheduled_block_heights"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryScheduledCorksByBlockHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"sommelier", "axelarcork", "v1", "scheduled_corks_by_block_height", "block_height"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryScheduledCorksByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"sommelier", "axelarcork", "v1", "scheduled_corks_by_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryCorkResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"sommelier", "axelarcork", "v1", "cork_results", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryCorkResults_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sommelier", "axelarcork", "v1", "cork_results"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryChainConfigurations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sommelier", "axelarcork", "v1", "chain_configurations"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAxelarContractCallNonces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sommelier", "axelarcork", "v1", "contract_call_nonces"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAxelarProxyUpgradeData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sommelier", "axelarcork", "v1", "proxy_upgrade_data"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_QueryParams_0 = runtime.ForwardResponseMessage + + forward_Query_QueryCellarIDs_0 = runtime.ForwardResponseMessage + + forward_Query_QueryCellarIDsByChainID_0 = runtime.ForwardResponseMessage + + forward_Query_QueryScheduledCorks_0 = runtime.ForwardResponseMessage + + forward_Query_QueryScheduledBlockHeights_0 = runtime.ForwardResponseMessage + + forward_Query_QueryScheduledCorksByBlockHeight_0 = runtime.ForwardResponseMessage + + forward_Query_QueryScheduledCorksByID_0 = runtime.ForwardResponseMessage + + forward_Query_QueryCorkResult_0 = runtime.ForwardResponseMessage + + forward_Query_QueryCorkResults_0 = runtime.ForwardResponseMessage + + forward_Query_QueryChainConfigurations_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAxelarContractCallNonces_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAxelarProxyUpgradeData_0 = runtime.ForwardResponseMessage +) diff --git a/x/axelarcork/types/tx.pb.go b/x/axelarcork/types/tx.pb.go new file mode 100644 index 00000000..f2a2052a --- /dev/null +++ b/x/axelarcork/types/tx.pb.go @@ -0,0 +1,2487 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: axelarcork/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgScheduleCorkRequest - sdk.Msg for scheduling a cork request for on or after a specific block height +type MsgScheduleAxelarCorkRequest struct { + // the scheduled cork + Cork *AxelarCork `protobuf:"bytes,1,opt,name=cork,proto3" json:"cork,omitempty"` + // the chain id + ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // the block height that must be reached + BlockHeight uint64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + // signer account address + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgScheduleAxelarCorkRequest) Reset() { *m = MsgScheduleAxelarCorkRequest{} } +func (m *MsgScheduleAxelarCorkRequest) String() string { return proto.CompactTextString(m) } +func (*MsgScheduleAxelarCorkRequest) ProtoMessage() {} +func (*MsgScheduleAxelarCorkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{0} +} +func (m *MsgScheduleAxelarCorkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgScheduleAxelarCorkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgScheduleAxelarCorkRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgScheduleAxelarCorkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgScheduleAxelarCorkRequest.Merge(m, src) +} +func (m *MsgScheduleAxelarCorkRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgScheduleAxelarCorkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgScheduleAxelarCorkRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgScheduleAxelarCorkRequest proto.InternalMessageInfo + +func (m *MsgScheduleAxelarCorkRequest) GetCork() *AxelarCork { + if m != nil { + return m.Cork + } + return nil +} + +func (m *MsgScheduleAxelarCorkRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *MsgScheduleAxelarCorkRequest) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *MsgScheduleAxelarCorkRequest) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +type MsgScheduleAxelarCorkResponse struct { + // cork ID + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *MsgScheduleAxelarCorkResponse) Reset() { *m = MsgScheduleAxelarCorkResponse{} } +func (m *MsgScheduleAxelarCorkResponse) String() string { return proto.CompactTextString(m) } +func (*MsgScheduleAxelarCorkResponse) ProtoMessage() {} +func (*MsgScheduleAxelarCorkResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{1} +} +func (m *MsgScheduleAxelarCorkResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgScheduleAxelarCorkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgScheduleAxelarCorkResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgScheduleAxelarCorkResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgScheduleAxelarCorkResponse.Merge(m, src) +} +func (m *MsgScheduleAxelarCorkResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgScheduleAxelarCorkResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgScheduleAxelarCorkResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgScheduleAxelarCorkResponse proto.InternalMessageInfo + +func (m *MsgScheduleAxelarCorkResponse) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type MsgRelayAxelarCorkRequest struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Token types.Coin `protobuf:"bytes,2,opt,name=token,proto3" json:"token"` + Fee uint64 `protobuf:"varint,3,opt,name=fee,proto3" json:"fee,omitempty"` + ChainId uint64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + TargetContractAddress string `protobuf:"bytes,5,opt,name=target_contract_address,json=targetContractAddress,proto3" json:"target_contract_address,omitempty"` +} + +func (m *MsgRelayAxelarCorkRequest) Reset() { *m = MsgRelayAxelarCorkRequest{} } +func (m *MsgRelayAxelarCorkRequest) String() string { return proto.CompactTextString(m) } +func (*MsgRelayAxelarCorkRequest) ProtoMessage() {} +func (*MsgRelayAxelarCorkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{2} +} +func (m *MsgRelayAxelarCorkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRelayAxelarCorkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRelayAxelarCorkRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRelayAxelarCorkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRelayAxelarCorkRequest.Merge(m, src) +} +func (m *MsgRelayAxelarCorkRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgRelayAxelarCorkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRelayAxelarCorkRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRelayAxelarCorkRequest proto.InternalMessageInfo + +func (m *MsgRelayAxelarCorkRequest) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgRelayAxelarCorkRequest) GetToken() types.Coin { + if m != nil { + return m.Token + } + return types.Coin{} +} + +func (m *MsgRelayAxelarCorkRequest) GetFee() uint64 { + if m != nil { + return m.Fee + } + return 0 +} + +func (m *MsgRelayAxelarCorkRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *MsgRelayAxelarCorkRequest) GetTargetContractAddress() string { + if m != nil { + return m.TargetContractAddress + } + return "" +} + +type MsgRelayAxelarCorkResponse struct { +} + +func (m *MsgRelayAxelarCorkResponse) Reset() { *m = MsgRelayAxelarCorkResponse{} } +func (m *MsgRelayAxelarCorkResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRelayAxelarCorkResponse) ProtoMessage() {} +func (*MsgRelayAxelarCorkResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{3} +} +func (m *MsgRelayAxelarCorkResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRelayAxelarCorkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRelayAxelarCorkResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRelayAxelarCorkResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRelayAxelarCorkResponse.Merge(m, src) +} +func (m *MsgRelayAxelarCorkResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRelayAxelarCorkResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRelayAxelarCorkResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRelayAxelarCorkResponse proto.InternalMessageInfo + +type MsgRelayAxelarProxyUpgradeRequest struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Token types.Coin `protobuf:"bytes,2,opt,name=token,proto3" json:"token"` + Fee uint64 `protobuf:"varint,3,opt,name=fee,proto3" json:"fee,omitempty"` + ChainId uint64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *MsgRelayAxelarProxyUpgradeRequest) Reset() { *m = MsgRelayAxelarProxyUpgradeRequest{} } +func (m *MsgRelayAxelarProxyUpgradeRequest) String() string { return proto.CompactTextString(m) } +func (*MsgRelayAxelarProxyUpgradeRequest) ProtoMessage() {} +func (*MsgRelayAxelarProxyUpgradeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{4} +} +func (m *MsgRelayAxelarProxyUpgradeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRelayAxelarProxyUpgradeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRelayAxelarProxyUpgradeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRelayAxelarProxyUpgradeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRelayAxelarProxyUpgradeRequest.Merge(m, src) +} +func (m *MsgRelayAxelarProxyUpgradeRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgRelayAxelarProxyUpgradeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRelayAxelarProxyUpgradeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRelayAxelarProxyUpgradeRequest proto.InternalMessageInfo + +func (m *MsgRelayAxelarProxyUpgradeRequest) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgRelayAxelarProxyUpgradeRequest) GetToken() types.Coin { + if m != nil { + return m.Token + } + return types.Coin{} +} + +func (m *MsgRelayAxelarProxyUpgradeRequest) GetFee() uint64 { + if m != nil { + return m.Fee + } + return 0 +} + +func (m *MsgRelayAxelarProxyUpgradeRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +type MsgRelayAxelarProxyUpgradeResponse struct { +} + +func (m *MsgRelayAxelarProxyUpgradeResponse) Reset() { *m = MsgRelayAxelarProxyUpgradeResponse{} } +func (m *MsgRelayAxelarProxyUpgradeResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRelayAxelarProxyUpgradeResponse) ProtoMessage() {} +func (*MsgRelayAxelarProxyUpgradeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{5} +} +func (m *MsgRelayAxelarProxyUpgradeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRelayAxelarProxyUpgradeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRelayAxelarProxyUpgradeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRelayAxelarProxyUpgradeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRelayAxelarProxyUpgradeResponse.Merge(m, src) +} +func (m *MsgRelayAxelarProxyUpgradeResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRelayAxelarProxyUpgradeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRelayAxelarProxyUpgradeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRelayAxelarProxyUpgradeResponse proto.InternalMessageInfo + +type MsgBumpAxelarCorkGasRequest struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Token types.Coin `protobuf:"bytes,2,opt,name=token,proto3" json:"token"` + MessageId string `protobuf:"bytes,3,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` +} + +func (m *MsgBumpAxelarCorkGasRequest) Reset() { *m = MsgBumpAxelarCorkGasRequest{} } +func (m *MsgBumpAxelarCorkGasRequest) String() string { return proto.CompactTextString(m) } +func (*MsgBumpAxelarCorkGasRequest) ProtoMessage() {} +func (*MsgBumpAxelarCorkGasRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{6} +} +func (m *MsgBumpAxelarCorkGasRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBumpAxelarCorkGasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBumpAxelarCorkGasRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBumpAxelarCorkGasRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBumpAxelarCorkGasRequest.Merge(m, src) +} +func (m *MsgBumpAxelarCorkGasRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgBumpAxelarCorkGasRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBumpAxelarCorkGasRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBumpAxelarCorkGasRequest proto.InternalMessageInfo + +func (m *MsgBumpAxelarCorkGasRequest) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgBumpAxelarCorkGasRequest) GetToken() types.Coin { + if m != nil { + return m.Token + } + return types.Coin{} +} + +func (m *MsgBumpAxelarCorkGasRequest) GetMessageId() string { + if m != nil { + return m.MessageId + } + return "" +} + +type MsgBumpAxelarCorkGasResponse struct { +} + +func (m *MsgBumpAxelarCorkGasResponse) Reset() { *m = MsgBumpAxelarCorkGasResponse{} } +func (m *MsgBumpAxelarCorkGasResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBumpAxelarCorkGasResponse) ProtoMessage() {} +func (*MsgBumpAxelarCorkGasResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{7} +} +func (m *MsgBumpAxelarCorkGasResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBumpAxelarCorkGasResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBumpAxelarCorkGasResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBumpAxelarCorkGasResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBumpAxelarCorkGasResponse.Merge(m, src) +} +func (m *MsgBumpAxelarCorkGasResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBumpAxelarCorkGasResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBumpAxelarCorkGasResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBumpAxelarCorkGasResponse proto.InternalMessageInfo + +type MsgCancelAxelarCorkRequest struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + ChainId uint64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + TargetContractAddress string `protobuf:"bytes,3,opt,name=target_contract_address,json=targetContractAddress,proto3" json:"target_contract_address,omitempty"` +} + +func (m *MsgCancelAxelarCorkRequest) Reset() { *m = MsgCancelAxelarCorkRequest{} } +func (m *MsgCancelAxelarCorkRequest) String() string { return proto.CompactTextString(m) } +func (*MsgCancelAxelarCorkRequest) ProtoMessage() {} +func (*MsgCancelAxelarCorkRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{8} +} +func (m *MsgCancelAxelarCorkRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelAxelarCorkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelAxelarCorkRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCancelAxelarCorkRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelAxelarCorkRequest.Merge(m, src) +} +func (m *MsgCancelAxelarCorkRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelAxelarCorkRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelAxelarCorkRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelAxelarCorkRequest proto.InternalMessageInfo + +func (m *MsgCancelAxelarCorkRequest) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgCancelAxelarCorkRequest) GetChainId() uint64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *MsgCancelAxelarCorkRequest) GetTargetContractAddress() string { + if m != nil { + return m.TargetContractAddress + } + return "" +} + +type MsgCancelAxelarCorkResponse struct { +} + +func (m *MsgCancelAxelarCorkResponse) Reset() { *m = MsgCancelAxelarCorkResponse{} } +func (m *MsgCancelAxelarCorkResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCancelAxelarCorkResponse) ProtoMessage() {} +func (*MsgCancelAxelarCorkResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7efa2af5736321fb, []int{9} +} +func (m *MsgCancelAxelarCorkResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCancelAxelarCorkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCancelAxelarCorkResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCancelAxelarCorkResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCancelAxelarCorkResponse.Merge(m, src) +} +func (m *MsgCancelAxelarCorkResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCancelAxelarCorkResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCancelAxelarCorkResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCancelAxelarCorkResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgScheduleAxelarCorkRequest)(nil), "axelarcork.v1.MsgScheduleAxelarCorkRequest") + proto.RegisterType((*MsgScheduleAxelarCorkResponse)(nil), "axelarcork.v1.MsgScheduleAxelarCorkResponse") + proto.RegisterType((*MsgRelayAxelarCorkRequest)(nil), "axelarcork.v1.MsgRelayAxelarCorkRequest") + proto.RegisterType((*MsgRelayAxelarCorkResponse)(nil), "axelarcork.v1.MsgRelayAxelarCorkResponse") + proto.RegisterType((*MsgRelayAxelarProxyUpgradeRequest)(nil), "axelarcork.v1.MsgRelayAxelarProxyUpgradeRequest") + proto.RegisterType((*MsgRelayAxelarProxyUpgradeResponse)(nil), "axelarcork.v1.MsgRelayAxelarProxyUpgradeResponse") + proto.RegisterType((*MsgBumpAxelarCorkGasRequest)(nil), "axelarcork.v1.MsgBumpAxelarCorkGasRequest") + proto.RegisterType((*MsgBumpAxelarCorkGasResponse)(nil), "axelarcork.v1.MsgBumpAxelarCorkGasResponse") + proto.RegisterType((*MsgCancelAxelarCorkRequest)(nil), "axelarcork.v1.MsgCancelAxelarCorkRequest") + proto.RegisterType((*MsgCancelAxelarCorkResponse)(nil), "axelarcork.v1.MsgCancelAxelarCorkResponse") +} + +func init() { proto.RegisterFile("axelarcork/v1/tx.proto", fileDescriptor_7efa2af5736321fb) } + +var fileDescriptor_7efa2af5736321fb = []byte{ + // 618 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xcd, 0xd4, 0x69, 0xbf, 0x2f, 0xd3, 0x82, 0x90, 0x81, 0x92, 0x9a, 0xd6, 0xb4, 0x16, 0x8b, + 0xd0, 0x82, 0x47, 0x09, 0x02, 0xd6, 0x4d, 0x16, 0x50, 0x89, 0x48, 0xc8, 0x88, 0x0d, 0x9b, 0x30, + 0xb1, 0x6f, 0x27, 0x26, 0xb6, 0xc7, 0x78, 0x26, 0x51, 0xf2, 0x04, 0x2c, 0xd8, 0xf0, 0x06, 0x2c, + 0xd8, 0xf0, 0x28, 0xdd, 0xd1, 0x25, 0x2b, 0x84, 0x92, 0x17, 0x41, 0x1e, 0xbb, 0x4a, 0x42, 0x7e, + 0x94, 0x0d, 0x12, 0xbb, 0x99, 0x7b, 0xcf, 0x9d, 0x7b, 0xce, 0xfd, 0x19, 0xbc, 0x4b, 0x07, 0x10, + 0xd0, 0xc4, 0xe5, 0x49, 0x97, 0xf4, 0xab, 0x44, 0x0e, 0xec, 0x38, 0xe1, 0x92, 0xeb, 0xd7, 0x26, + 0x76, 0xbb, 0x5f, 0x35, 0x4c, 0x97, 0x8b, 0x90, 0x0b, 0xd2, 0xa6, 0x02, 0x48, 0xbf, 0xda, 0x06, + 0x49, 0xab, 0xc4, 0xe5, 0x7e, 0x94, 0xc1, 0x0d, 0x73, 0xf6, 0x99, 0xa9, 0xe0, 0xcc, 0x7f, 0x8b, + 0x71, 0xc6, 0xd5, 0x91, 0xa4, 0xa7, 0xcc, 0x6a, 0x7d, 0x45, 0x78, 0xbf, 0x29, 0xd8, 0x6b, 0xb7, + 0x03, 0x5e, 0x2f, 0x80, 0x53, 0x15, 0xd5, 0xe0, 0x49, 0xd7, 0x81, 0x0f, 0x3d, 0x10, 0x52, 0x7f, + 0x84, 0x8b, 0xe9, 0x23, 0x65, 0x74, 0x88, 0x2a, 0xdb, 0xb5, 0x3d, 0x7b, 0x86, 0x94, 0x3d, 0x85, + 0x57, 0x30, 0x7d, 0x0f, 0xff, 0xef, 0x76, 0xa8, 0x1f, 0xb5, 0x7c, 0xaf, 0xbc, 0x71, 0x88, 0x2a, + 0x45, 0xe7, 0x3f, 0x75, 0x3f, 0xf3, 0xf4, 0x23, 0xbc, 0xd3, 0x0e, 0xb8, 0xdb, 0x6d, 0x75, 0xc0, + 0x67, 0x1d, 0x59, 0xd6, 0x94, 0x7b, 0x5b, 0xd9, 0x5e, 0x28, 0x93, 0xbe, 0x8b, 0xb7, 0x84, 0xcf, + 0x22, 0x48, 0xca, 0xc5, 0x43, 0x54, 0x29, 0x39, 0xf9, 0xcd, 0x22, 0xf8, 0x60, 0x09, 0x49, 0x11, + 0xf3, 0x48, 0x80, 0x7e, 0x1d, 0x6f, 0xf8, 0x9e, 0xe2, 0x58, 0x72, 0x36, 0x7c, 0xcf, 0xfa, 0x8e, + 0xf0, 0x5e, 0x53, 0x30, 0x07, 0x02, 0x3a, 0x9c, 0xd7, 0x34, 0x49, 0x83, 0xa6, 0xd3, 0xe8, 0x4f, + 0xf0, 0xa6, 0xe4, 0x5d, 0x88, 0x14, 0xf3, 0x54, 0x6c, 0x56, 0x72, 0x3b, 0x2d, 0xb9, 0x9d, 0x97, + 0xdc, 0x6e, 0x70, 0x3f, 0xaa, 0x17, 0x2f, 0x7e, 0xde, 0x2b, 0x38, 0x19, 0x5a, 0xbf, 0x81, 0xb5, + 0x73, 0x80, 0x5c, 0x4f, 0x7a, 0x9c, 0xa9, 0x42, 0x71, 0xb6, 0x0a, 0x4f, 0xf1, 0x1d, 0x49, 0x13, + 0x06, 0xb2, 0xe5, 0xf2, 0x48, 0x26, 0xd4, 0x95, 0x2d, 0xea, 0x79, 0x09, 0x08, 0x51, 0xde, 0x54, + 0x64, 0x6e, 0x67, 0xee, 0x46, 0xee, 0x3d, 0xcd, 0x9c, 0xd6, 0x3e, 0x36, 0x16, 0x09, 0xca, 0xf4, + 0x5b, 0x5f, 0x10, 0x3e, 0x9a, 0x75, 0xbf, 0x4a, 0xf8, 0x60, 0xf8, 0x26, 0x66, 0x09, 0xf5, 0xe0, + 0x1f, 0xd0, 0x6d, 0xdd, 0xc7, 0xd6, 0x2a, 0x82, 0xb9, 0x8e, 0x4f, 0x08, 0xdf, 0x6d, 0x0a, 0x56, + 0xef, 0x85, 0xf1, 0x44, 0xe5, 0x73, 0x2a, 0xfe, 0x92, 0x82, 0x03, 0x8c, 0x43, 0x10, 0x82, 0x32, + 0x48, 0x19, 0x6b, 0xea, 0xc9, 0x52, 0x6e, 0x39, 0xf3, 0x2c, 0x53, 0xed, 0xc6, 0x02, 0x32, 0x39, + 0xdb, 0x8f, 0x48, 0x35, 0xa5, 0x41, 0x23, 0x17, 0x82, 0xf5, 0xc7, 0x6c, 0xc5, 0x8e, 0xac, 0x98, + 0x0e, 0x6d, 0xd5, 0x74, 0x1c, 0xa8, 0xb2, 0xcd, 0x13, 0xc9, 0x88, 0xd6, 0xbe, 0x69, 0x58, 0x6b, + 0x0a, 0xa6, 0xfb, 0x78, 0xe7, 0x6a, 0x89, 0x52, 0xbf, 0x7e, 0xf2, 0xc7, 0x3a, 0xaf, 0xfa, 0x09, + 0x8c, 0x87, 0xeb, 0x81, 0xf3, 0x8d, 0x7c, 0x87, 0x4b, 0xaa, 0xd9, 0x2a, 0x4f, 0x65, 0x3e, 0x74, + 0xf1, 0x6a, 0x1a, 0x0f, 0xd6, 0x40, 0xe6, 0x19, 0xce, 0xf1, 0x76, 0xda, 0x9a, 0xbc, 0x29, 0xfa, + 0xf1, 0x7c, 0xe4, 0xb2, 0x31, 0x32, 0x4e, 0xd6, 0xc2, 0xe6, 0x79, 0x02, 0x7c, 0x33, 0x2b, 0xec, + 0x95, 0x5a, 0x4f, 0x69, 0x5a, 0xc0, 0x74, 0xc9, 0x20, 0x18, 0xc7, 0xeb, 0x40, 0xb3, 0x6c, 0xf5, + 0x97, 0x17, 0x23, 0x13, 0x5d, 0x8e, 0x4c, 0xf4, 0x6b, 0x64, 0xa2, 0xcf, 0x63, 0xb3, 0x70, 0x39, + 0x36, 0x0b, 0x3f, 0xc6, 0x66, 0xe1, 0x6d, 0x8d, 0xf9, 0xb2, 0xd3, 0x6b, 0xdb, 0x2e, 0x0f, 0x49, + 0x0c, 0x8c, 0x0d, 0xdf, 0xf7, 0x89, 0xe0, 0x61, 0x08, 0x81, 0x0f, 0x09, 0xe9, 0x3f, 0x23, 0x83, + 0xa9, 0x4f, 0x9f, 0xc8, 0x61, 0x0c, 0xa2, 0xbd, 0xa5, 0x7e, 0xf9, 0xc7, 0xbf, 0x03, 0x00, 0x00, + 0xff, 0xff, 0x7b, 0xa5, 0x46, 0xdf, 0x64, 0x06, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + ScheduleCork(ctx context.Context, in *MsgScheduleAxelarCorkRequest, opts ...grpc.CallOption) (*MsgScheduleAxelarCorkResponse, error) + RelayCork(ctx context.Context, in *MsgRelayAxelarCorkRequest, opts ...grpc.CallOption) (*MsgRelayAxelarCorkResponse, error) + BumpCorkGas(ctx context.Context, in *MsgBumpAxelarCorkGasRequest, opts ...grpc.CallOption) (*MsgBumpAxelarCorkGasResponse, error) + CancelScheduledCork(ctx context.Context, in *MsgCancelAxelarCorkRequest, opts ...grpc.CallOption) (*MsgCancelAxelarCorkResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ScheduleCork(ctx context.Context, in *MsgScheduleAxelarCorkRequest, opts ...grpc.CallOption) (*MsgScheduleAxelarCorkResponse, error) { + out := new(MsgScheduleAxelarCorkResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Msg/ScheduleCork", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RelayCork(ctx context.Context, in *MsgRelayAxelarCorkRequest, opts ...grpc.CallOption) (*MsgRelayAxelarCorkResponse, error) { + out := new(MsgRelayAxelarCorkResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Msg/RelayCork", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) BumpCorkGas(ctx context.Context, in *MsgBumpAxelarCorkGasRequest, opts ...grpc.CallOption) (*MsgBumpAxelarCorkGasResponse, error) { + out := new(MsgBumpAxelarCorkGasResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Msg/BumpCorkGas", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CancelScheduledCork(ctx context.Context, in *MsgCancelAxelarCorkRequest, opts ...grpc.CallOption) (*MsgCancelAxelarCorkResponse, error) { + out := new(MsgCancelAxelarCorkResponse) + err := c.cc.Invoke(ctx, "/axelarcork.v1.Msg/CancelScheduledCork", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + ScheduleCork(context.Context, *MsgScheduleAxelarCorkRequest) (*MsgScheduleAxelarCorkResponse, error) + RelayCork(context.Context, *MsgRelayAxelarCorkRequest) (*MsgRelayAxelarCorkResponse, error) + BumpCorkGas(context.Context, *MsgBumpAxelarCorkGasRequest) (*MsgBumpAxelarCorkGasResponse, error) + CancelScheduledCork(context.Context, *MsgCancelAxelarCorkRequest) (*MsgCancelAxelarCorkResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) ScheduleCork(ctx context.Context, req *MsgScheduleAxelarCorkRequest) (*MsgScheduleAxelarCorkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ScheduleCork not implemented") +} +func (*UnimplementedMsgServer) RelayCork(ctx context.Context, req *MsgRelayAxelarCorkRequest) (*MsgRelayAxelarCorkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RelayCork not implemented") +} +func (*UnimplementedMsgServer) BumpCorkGas(ctx context.Context, req *MsgBumpAxelarCorkGasRequest) (*MsgBumpAxelarCorkGasResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BumpCorkGas not implemented") +} +func (*UnimplementedMsgServer) CancelScheduledCork(ctx context.Context, req *MsgCancelAxelarCorkRequest) (*MsgCancelAxelarCorkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CancelScheduledCork not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_ScheduleCork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgScheduleAxelarCorkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ScheduleCork(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Msg/ScheduleCork", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ScheduleCork(ctx, req.(*MsgScheduleAxelarCorkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RelayCork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRelayAxelarCorkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RelayCork(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Msg/RelayCork", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RelayCork(ctx, req.(*MsgRelayAxelarCorkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_BumpCorkGas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBumpAxelarCorkGasRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).BumpCorkGas(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Msg/BumpCorkGas", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).BumpCorkGas(ctx, req.(*MsgBumpAxelarCorkGasRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CancelScheduledCork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCancelAxelarCorkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CancelScheduledCork(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/axelarcork.v1.Msg/CancelScheduledCork", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CancelScheduledCork(ctx, req.(*MsgCancelAxelarCorkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "axelarcork.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ScheduleCork", + Handler: _Msg_ScheduleCork_Handler, + }, + { + MethodName: "RelayCork", + Handler: _Msg_RelayCork_Handler, + }, + { + MethodName: "BumpCorkGas", + Handler: _Msg_BumpCorkGas_Handler, + }, + { + MethodName: "CancelScheduledCork", + Handler: _Msg_CancelScheduledCork_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "axelarcork/v1/tx.proto", +} + +func (m *MsgScheduleAxelarCorkRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgScheduleAxelarCorkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgScheduleAxelarCorkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + if m.BlockHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x18 + } + if m.ChainId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + if m.Cork != nil { + { + size, err := m.Cork.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgScheduleAxelarCorkResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgScheduleAxelarCorkResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgScheduleAxelarCorkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTx(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRelayAxelarCorkRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRelayAxelarCorkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRelayAxelarCorkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TargetContractAddress) > 0 { + i -= len(m.TargetContractAddress) + copy(dAtA[i:], m.TargetContractAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.TargetContractAddress))) + i-- + dAtA[i] = 0x2a + } + if m.ChainId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x20 + } + if m.Fee != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Fee)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRelayAxelarCorkResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRelayAxelarCorkResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRelayAxelarCorkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRelayAxelarProxyUpgradeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRelayAxelarProxyUpgradeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRelayAxelarProxyUpgradeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x20 + } + if m.Fee != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Fee)) + i-- + dAtA[i] = 0x18 + } + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRelayAxelarProxyUpgradeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRelayAxelarProxyUpgradeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRelayAxelarProxyUpgradeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgBumpAxelarCorkGasRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBumpAxelarCorkGasRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBumpAxelarCorkGasRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MessageId) > 0 { + i -= len(m.MessageId) + copy(dAtA[i:], m.MessageId) + i = encodeVarintTx(dAtA, i, uint64(len(m.MessageId))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Token.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBumpAxelarCorkGasResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBumpAxelarCorkGasResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBumpAxelarCorkGasResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCancelAxelarCorkRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCancelAxelarCorkRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelAxelarCorkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TargetContractAddress) > 0 { + i -= len(m.TargetContractAddress) + copy(dAtA[i:], m.TargetContractAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.TargetContractAddress))) + i-- + dAtA[i] = 0x1a + } + if m.ChainId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCancelAxelarCorkResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCancelAxelarCorkResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCancelAxelarCorkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgScheduleAxelarCorkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Cork != nil { + l = m.Cork.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovTx(uint64(m.ChainId)) + } + if m.BlockHeight != 0 { + n += 1 + sovTx(uint64(m.BlockHeight)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgScheduleAxelarCorkResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRelayAxelarCorkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Token.Size() + n += 1 + l + sovTx(uint64(l)) + if m.Fee != 0 { + n += 1 + sovTx(uint64(m.Fee)) + } + if m.ChainId != 0 { + n += 1 + sovTx(uint64(m.ChainId)) + } + l = len(m.TargetContractAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRelayAxelarCorkResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRelayAxelarProxyUpgradeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Token.Size() + n += 1 + l + sovTx(uint64(l)) + if m.Fee != 0 { + n += 1 + sovTx(uint64(m.Fee)) + } + if m.ChainId != 0 { + n += 1 + sovTx(uint64(m.ChainId)) + } + return n +} + +func (m *MsgRelayAxelarProxyUpgradeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgBumpAxelarCorkGasRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Token.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.MessageId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgBumpAxelarCorkGasResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCancelAxelarCorkRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ChainId != 0 { + n += 1 + sovTx(uint64(m.ChainId)) + } + l = len(m.TargetContractAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCancelAxelarCorkResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgScheduleAxelarCorkRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgScheduleAxelarCorkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgScheduleAxelarCorkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cork", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Cork == nil { + m.Cork = &AxelarCork{} + } + if err := m.Cork.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgScheduleAxelarCorkResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgScheduleAxelarCorkResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgScheduleAxelarCorkResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRelayAxelarCorkRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRelayAxelarCorkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRelayAxelarCorkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + m.Fee = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Fee |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRelayAxelarCorkResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRelayAxelarCorkResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRelayAxelarCorkResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRelayAxelarProxyUpgradeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRelayAxelarProxyUpgradeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRelayAxelarProxyUpgradeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + m.Fee = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Fee |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRelayAxelarProxyUpgradeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRelayAxelarProxyUpgradeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRelayAxelarProxyUpgradeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBumpAxelarCorkGasRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBumpAxelarCorkGasRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBumpAxelarCorkGasRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Token.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBumpAxelarCorkGasResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBumpAxelarCorkGasResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBumpAxelarCorkGasResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelAxelarCorkRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCancelAxelarCorkRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelAxelarCorkRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetContractAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetContractAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCancelAxelarCorkResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCancelAxelarCorkResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCancelAxelarCorkResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +)