diff --git a/Makefile b/Makefile index c4c3ee85fe..d932522e6c 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -CHAINNET ?= betanet +CHAINNET ?= mainnet BINARY ?= sifnoded GOPATH ?= $(shell go env GOPATH) GOBIN ?= $(GOPATH)/bin NOW = $(shell date +'%Y-%m-%d_%T') COMMIT := $(shell git log -1 --format='%H') -VERSION := $(shell cat version) +VERSION := $(shell git describe --match 'v*' --abbrev=8 --tags | sed 's/-g/-/' | sed 's/-[0-9]*-/-/') IMAGE_TAG ?= latest HTTPS_GIT := https://github.com/sifchain/sifnode.git DOCKER ?= docker diff --git a/app/app.go b/app/app.go index c5bc737a9d..0ea1693a23 100644 --- a/app/app.go +++ b/app/app.go @@ -5,6 +5,7 @@ import ( "math/big" "net/http" "os" + "strings" "github.com/cosmos/cosmos-sdk/x/authz" @@ -266,7 +267,14 @@ func NewSifAppWithBlacklist( interfaceRegistry := encodingConfig.InterfaceRegistry bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) + + // FIXME: This adjustment enables the version command to function correctly with the existing version of Sifnode. + // It's intended as a short-term measure and should be eliminated following the planned overhaul of the version command. + if !strings.HasPrefix(version.Version, "v") { + version.Version = "v" + version.Version + } bApp.SetVersion(version.Version) + bApp.SetInterfaceRegistry(interfaceRegistry) keys := sdk.NewKVStoreKeys( authtypes.StoreKey, diff --git a/app/setup_handlers.go b/app/setup_handlers.go index cad87b2e2d..306fb4bdc8 100644 --- a/app/setup_handlers.go +++ b/app/setup_handlers.go @@ -4,14 +4,13 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" m "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) -const releaseVersion = "1.3.1-beta" - func SetupHandlers(app *SifchainApp) { - app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, _ types.Plan, vm m.VersionMap) (m.VersionMap, error) { - app.Logger().Info("Running upgrade handler for " + releaseVersion) + app.UpgradeKeeper.SetUpgradeHandler(version.Version, func(ctx sdk.Context, _ types.Plan, vm m.VersionMap) (m.VersionMap, error) { + app.Logger().Info("Running upgrade handler for " + version.Version) return app.mm.RunMigrations(ctx, app.configurator, vm) }) @@ -20,9 +19,9 @@ func SetupHandlers(app *SifchainApp) { if err != nil { panic(err) } - if upgradeInfo.Name == releaseVersion && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + if upgradeInfo.Name == version.Version && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{}, + // Added: []string{}, } // Use upgrade store loader for the initial loading of all stores when app starts, // it checks if version == upgradeHeight and applies store upgrades before loading the stores, diff --git a/proto/sifnode/clp/v1/genesis.proto b/proto/sifnode/clp/v1/genesis.proto index e06d5b6b4f..67b7a331a2 100644 --- a/proto/sifnode/clp/v1/genesis.proto +++ b/proto/sifnode/clp/v1/genesis.proto @@ -10,12 +10,18 @@ import "sifnode/clp/v1/types.proto"; import "sifnode/clp/v1/rewards_bucket.proto"; // GenesisState - all clp state that must be provided at genesis -// TODO: Add parameters to Genesis state ,such as minimum liquidity required to -// create a pool message GenesisState { sifnode.clp.v1.Params params = 1 [ (gogoproto.nullable) = false ]; repeated string address_whitelist = 2; repeated sifnode.clp.v1.Pool pool_list = 3; repeated sifnode.clp.v1.LiquidityProvider liquidity_providers = 4; repeated RewardsBucket rewards_bucket_list = 5 [(gogoproto.nullable) = false]; + sifnode.clp.v1.RewardParams reward_params = 6 [ (gogoproto.nullable) = false ]; + sifnode.clp.v1.PmtpParams pmtp_params = 7 [ (gogoproto.nullable) = false ]; + sifnode.clp.v1.PmtpEpoch pmtp_epoch = 8 [ (gogoproto.nullable) = false ]; + sifnode.clp.v1.PmtpRateParams pmtp_rate_params = 9 [ (gogoproto.nullable) = false ]; + sifnode.clp.v1.LiquidityProtectionParams liquidity_protection_params = 10 [ (gogoproto.nullable) = false ]; + sifnode.clp.v1.LiquidityProtectionRateParams liquidity_protection_rate_params = 11 [ (gogoproto.nullable) = false ]; + sifnode.clp.v1.SwapFeeParams swap_fee_params = 12 [ (gogoproto.nullable) = false ]; + sifnode.clp.v1.ProviderDistributionParams provider_distribution_params = 13 [ (gogoproto.nullable) = false ]; } diff --git a/proto/sifnode/ethbridge/v1/genesis.proto b/proto/sifnode/ethbridge/v1/genesis.proto new file mode 100644 index 0000000000..6fa223d367 --- /dev/null +++ b/proto/sifnode/ethbridge/v1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package sifnode.ethbridge.v1; + +import "gogoproto/gogo.proto"; +import "sifnode/ethbridge/v1/types.proto"; + +option go_package = "github.com/Sifchain/sifnode/x/ethbridge/types"; + +// GenesisState for ethbridge +message GenesisState { + string ceth_receive_account = 1; + repeated string peggy_tokens = 2; + repeated string blacklist = 3; + Pause pause = 4; +} \ No newline at end of file diff --git a/proto/sifnode/ethbridge/v1/types.proto b/proto/sifnode/ethbridge/v1/types.proto index 40d45c540a..b3eb97d4a3 100644 --- a/proto/sifnode/ethbridge/v1/types.proto +++ b/proto/sifnode/ethbridge/v1/types.proto @@ -47,12 +47,6 @@ enum ClaimType { CLAIM_TYPE_LOCK = 2; } -// GenesisState for ethbridge -message GenesisState { - string ceth_receive_account = 1; - repeated string peggy_tokens = 2; -} - message Pause { bool is_paused = 1; } diff --git a/proto/sifnode/margin/v1/genesis.proto b/proto/sifnode/margin/v1/genesis.proto new file mode 100644 index 0000000000..f1c61399aa --- /dev/null +++ b/proto/sifnode/margin/v1/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package sifnode.margin.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Sifchain/sifnode/x/margin/types"; + +import "sifnode/margin/v1/params.proto"; +import "sifnode/margin/v1/types.proto"; + +message GenesisState { + Params params = 1; + repeated MTP mtp_list = 2; +} \ No newline at end of file diff --git a/proto/sifnode/margin/v1/params.proto b/proto/sifnode/margin/v1/params.proto new file mode 100644 index 0000000000..b7d5580c9e --- /dev/null +++ b/proto/sifnode/margin/v1/params.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; +package sifnode.margin.v1; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Sifchain/sifnode/x/margin/types"; + +message Params { + string leverage_max = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string interest_rate_max = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string interest_rate_min = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string interest_rate_increase = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string interest_rate_decrease = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string health_gain_factor = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + int64 epoch_length = 7; + repeated string pools = 8; + string removal_queue_threshold = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + uint64 max_open_positions = 11; + string pool_open_threshold = 12 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string force_close_fund_percentage = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string force_close_fund_address = 14; + string incremental_interest_payment_fund_percentage = 15 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string incremental_interest_payment_fund_address = 16; + string sq_modifier = 17 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string safety_factor = 18 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + repeated string closed_pools = 19; + bool incremental_interest_payment_enabled = 20; + bool whitelisting_enabled = 21; + bool rowan_collateral_enabled = 22; + } \ No newline at end of file diff --git a/proto/sifnode/margin/v1/query.proto b/proto/sifnode/margin/v1/query.proto index fc864ae9a6..d790b8122f 100644 --- a/proto/sifnode/margin/v1/query.proto +++ b/proto/sifnode/margin/v1/query.proto @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "sifnode/margin/v1/types.proto"; +import "sifnode/margin/v1/params.proto"; option go_package = "github.com/Sifchain/sifnode/x/margin/types"; diff --git a/proto/sifnode/margin/v1/tx.proto b/proto/sifnode/margin/v1/tx.proto index 5ea4e1c575..5364efa840 100644 --- a/proto/sifnode/margin/v1/tx.proto +++ b/proto/sifnode/margin/v1/tx.proto @@ -3,6 +3,7 @@ package sifnode.margin.v1; import "gogoproto/gogo.proto"; import "sifnode/margin/v1/types.proto"; +import "sifnode/margin/v1/params.proto"; option go_package = "github.com/Sifchain/sifnode/x/margin/types"; diff --git a/proto/sifnode/margin/v1/types.proto b/proto/sifnode/margin/v1/types.proto index 046598d9ec..474f06dd2e 100644 --- a/proto/sifnode/margin/v1/types.proto +++ b/proto/sifnode/margin/v1/types.proto @@ -4,68 +4,6 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/Sifchain/sifnode/x/margin/types"; -message GenesisState { Params params = 1; } - -message Params { - string leverage_max = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string interest_rate_max = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string interest_rate_min = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string interest_rate_increase = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string interest_rate_decrease = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string health_gain_factor = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - int64 epoch_length = 7; - repeated string pools = 8; - string removal_queue_threshold = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - uint64 max_open_positions = 11; - string pool_open_threshold = 12 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string force_close_fund_percentage = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string force_close_fund_address = 14; - string incremental_interest_payment_fund_percentage = 15 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string incremental_interest_payment_fund_address = 16; - string sq_modifier = 17 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string safety_factor = 18 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - repeated string closed_pools = 19; - bool incremental_interest_payment_enabled = 20; - bool whitelisting_enabled = 21; - bool rowan_collateral_enabled = 22; -} - enum Position { UNSPECIFIED = 0; LONG = 1; diff --git a/proto/sifnode/oracle/v1/genesis.proto b/proto/sifnode/oracle/v1/genesis.proto new file mode 100644 index 0000000000..9ad20c0a80 --- /dev/null +++ b/proto/sifnode/oracle/v1/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package sifnode.oracle.v1; + +import "gogoproto/gogo.proto"; +import "sifnode/oracle/v1/types.proto"; + +option go_package = "github.com/Sifchain/sifnode/x/oracle/types"; + +message GenesisState { + repeated string address_whitelist = 1; + string admin_address = 2; + repeated DBProphecy prophecies = 3; +} \ No newline at end of file diff --git a/proto/sifnode/oracle/v1/types.proto b/proto/sifnode/oracle/v1/types.proto index 97284b2b17..20d5bc4679 100644 --- a/proto/sifnode/oracle/v1/types.proto +++ b/proto/sifnode/oracle/v1/types.proto @@ -5,12 +5,6 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/Sifchain/sifnode/x/oracle/types"; -message GenesisState { - repeated string address_whitelist = 1; - string admin_address = 2; - repeated DBProphecy prophecies = 3; -} - // Claim contains an arbitrary claim with arbitrary content made by a given // validator message Claim { diff --git a/proto/sifnode/tokenregistry/v1/genesis.proto b/proto/sifnode/tokenregistry/v1/genesis.proto new file mode 100644 index 0000000000..53e950c255 --- /dev/null +++ b/proto/sifnode/tokenregistry/v1/genesis.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package sifnode.tokenregistry.v1; + +import "gogoproto/gogo.proto"; +import "sifnode/tokenregistry/v1/types.proto"; + +option go_package = "github.com/Sifchain/sifnode/x/tokenregistry/types"; + +message GenesisState { + Registry registry = 2; +} \ No newline at end of file diff --git a/proto/sifnode/tokenregistry/v1/types.proto b/proto/sifnode/tokenregistry/v1/types.proto index 7f93a84f2b..e66f13a24a 100644 --- a/proto/sifnode/tokenregistry/v1/types.proto +++ b/proto/sifnode/tokenregistry/v1/types.proto @@ -4,10 +4,6 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/Sifchain/sifnode/x/tokenregistry/types"; -message GenesisState { - Registry registry = 2; -} - message Registry { repeated RegistryEntry entries = 1; } enum Permission { diff --git a/scripts/chain-initiator/download-and-run-version.go b/scripts/chain-initiator/download-and-run-version.go index fcedd5461a..b58d6fda80 100644 --- a/scripts/chain-initiator/download-and-run-version.go +++ b/scripts/chain-initiator/download-and-run-version.go @@ -50,11 +50,6 @@ func downloadAndRunVersion(binaryPathOrURL string, skipDownload bool) (path stri } version = versionMatches[0] - // Remove the "v" prefix if present - if strings.HasPrefix(version, "v") { - version = strings.TrimPrefix(version, "v") - } - // Set the binary path based on the version path = "/tmp/sifnoded-" + version diff --git a/scripts/chain-initiator/submit-upgrade-proposal.go b/scripts/chain-initiator/submit-upgrade-proposal.go index 182f3ee545..8055535b5f 100644 --- a/scripts/chain-initiator/submit-upgrade-proposal.go +++ b/scripts/chain-initiator/submit-upgrade-proposal.go @@ -3,16 +3,9 @@ package main import ( "log" "os/exec" - "strings" ) func submitUpgradeProposal(cmdPath, name, newVersion, upgradeHeight, homePath, keyringBackend, chainId, node, broadcastMode string) { - planName := newVersion - // Remove the "v" prefix if present - if strings.HasPrefix(planName, "v") { - planName = strings.TrimPrefix(planName, "v") - } - // Command and arguments args := []string{ "tx", @@ -20,7 +13,7 @@ func submitUpgradeProposal(cmdPath, name, newVersion, upgradeHeight, homePath, k // "submit-legacy-proposal", // not available in v0.45.x "submit-proposal", "software-upgrade", - planName, + newVersion, "--title", newVersion, "--description", newVersion, "--upgrade-height", upgradeHeight, diff --git a/scripts/chain-initiator/types.go b/scripts/chain-initiator/types.go index 7b9d732224..7b85075053 100644 --- a/scripts/chain-initiator/types.go +++ b/scripts/chain-initiator/types.go @@ -7,8 +7,8 @@ import ( admintypes "github.com/Sifchain/sifnode/x/admin/types" clptypes "github.com/Sifchain/sifnode/x/clp/types" dispensationtypes "github.com/Sifchain/sifnode/x/dispensation/types" - - // epochstypes "github.com/Sifchain/sifnode/x/epochs/types" + epochstypes "github.com/Sifchain/sifnode/x/epochs/types" + ethbridgetypes "github.com/Sifchain/sifnode/x/ethbridge/types" margintypes "github.com/Sifchain/sifnode/x/margin/types" oracletypes "github.com/Sifchain/sifnode/x/oracle/types" tokenregistrytypes "github.com/Sifchain/sifnode/x/tokenregistry/types" @@ -19,8 +19,6 @@ import ( crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - - // genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -30,6 +28,7 @@ import ( ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ibctypes "github.com/cosmos/ibc-go/v4/modules/core/types" + // genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" ) type Genesis struct { @@ -68,33 +67,39 @@ type Block struct { } type AppState struct { - Admin Admin `json:"admin"` - Auth Auth `json:"auth"` - AuthZ authz.GenesisState `json:"authz"` - Bank banktypes.GenesisState `json:"bank"` - Capability Capability `json:"capability"` - CLP CLP `json:"clp"` - Crisis crisistypes.GenesisState `json:"crisis"` - Dispensation Dispensation `json:"dispensation"` - Distribution Distribution `json:"distribution"` - // Epochs epochstypes.GenesisState `json:"epochs"` - Ethbridge struct{} `json:"ethbridge"` - Evidence EvidenceState `json:"evidence"` - Genutil Genutil `json:"genutil"` - Gov Gov `json:"gov"` - Ibc Ibc `json:"ibc"` - Margin Margin `json:"margin"` - Mint Mint `json:"mint"` - Oracle Oracle `json:"oracle"` - Params interface{} `json:"params"` - Slashing Slashing `json:"slashing"` - Staking Staking `json:"staking"` - TokenRegistry TokenRegistry `json:"tokenregistry"` - Transfer transfertypes.GenesisState `json:"transfer"` - Upgrade struct{} `json:"upgrade"` + Admin Admin `json:"admin"` + Auth Auth `json:"auth"` + AuthZ authz.GenesisState `json:"authz"` + Bank banktypes.GenesisState `json:"bank"` + Capability Capability `json:"capability"` + CLP CLP `json:"clp"` + Crisis crisistypes.GenesisState `json:"crisis"` + Dispensation Dispensation `json:"dispensation"` + Distribution Distribution `json:"distribution"` + Epochs Epochs `json:"epochs"` + Ethbridge ethbridgetypes.GenesisState `json:"ethbridge"` + Evidence EvidenceState `json:"evidence"` + Genutil Genutil `json:"genutil"` + Gov Gov `json:"gov"` + Ibc Ibc `json:"ibc"` + Margin Margin `json:"margin"` + Mint Mint `json:"mint"` + Oracle Oracle `json:"oracle"` + Params interface{} `json:"params"` + Slashing Slashing `json:"slashing"` + Staking Staking `json:"staking"` + TokenRegistry TokenRegistry `json:"tokenregistry"` + Transfer transfertypes.GenesisState `json:"transfer"` + Upgrade struct{} `json:"upgrade"` // Include other fields as needed } +type Epochs struct { + epochstypes.GenesisState + + Epochs []interface{} `json:"epochs"` +} + type Genutil struct { // genutiltypes.GenesisState @@ -288,19 +293,63 @@ type ChannelGenesis struct { NextChannelSequence json.Number `json:"next_channel_sequence"` } +type CLP struct { + clptypes.GenesisState + + Params CLPParams `json:"params"` + PoolList []interface{} `json:"pool_list"` + LiquidityProviders []interface{} `json:"liquidity_providers"` + RewardsBucketList []interface{} `json:"rewards_bucket_list"` + RewardParams CLPRewardParams `json:"reward_params,omitempty"` + PmtpParams CLPPmtpParams `json:"pmtp_params,omitempty"` + PmtpEpoch CLPPmtpEpoch `json:"pmtp_epoch,omitempty"` + PmtpRateParams clptypes.PmtpRateParams `json:"pmtp_rate_params,omitempty"` + LiquidityProtectionParams CLPLiquidityProtectionParams `json:"liquidity_protection_params,omitempty"` + LiquidityProtectionRateParams clptypes.LiquidityProtectionRateParams `json:"liquidity_protection_rate_params,omitempty"` + SwapFeeParams clptypes.SwapFeeParams `json:"swap_fee_params,omitempty"` + ProviderDistributionParams CLPProviderDistributionParams `json:"provider_distribution_params,omitempty"` +} + +type CLPProviderDistributionParams struct { + clptypes.ProviderDistributionParams + + DistributionPeriods []interface{} `json:"distribution_periods"` +} + type CLPParams struct { clptypes.Params MinCreatePoolThreshold json.Number `json:"min_create_pool_threshold"` } -type CLP struct { - clptypes.GenesisState +type CLPRewardParams struct { + clptypes.RewardParams + + LiquidityRemovalLockPeriod json.Number `json:"liquidity_removal_lock_period"` + LiquidityRemovalCancelPeriod json.Number `json:"liquidity_removal_cancel_period"` + RewardPeriods []interface{} `json:"reward_periods"` + RewardsLockPeriod json.Number `json:"rewards_lock_period"` +} + +type CLPPmtpParams struct { + clptypes.PmtpParams + + PmtpPeriodEpochLength json.Number `json:"pmtp_period_epoch_length"` + PmtpPeriodStartBlock json.Number `json:"pmtp_period_start_block"` + PmtpPeriodEndBlock json.Number `json:"pmtp_period_end_block"` +} + +type CLPPmtpEpoch struct { + clptypes.PmtpEpoch + + EpochCounter json.Number `json:"epoch_counter"` + BlockCounter json.Number `json:"block_counter"` +} + +type CLPLiquidityProtectionParams struct { + clptypes.LiquidityProtectionParams - Params CLPParams `json:"params"` - PoolList []interface{} `json:"pool_list"` - LiquidityProviders []interface{} `json:"liquidity_providers"` - RewardsBucketList []interface{} `json:"rewards_bucket_list,omitempty"` // omitted for now + EpochLength json.Number `json:"epoch_length"` } type Margin struct { diff --git a/version b/version deleted file mode 100644 index d06113808a..0000000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -1.3.1-beta diff --git a/x/clp/genesis.go b/x/clp/genesis.go index 3a1dbd0d43..ef3de85d6c 100644 --- a/x/clp/genesis.go +++ b/x/clp/genesis.go @@ -14,80 +14,132 @@ import ( ) func InitGenesis(ctx sdk.Context, k keeper.Keeper, data types.GenesisState) (res []abci.ValidatorUpdate) { + // Set initial CLP parameters k.SetParams(ctx, data.Params) - k.SetRewardParams(ctx, types.GetDefaultRewardParams()) - // Initiate Pmtp - k.SetPmtpRateParams(ctx, types.PmtpRateParams{ - PmtpPeriodBlockRate: sdk.ZeroDec(), - PmtpCurrentRunningRate: sdk.ZeroDec(), - PmtpInterPolicyRate: sdk.ZeroDec(), - }) - k.SetPmtpEpoch(ctx, types.PmtpEpoch{ - EpochCounter: 0, - BlockCounter: 0, - }) - k.SetPmtpParams(ctx, types.GetDefaultPmtpParams()) - k.SetPmtpInterPolicyRate(ctx, sdk.NewDec(0)) + // Set initial address whitelist if data.AddressWhitelist == nil || len(data.AddressWhitelist) == 0 { panic("AddressWhiteList must be set.") } - - // Set initial liquidity protection states - k.SetLiquidityProtectionParams(ctx, types.GetDefaultLiquidityProtectionParams()) - k.SetLiquidityProtectionRateParams(ctx, types.LiquidityProtectionRateParams{ - CurrentRowanLiquidityThreshold: types.GetDefaultLiquidityProtectionParams().MaxRowanLiquidityThreshold, - }) - wl := make([]sdk.AccAddress, len(data.AddressWhitelist)) - if data.AddressWhitelist != nil { - for i, entry := range data.AddressWhitelist { - wlAddress, err := sdk.AccAddressFromBech32(entry) - if err != nil { - panic(err) - } - wl[i] = wlAddress + for i, entry := range data.AddressWhitelist { + wlAddress, err := sdk.AccAddressFromBech32(entry) + if err != nil { + panic(err) } - k.SetClpWhiteList(ctx, wl) + wl[i] = wlAddress } k.SetClpWhiteList(ctx, wl) + + // Set all the pools for _, pool := range data.PoolList { err := k.SetPool(ctx, pool) if err != nil { panic(fmt.Sprintf("Pool could not be set : %s", pool.String())) } } + + // Set all the liquidity providers for _, lp := range data.LiquidityProviders { k.SetLiquidityProvider(ctx, lp) } + // Set all the rewardsBucket for _, elem := range data.RewardsBucketList { k.SetRewardsBucket(ctx, elem) } + + // Set initial reward states + k.SetRewardParams(ctx, &data.RewardParams) + + // Set initial pmtp states + k.SetPmtpRateParams(ctx, data.PmtpRateParams) + k.SetPmtpEpoch(ctx, data.PmtpEpoch) + k.SetPmtpParams(ctx, &data.PmtpParams) + k.SetPmtpRateParams(ctx, data.PmtpRateParams) + + // Set initial liquidity protection states + k.SetLiquidityProtectionParams(ctx, &data.LiquidityProtectionParams) + k.SetLiquidityProtectionRateParams(ctx, data.LiquidityProtectionRateParams) + + // Set initial swap fee states + k.SetSwapFeeParams(ctx, &data.SwapFeeParams) + + // Set initial provider distribution states + k.SetProviderDistributionParams(ctx, &data.ProviderDistributionParams) + return []abci.ValidatorUpdate{} } func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) types.GenesisState { + // Retrieve CLP parameters params := keeper.GetParams(ctx) + + // Retrieve all the pools var poolList []*types.Pool poolList, _, _ = keeper.GetPoolsPaginated(ctx, &query.PageRequest{ Limit: uint64(math.MaxUint64), }) + + // Retrieve all the liquidity providers liquidityProviders, _, _ := keeper.GetAllLiquidityProvidersPaginated(ctx, &query.PageRequest{ Limit: uint64(math.MaxUint64), }) + + // Retrieve all the whitelist addresses whiteList := keeper.GetClpWhiteList(ctx) wl := make([]string, len(whiteList)) for i, entry := range whiteList { wl[i] = entry.String() } + + // Retrieve all the rewardsBucket rewardsBucketList := keeper.GetAllRewardsBucket(ctx) + + // Retrieve all the reward states + rewardParams := keeper.GetRewardsParams(ctx) + if rewardParams == nil { + rewardParams = types.GetDefaultRewardParams() + } + + // Retrieve all the pmtp states + pmtpParams := keeper.GetPmtpParams(ctx) + if pmtpParams == nil { + pmtpParams = types.GetDefaultPmtpParams() + } + pmtpEpoch := keeper.GetPmtpEpoch(ctx) + pmtpRateParams := keeper.GetPmtpRateParams(ctx) + + // Retrieve all the liquidity protection states + liquidityProtectionParams := keeper.GetLiquidityProtectionParams(ctx) + if liquidityProtectionParams == nil { + liquidityProtectionParams = types.GetDefaultLiquidityProtectionParams() + } + liquidityProtectionRateParams := keeper.GetLiquidityProtectionRateParams(ctx) + + // Retrieve all the swap fee states + swapFeeParams := keeper.GetSwapFeeParams(ctx) + + // Retrieve all the provider distribution states + providerDistributionParams := keeper.GetProviderDistributionParams(ctx) + if providerDistributionParams == nil { + providerDistributionParams = types.GetDefaultProviderDistributionParams() + } + return types.GenesisState{ - Params: params, - AddressWhitelist: wl, - PoolList: poolList, - LiquidityProviders: liquidityProviders, - RewardsBucketList: rewardsBucketList, + Params: params, + AddressWhitelist: wl, + PoolList: poolList, + LiquidityProviders: liquidityProviders, + RewardsBucketList: rewardsBucketList, + RewardParams: *rewardParams, + PmtpParams: *pmtpParams, + PmtpEpoch: pmtpEpoch, + PmtpRateParams: pmtpRateParams, + LiquidityProtectionParams: *liquidityProtectionParams, + LiquidityProtectionRateParams: liquidityProtectionRateParams, + SwapFeeParams: swapFeeParams, + ProviderDistributionParams: *providerDistributionParams, } } diff --git a/x/clp/keeper/epoch_hooks.go b/x/clp/keeper/epoch_hooks.go index e1a8023511..47e4d7db55 100644 --- a/x/clp/keeper/epoch_hooks.go +++ b/x/clp/keeper/epoch_hooks.go @@ -1,6 +1,8 @@ package keeper import ( + "fmt" + "github.com/Sifchain/sifnode/x/clp/types" epochstypes "github.com/Sifchain/sifnode/x/epochs/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,10 +27,11 @@ func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64) // get reward bucket for given asset rewardsBucket, found := k.GetRewardsBucket(ctx, asset.Symbol) if !found { - ctx.Logger().Error(types.ErrRewardsBucketNotFound.Error(), "asset", asset.Symbol) continue } + k.Logger(ctx).Info(fmt.Sprintf("rewards bucket not found for denom: %s", asset.Symbol)) + rewardShares := k.CalculateRewardShareForLiquidityProviders(ctx, assetLps) rewardAmounts := k.CalculateRewardAmountForLiquidityProviders(ctx, rewardShares, rewardsBucket.Amount) diff --git a/x/clp/types/genesis.pb.go b/x/clp/types/genesis.pb.go index e7b44ebebd..8b7cf7995b 100644 --- a/x/clp/types/genesis.pb.go +++ b/x/clp/types/genesis.pb.go @@ -24,14 +24,20 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState - all clp state that must be provided at genesis -// TODO: Add parameters to Genesis state ,such as minimum liquidity required to -// create a pool type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - AddressWhitelist []string `protobuf:"bytes,2,rep,name=address_whitelist,json=addressWhitelist,proto3" json:"address_whitelist,omitempty"` - PoolList []*Pool `protobuf:"bytes,3,rep,name=pool_list,json=poolList,proto3" json:"pool_list,omitempty"` - LiquidityProviders []*LiquidityProvider `protobuf:"bytes,4,rep,name=liquidity_providers,json=liquidityProviders,proto3" json:"liquidity_providers,omitempty"` - RewardsBucketList []RewardsBucket `protobuf:"bytes,5,rep,name=rewards_bucket_list,json=rewardsBucketList,proto3" json:"rewards_bucket_list"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + AddressWhitelist []string `protobuf:"bytes,2,rep,name=address_whitelist,json=addressWhitelist,proto3" json:"address_whitelist,omitempty"` + PoolList []*Pool `protobuf:"bytes,3,rep,name=pool_list,json=poolList,proto3" json:"pool_list,omitempty"` + LiquidityProviders []*LiquidityProvider `protobuf:"bytes,4,rep,name=liquidity_providers,json=liquidityProviders,proto3" json:"liquidity_providers,omitempty"` + RewardsBucketList []RewardsBucket `protobuf:"bytes,5,rep,name=rewards_bucket_list,json=rewardsBucketList,proto3" json:"rewards_bucket_list"` + RewardParams RewardParams `protobuf:"bytes,6,opt,name=reward_params,json=rewardParams,proto3" json:"reward_params"` + PmtpParams PmtpParams `protobuf:"bytes,7,opt,name=pmtp_params,json=pmtpParams,proto3" json:"pmtp_params"` + PmtpEpoch PmtpEpoch `protobuf:"bytes,8,opt,name=pmtp_epoch,json=pmtpEpoch,proto3" json:"pmtp_epoch"` + PmtpRateParams PmtpRateParams `protobuf:"bytes,9,opt,name=pmtp_rate_params,json=pmtpRateParams,proto3" json:"pmtp_rate_params"` + LiquidityProtectionParams LiquidityProtectionParams `protobuf:"bytes,10,opt,name=liquidity_protection_params,json=liquidityProtectionParams,proto3" json:"liquidity_protection_params"` + LiquidityProtectionRateParams LiquidityProtectionRateParams `protobuf:"bytes,11,opt,name=liquidity_protection_rate_params,json=liquidityProtectionRateParams,proto3" json:"liquidity_protection_rate_params"` + SwapFeeParams SwapFeeParams `protobuf:"bytes,12,opt,name=swap_fee_params,json=swapFeeParams,proto3" json:"swap_fee_params"` + ProviderDistributionParams ProviderDistributionParams `protobuf:"bytes,13,opt,name=provider_distribution_params,json=providerDistributionParams,proto3" json:"provider_distribution_params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -102,6 +108,62 @@ func (m *GenesisState) GetRewardsBucketList() []RewardsBucket { return nil } +func (m *GenesisState) GetRewardParams() RewardParams { + if m != nil { + return m.RewardParams + } + return RewardParams{} +} + +func (m *GenesisState) GetPmtpParams() PmtpParams { + if m != nil { + return m.PmtpParams + } + return PmtpParams{} +} + +func (m *GenesisState) GetPmtpEpoch() PmtpEpoch { + if m != nil { + return m.PmtpEpoch + } + return PmtpEpoch{} +} + +func (m *GenesisState) GetPmtpRateParams() PmtpRateParams { + if m != nil { + return m.PmtpRateParams + } + return PmtpRateParams{} +} + +func (m *GenesisState) GetLiquidityProtectionParams() LiquidityProtectionParams { + if m != nil { + return m.LiquidityProtectionParams + } + return LiquidityProtectionParams{} +} + +func (m *GenesisState) GetLiquidityProtectionRateParams() LiquidityProtectionRateParams { + if m != nil { + return m.LiquidityProtectionRateParams + } + return LiquidityProtectionRateParams{} +} + +func (m *GenesisState) GetSwapFeeParams() SwapFeeParams { + if m != nil { + return m.SwapFeeParams + } + return SwapFeeParams{} +} + +func (m *GenesisState) GetProviderDistributionParams() ProviderDistributionParams { + if m != nil { + return m.ProviderDistributionParams + } + return ProviderDistributionParams{} +} + func init() { proto.RegisterType((*GenesisState)(nil), "sifnode.clp.v1.GenesisState") } @@ -109,29 +171,42 @@ func init() { func init() { proto.RegisterFile("sifnode/clp/v1/genesis.proto", fileDescriptor_cd711ee3eda6f54c) } var fileDescriptor_cd711ee3eda6f54c = []byte{ - // 352 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0xc1, 0x4e, 0xc2, 0x30, - 0x1c, 0xc6, 0x37, 0x40, 0x22, 0xc5, 0x18, 0x19, 0xc4, 0x90, 0xa9, 0x13, 0xf5, 0x20, 0x89, 0xc9, - 0x16, 0xd0, 0x17, 0x90, 0x8b, 0x17, 0x0e, 0x64, 0x1c, 0x4c, 0xbc, 0x2c, 0x63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 0xff, 0x30, 0xc5, 0xfa, 0xe9, 0x8a, 0x0f, 0xea, 0x18, 0xbd, 0xcd, 0x51, 0x8c, 0xc4, - 0x2a, 0xa0, 0x8c, 0x2c, 0x50, 0x0c, 0x19, 0x6f, 0x96, 0xe4, 0xf2, 0x95, 0xbe, 0xdc, 0xcf, 0xd1, - 0x81, 0x22, 0x7d, 0x0b, 0xeb, 0x23, 0x6e, 0x0d, 0x41, 0x7d, 0xff, 0x49, 0xb2, 0x40, 0x07, 0xd2, - 0xf3, 0x42, 0xf7, 0xf4, 0x33, 0xb4, 0x27, 0x49, 0xf5, 0xf7, 0x35, 0xf6, 0x77, 0x98, 0x06, 0xed, - 0x3d, 0xae, 0xb7, 0x8e, 0xb9, 0xd9, 0x3a, 0xe6, 0xcf, 0xd6, 0x31, 0x3f, 0x76, 0x8e, 0xb1, 0xd9, - 0x39, 0xc6, 0xd7, 0xce, 0x31, 0x5e, 0x6e, 0x13, 0x24, 0x26, 0xf3, 0x91, 0x1b, 0x91, 0xa9, 0x37, - 0x44, 0xe3, 0x68, 0x12, 0xa2, 0x99, 0x97, 0x57, 0xf4, 0x2e, 0x4b, 0x92, 0xed, 0x8d, 0xca, 0xb2, - 0x99, 0xfb, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x8b, 0xb2, 0x95, 0x3d, 0x02, 0x00, 0x00, + // 552 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x41, 0x6f, 0x12, 0x4f, + 0x18, 0xc6, 0xe1, 0x4f, 0xff, 0x08, 0x03, 0xd4, 0x76, 0xda, 0x18, 0xba, 0xa5, 0x2b, 0xea, 0x41, + 0xd4, 0xb8, 0x1b, 0xaa, 0x67, 0x93, 0x36, 0x6a, 0x0f, 0x36, 0xa6, 0x59, 0x0e, 0x26, 0x5e, 0x36, + 0xcb, 0xee, 0x00, 0x13, 0x17, 0x66,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d, 0x52, 0x5f, 0xfe, 0x43, 0xea, 0xda, 0xf9, 0x8e, 0xe2, 0xbb, 0x4c, 0xf8, 0x03, + 0xba, 0x2f, 0xe7, 0x01, 0xf7, 0x07, 0xe4, 0x26, 0xac, 0x0e, 0x61, 0x6b, 0xdf, 0x56, 0x6f, 0x1e, + 0xf0, 0xf7, 0xc4, 0x84, 0x37, 0x64, 0x56, 0xc4, 0x02, 0xb5, 0xd2, 0xcf, 0xde, 0x8f, 0xa8, 0x54, + 0x82, 0xf6, 0xa7, 0xd9, 0xe5, 0x35, 0x80, 0xfc, 0x7c, 0xed, 0x5e, 0x74, 0xcf, 0xdb, 0x4c, 0x8b, + 0x11, 0x63, 0xf1, 0xdb, 0x1d, 0x27, 0x57, 0x0b, 0xbb, 0x78, 0xbd, 0xb0, 0x8b, 0x7f, 0x16, 0x76, + 0xf1, 0xc7, 0xd2, 0x2e, 0x5c, 0x2f, 0xed, 0xc2, 0xaf, 0xa5, 0x5d, 0xf8, 0xfc, 0x74, 0x48, 0xd5, + 0x68, 0xda, 0x77, 0x42, 0x36, 0x76, 0x7b, 0x74, 0x10, 0x8e, 0x02, 0x3a, 0x71, 0xd3, 0xe7, 0xe6, + 0x1b, 0x3c, 0x38, 0xf0, 0x12, 0xf5, 0xcb, 0xf0, 0xca, 0xbc, 0xfa, 0x1b, 0x00, 0x00, 0xff, 0xff, + 0x8a, 0xf7, 0x4e, 0x3e, 0x09, 0x05, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -154,6 +229,86 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.ProviderDistributionParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + { + size, err := m.SwapFeeParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + { + size, err := m.LiquidityProtectionRateParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + { + size, err := m.LiquidityProtectionParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + { + size, err := m.PmtpRateParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + { + size, err := m.PmtpEpoch.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + { + size, err := m.PmtpParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size, err := m.RewardParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 if len(m.RewardsBucketList) > 0 { for iNdEx := len(m.RewardsBucketList) - 1; iNdEx >= 0; iNdEx-- { { @@ -261,6 +416,22 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + l = m.RewardParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.PmtpParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.PmtpEpoch.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.PmtpRateParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.LiquidityProtectionParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.LiquidityProtectionRateParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.SwapFeeParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.ProviderDistributionParams.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -466,6 +637,270 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardParams", 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.RewardParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PmtpParams", 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.PmtpParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PmtpEpoch", 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.PmtpEpoch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PmtpRateParams", 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.PmtpRateParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidityProtectionParams", 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.LiquidityProtectionParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidityProtectionRateParams", 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.LiquidityProtectionRateParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SwapFeeParams", 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.SwapFeeParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProviderDistributionParams", 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.ProviderDistributionParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/clp/types/keys.go b/x/clp/types/keys.go index f1df3e3b16..a9d92e85d3 100644 --- a/x/clp/types/keys.go +++ b/x/clp/types/keys.go @@ -99,6 +99,12 @@ func GetDefaultLiquidityProtectionParams() *LiquidityProtectionParams { } } +func GetDefaultProviderDistributionParams() *ProviderDistributionParams { + return &ProviderDistributionParams{ + DistributionPeriods: nil, + } +} + // GetRemovalRequestKey generates a key to store a removal request, // the key is in the format: lpaddress_id func GetRemovalRequestKey(request RemovalRequest) []byte { diff --git a/x/ethbridge/genesis.go b/x/ethbridge/genesis.go index e37b87da96..37bd32632d 100644 --- a/x/ethbridge/genesis.go +++ b/x/ethbridge/genesis.go @@ -29,16 +29,35 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data types.GenesisState) } } + // Set blacklisted addresses + for _, address := range data.Blacklist { + keeper.SetBlacklistAddress(ctx, address) + } + + // Set pause + if data.Pause != nil { + keeper.SetPause(ctx, data.Pause) + } else { + keeper.SetPause(ctx, &types.Pause{IsPaused: false}) + } + return []abci.ValidatorUpdate{} } func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { peggyTokens := keeper.GetPeggyToken(ctx) receiveAccount := keeper.GetCethReceiverAccount(ctx) + blacklist := keeper.GetBlacklist(ctx) + isPaused := keeper.IsPaused(ctx) + + // create pause + pause := types.Pause{IsPaused: isPaused} return &types.GenesisState{ PeggyTokens: peggyTokens.Tokens, CethReceiveAccount: receiveAccount.String(), + Blacklist: blacklist, + Pause: &pause, } } diff --git a/x/ethbridge/keeper/blacklist.go b/x/ethbridge/keeper/blacklist.go index bc56f7847f..84981880c4 100644 --- a/x/ethbridge/keeper/blacklist.go +++ b/x/ethbridge/keeper/blacklist.go @@ -23,7 +23,6 @@ func (k Keeper) SetBlacklist(ctx sdk.Context, msg *types.MsgSetBlacklist) error return oracletypes.ErrNotAdminAccount } - store := ctx.KVStore(k.storeKey) // Process removals var removals []string iter := k.getStoreIterator(ctx) @@ -49,15 +48,27 @@ func (k Keeper) SetBlacklist(ctx sdk.Context, msg *types.MsgSetBlacklist) error } for _, address := range removals { - store.Delete(append(types.BlacklistPrefix, []byte(address)...)) + k.DeleteBlacklistAddress(ctx, address) } for _, address := range msg.Addresses { - store.Set(append(types.BlacklistPrefix, []byte(address)...), []byte(address)) + k.SetBlacklistAddress(ctx, address) } return nil } +func (k Keeper) SetBlacklistAddress(ctx sdk.Context, address string) error { + store := ctx.KVStore(k.storeKey) + store.Set(append(types.BlacklistPrefix, []byte(address)...), []byte(address)) + return nil +} + +func (k Keeper) DeleteBlacklistAddress(ctx sdk.Context, address string) error { + store := ctx.KVStore(k.storeKey) + store.Delete(append(types.BlacklistPrefix, []byte(address)...)) + return nil +} + func (k Keeper) GetBlacklist(ctx sdk.Context) []string { var addresses []string iter := k.getStoreIterator(ctx) diff --git a/x/ethbridge/types/genesis.pb.go b/x/ethbridge/types/genesis.pb.go new file mode 100644 index 0000000000..114b639faf --- /dev/null +++ b/x/ethbridge/types/genesis.pb.go @@ -0,0 +1,496 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sifnode/ethbridge/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 for ethbridge +type GenesisState struct { + CethReceiveAccount string `protobuf:"bytes,1,opt,name=ceth_receive_account,json=cethReceiveAccount,proto3" json:"ceth_receive_account,omitempty"` + PeggyTokens []string `protobuf:"bytes,2,rep,name=peggy_tokens,json=peggyTokens,proto3" json:"peggy_tokens,omitempty"` + Blacklist []string `protobuf:"bytes,3,rep,name=blacklist,proto3" json:"blacklist,omitempty"` + Pause *Pause `protobuf:"bytes,4,opt,name=pause,proto3" json:"pause,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_b1cb9b4ca03abfa3, []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) GetCethReceiveAccount() string { + if m != nil { + return m.CethReceiveAccount + } + return "" +} + +func (m *GenesisState) GetPeggyTokens() []string { + if m != nil { + return m.PeggyTokens + } + return nil +} + +func (m *GenesisState) GetBlacklist() []string { + if m != nil { + return m.Blacklist + } + return nil +} + +func (m *GenesisState) GetPause() *Pause { + if m != nil { + return m.Pause + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "sifnode.ethbridge.v1.GenesisState") +} + +func init() { + proto.RegisterFile("sifnode/ethbridge/v1/genesis.proto", fileDescriptor_b1cb9b4ca03abfa3) +} + +var fileDescriptor_b1cb9b4ca03abfa3 = []byte{ + // 280 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xbd, 0x4e, 0xc3, 0x30, + 0x14, 0x85, 0x6b, 0x0a, 0x48, 0x75, 0x3b, 0x59, 0x1d, 0xa2, 0x82, 0xac, 0xd0, 0x29, 0x0b, 0x36, + 0x81, 0x27, 0x80, 0xa5, 0x2b, 0x4a, 0x99, 0x58, 0xa2, 0xc4, 0xbd, 0x75, 0xac, 0x96, 0x38, 0x8a, + 0x9d, 0x88, 0xbe, 0x05, 0x0f, 0xc3, 0x43, 0x30, 0x76, 0x64, 0x44, 0xc9, 0x8b, 0xa0, 0x38, 0xe5, + 0x67, 0xe8, 0x76, 0x75, 0xce, 0xa7, 0x23, 0xdd, 0x0f, 0xcf, 0x8d, 0x5a, 0xe7, 0x7a, 0x05, 0x1c, + 0x6c, 0x96, 0x96, 0x6a, 0x25, 0x81, 0xd7, 0x21, 0x97, 0x90, 0x83, 0x51, 0x86, 0x15, 0xa5, 0xb6, + 0x9a, 0x4c, 0x0f, 0x0c, 0xfb, 0x65, 0x58, 0x1d, 0xce, 0xa6, 0x52, 0x4b, 0xed, 0x00, 0xde, 0x5d, + 0x3d, 0x3b, 0xf3, 0x8f, 0xee, 0xd9, 0x5d, 0x01, 0x87, 0xb5, 0xf9, 0x3b, 0xc2, 0x93, 0x45, 0xbf, + 0xbf, 0xb4, 0x89, 0x05, 0x72, 0x83, 0xa7, 0x02, 0x6c, 0x16, 0x97, 0x20, 0x40, 0xd5, 0x10, 0x27, + 0x42, 0xe8, 0x2a, 0xb7, 0x1e, 0xf2, 0x51, 0x30, 0x8a, 0x48, 0xd7, 0x45, 0x7d, 0x75, 0xdf, 0x37, + 0xe4, 0x0a, 0x4f, 0x0a, 0x90, 0x72, 0x17, 0x5b, 0xbd, 0x81, 0xdc, 0x78, 0x27, 0xfe, 0x30, 0x18, + 0x45, 0x63, 0x97, 0x3d, 0xb9, 0x88, 0x5c, 0xe2, 0x51, 0xba, 0x4d, 0xc4, 0x66, 0xab, 0x8c, 0xf5, + 0x86, 0xae, 0xff, 0x0b, 0x48, 0x88, 0xcf, 0x8a, 0xa4, 0x32, 0xe0, 0x9d, 0xfa, 0x28, 0x18, 0xdf, + 0x5e, 0xb0, 0x63, 0x1f, 0xb2, 0xc7, 0x0e, 0x89, 0x7a, 0xf2, 0x61, 0xf1, 0xd1, 0x50, 0xb4, 0x6f, + 0x28, 0xfa, 0x6a, 0x28, 0x7a, 0x6b, 0xe9, 0x60, 0xdf, 0xd2, 0xc1, 0x67, 0x4b, 0x07, 0xcf, 0xd7, + 0x52, 0xd9, 0xac, 0x4a, 0x99, 0xd0, 0x2f, 0x7c, 0xa9, 0xd6, 0x22, 0x4b, 0x54, 0xce, 0x7f, 0x34, + 0xbc, 0xfe, 0x13, 0xe1, 0x2c, 0xa4, 0xe7, 0x4e, 0xc3, 0xdd, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xf1, 0x24, 0xad, 0xfe, 0x7a, 0x01, 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 m.Pause != nil { + { + size, err := m.Pause.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Blacklist) > 0 { + for iNdEx := len(m.Blacklist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Blacklist[iNdEx]) + copy(dAtA[i:], m.Blacklist[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Blacklist[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.PeggyTokens) > 0 { + for iNdEx := len(m.PeggyTokens) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PeggyTokens[iNdEx]) + copy(dAtA[i:], m.PeggyTokens[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.PeggyTokens[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.CethReceiveAccount) > 0 { + i -= len(m.CethReceiveAccount) + copy(dAtA[i:], m.CethReceiveAccount) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.CethReceiveAccount))) + i-- + dAtA[i] = 0xa + } + 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 + l = len(m.CethReceiveAccount) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.PeggyTokens) > 0 { + for _, s := range m.PeggyTokens { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Blacklist) > 0 { + for _, s := range m.Blacklist { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.Pause != nil { + l = m.Pause.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + 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 CethReceiveAccount", 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.CethReceiveAccount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeggyTokens", 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.PeggyTokens = append(m.PeggyTokens, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blacklist", 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.Blacklist = append(m.Blacklist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pause", 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.Pause == nil { + m.Pause = &Pause{} + } + if err := m.Pause.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 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/ethbridge/types/types.pb.go b/x/ethbridge/types/types.pb.go index 85295cd97f..10b88751c3 100644 --- a/x/ethbridge/types/types.pb.go +++ b/x/ethbridge/types/types.pb.go @@ -216,59 +216,6 @@ func (m *PeggyTokens) GetTokens() []string { return nil } -// GenesisState for ethbridge -type GenesisState struct { - CethReceiveAccount string `protobuf:"bytes,1,opt,name=ceth_receive_account,json=cethReceiveAccount,proto3" json:"ceth_receive_account,omitempty"` - PeggyTokens []string `protobuf:"bytes,2,rep,name=peggy_tokens,json=peggyTokens,proto3" json:"peggy_tokens,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_4cb34f678c9ed59f, []int{2} -} -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) GetCethReceiveAccount() string { - if m != nil { - return m.CethReceiveAccount - } - return "" -} - -func (m *GenesisState) GetPeggyTokens() []string { - if m != nil { - return m.PeggyTokens - } - return nil -} - type Pause struct { IsPaused bool `protobuf:"varint,1,opt,name=is_paused,json=isPaused,proto3" json:"is_paused,omitempty"` } @@ -277,7 +224,7 @@ func (m *Pause) Reset() { *m = Pause{} } func (m *Pause) String() string { return proto.CompactTextString(m) } func (*Pause) ProtoMessage() {} func (*Pause) Descriptor() ([]byte, []int) { - return fileDescriptor_4cb34f678c9ed59f, []int{3} + return fileDescriptor_4cb34f678c9ed59f, []int{2} } func (m *Pause) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -317,55 +264,51 @@ func init() { proto.RegisterEnum("sifnode.ethbridge.v1.ClaimType", ClaimType_name, ClaimType_value) proto.RegisterType((*EthBridgeClaim)(nil), "sifnode.ethbridge.v1.EthBridgeClaim") proto.RegisterType((*PeggyTokens)(nil), "sifnode.ethbridge.v1.PeggyTokens") - proto.RegisterType((*GenesisState)(nil), "sifnode.ethbridge.v1.GenesisState") proto.RegisterType((*Pause)(nil), "sifnode.ethbridge.v1.Pause") } func init() { proto.RegisterFile("sifnode/ethbridge/v1/types.proto", fileDescriptor_4cb34f678c9ed59f) } var fileDescriptor_4cb34f678c9ed59f = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x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x35, 0x9c, 0xe3, 0xc3, 0x76, 0xab, 0x61, 0x37, - 0x3f, 0x35, 0x1b, 0x1f, 0x0b, 0x19, 0xf8, 0x10, 0xac, 0xcf, 0x71, 0xf5, 0x63, 0x7c, 0x58, 0xd0, - 0x16, 0xc0, 0x83, 0x6f, 0xf6, 0x97, 0xc2, 0x52, 0x7d, 0xff, 0xe2, 0xca, 0xd4, 0x2e, 0xaf, 0x4c, - 0xed, 0xef, 0x95, 0xa9, 0xfd, 0xba, 0x36, 0x33, 0x97, 0xd7, 0x66, 0xe6, 0xf7, 0xb5, 0x99, 0x39, - 0xdd, 0x99, 0xeb, 0x4f, 0xdb, 0x3f, 0x93, 0xd7, 0xb7, 0x36, 0x7d, 0x53, 0x7e, 0xce, 0xbd, 0x2a, - 0xb2, 0x55, 0x9d, 0x9c, 0x7c, 0x27, 0xde, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xb2, 0xce, - 0x21, 0x77, 0x04, 0x00, 0x00, + // 594 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x4f, 0x6f, 0xd3, 0x30, + 0x18, 0xc6, 0x9b, 0x8d, 0x96, 0xd5, 0x40, 0xd7, 0x99, 0x51, 0xa2, 0x01, 0x49, 0xb1, 0x60, 0x2a, + 0x48, 0x4b, 0x34, 0xb8, 0x71, 0x00, 0xad, 0xa1, 0x40, 0xc4, 0x18, 0xc5, 0xdb, 0x34, 0xb1, 0x4b, + 0x94, 0x26, 0x5e, 0x1a, 0xad, 0x89, 0xab, 0xd8, 0xad, 0xe8, 0xb7, 0xe0, 0x63, 0xed, 0xb8, 0x23, + 0xe2, 0x10, 0xa1, 0xed, 0x1b, 0xe4, 0x13, 0xa0, 0xd8, 0x69, 0xa9, 0xda, 0x71, 0xaa, 0xfb, 0xbc, + 0x3f, 0x3f, 0xaf, 0xf3, 0xfe, 0x01, 0x4d, 0x16, 0x9e, 0xc5, 0xd4, 0x27, 0x26, 0xe1, 0xfd, 0x5e, + 0x12, 0xfa, 0x01, 0x31, 0xc7, 0xbb, 0x26, 0x9f, 0x0c, 0x09, 0x33, 0x86, 0x09, 0xe5, 0x14, 0x6e, + 0x16, 0x84, 0x31, 0x23, 0x8c, 0xf1, 0xee, 0xd6, 0x66, 0x40, 0x03, 0x2a, 0x00, 0x33, 0x3f, 0x49, + 0x16, 0x5d, 0x96, 0x41, 0xad, 0xc3, 0xfb, 0x6d, 0x81, 0x59, 0x03, 0x37, 0x8c, 0xe0, 0x27, 0xb0, + 0x41, 0x78, 0x9f, 0x24, 0x64, 0x14, 0x39, 0x5e, 0xdf, 0x0d, 0x63, 0x27, 0xf4, 0x55, 0xa5, 0xa9, + 0xb4, 0x56, 0xdb, 0x8f, 0xb3, 0x54, 0x57, 0x27, 0x6e, 0x34, 0x78, 0x83, 0x96, 0x10, 0x84, 0xd7, + 0xa7, 0x9a, 0x95, 0x4b, 0xb6, 0x0f, 0x4f, 0xc1, 0x43, 0x99, 0xdf, 0xf1, 0x68, 0xcc, 0x13, 0xd7, + 0xe3, 0x8e, 0xeb, 0xfb, 0x09, 0x61, 0x4c, 0x5d, 0x69, 0x2a, 0xad, 0x6a, 0x1b, 0x65, 0xa9, 0xae, + 0x49, 0xbf, 0xff, 0x80, 0x08, 0x3f, 0x90, 0x11, 0xab, 0x08, 0xec, 0x49, 0x1d, 0x6e, 0x83, 0x72, + 0x4c, 0x63, 0x8f, 0xa8, 0xab, 0xe2, 0x65, 0xf5, 0x2c, 0xd5, 0xef, 0x4a, 0x27, 0x21, 0x23, 0x2c, + 0xc3, 0xf0, 0x05, 0xa8, 0xb0, 0x49, 0xd4, 0xa3, 0x03, 0xf5, 0x96, 0x48, 0xb9, 0x91, 0xa5, 0xfa, + 0x3d, 0x09, 0x4a, 0x1d, 0xe1, 0x02, 0x80, 0x27, 0xa0, 0xc1, 0xe9, 0x39, 0x89, 0x97, 0x5f, 0x5b, + 0x16, 0x57, 0x9f, 0x66, 0xa9, 0xfe, 0x44, 0x5e, 0xbd, 0x99, 0x43, 0x78, 0x53, 0x04, 0x16, 0xdf, + 0x6a, 0x81, 0x59, 0x69, 0x1c, 0x46, 0x62, 0x9f, 0x24, 0x6a, 0x45, 0x38, 0x6e, 0x65, 0xa9, 0xde, + 0x58, 0xa8, 0xa7, 0x04, 0x10, 0xae, 0x4d, 0x95, 0x43, 0x21, 0xe4, 0x26, 0x1e, 0x65, 0x11, 0x65, + 0x4e, 0x42, 0x3c, 0x12, 0x8e, 0x49, 0xa2, 0xde, 0x5e, 0x34, 0x59, 0x00, 0x10, 0xae, 0x49, 0x05, + 0x17, 0x02, 0xb4, 0xc1, 0xc6, 0xd8, 0x1d, 0x84, 0xbe, 0xcb, 0x69, 0x32, 0xfb, 0xba, 0x35, 0x61, + 0x33, 0xd7, 0xdb, 0x25, 0x04, 0xe1, 0xfa, 0x4c, 0x9b, 0x7e, 0xd4, 0x09, 0xa8, 0xb8, 0x11, 0x1d, + 0xc5, 0x5c, 0xad, 0x8a, 0xfb, 0xef, 0x2e, 0x52, 0xbd, 0xf4, 0x3b, 0xd5, 0xb7, 0x83, 0x90, 0xf7, + 0x47, 0x3d, 0xc3, 0xa3, 0x91, 0x29, 0xb3, 0x17, 0x3f, 0x3b, 0xcc, 0x3f, 0x2f, 0xe6, 0xd4, 0x8e, + 0xf9, 0xbf, 0x36, 0x48, 0x17, 0x84, 0x0b, 0x3b, 0xf8, 0x16, 0x00, 0x2f, 0x1f, 0x44, 0x27, 0x67, + 0x55, 0xd0, 0x54, 0x5a, 0xb5, 0x57, 0xba, 0x71, 0xd3, 0x4c, 0x1b, 0x62, 0x60, 0x8f, 0x26, 0x43, + 0x82, 0xab, 0xde, 0xf4, 0x88, 0x9e, 0x83, 0x3b, 0x5d, 0x12, 0x04, 0x93, 0xa3, 0xbc, 0x15, 0x0c, + 0x36, 0x40, 0x45, 0x34, 0x85, 0xa9, 0x4a, 0x73, 0xb5, 0x55, 0xc5, 0xc5, 0x3f, 0xf4, 0x0c, 0x94, + 0xbb, 0xee, 0x88, 0x11, 0xf8, 0x08, 0x54, 0x43, 0xe6, 0x0c, 0xf3, 0xb3, 0x9c, 0xf3, 0x35, 0xbc, + 0x16, 0x32, 0x11, 0xf3, 0x5f, 0x7e, 0x03, 0xd5, 0x59, 0x12, 0xb8, 0x05, 0x1a, 0xd6, 0xfe, 0x9e, + 0xfd, 0xc5, 0x39, 0xfa, 0xde, 0xed, 0x38, 0xc7, 0x07, 0x87, 0xdd, 0x8e, 0x65, 0x7f, 0xb0, 0x3b, + 0xef, 0xeb, 0x25, 0x78, 0x1f, 0xac, 0xcf, 0xc5, 0xda, 0xc7, 0xf8, 0xa0, 0xae, 0x2c, 0x88, 0xfb, + 0x5f, 0xad, 0xcf, 0xf5, 0x95, 0xf6, 0xc7, 0x8b, 0x2b, 0x4d, 0xb9, 0xbc, 0xd2, 0x94, 0x3f, 0x57, + 0x9a, 0xf2, 0xf3, 0x5a, 0x2b, 0x5d, 0x5e, 0x6b, 0xa5, 0x5f, 0xd7, 0x5a, 0xe9, 0x74, 0x67, 0xae, + 0x74, 0x87, 0xe1, 0x99, 0xd8, 0x2c, 0x73, 0xba, 0xee, 0x3f, 0xe6, 0x16, 0x5e, 0x54, 0xb1, 0x57, + 0x11, 0x2b, 0xfc, 0xfa, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x27, 0xf5, 0xba, 0x12, 0x04, + 0x00, 0x00, } func (m *EthBridgeClaim) Marshal() (dAtA []byte, err error) { @@ -490,45 +433,6 @@ func (m *PeggyTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -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.PeggyTokens) > 0 { - for iNdEx := len(m.PeggyTokens) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PeggyTokens[iNdEx]) - copy(dAtA[i:], m.PeggyTokens[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.PeggyTokens[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.CethReceiveAccount) > 0 { - i -= len(m.CethReceiveAccount) - copy(dAtA[i:], m.CethReceiveAccount) - i = encodeVarintTypes(dAtA, i, uint64(len(m.CethReceiveAccount))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *Pause) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -632,25 +536,6 @@ func (m *PeggyTokens) Size() (n int) { return n } -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CethReceiveAccount) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.PeggyTokens) > 0 { - for _, s := range m.PeggyTokens { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - func (m *Pause) Size() (n int) { if m == nil { return 0 @@ -1084,120 +969,6 @@ func (m *PeggyTokens) Unmarshal(dAtA []byte) error { } return nil } -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 ErrIntOverflowTypes - } - 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 CethReceiveAccount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CethReceiveAccount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeggyTokens", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeggyTokens = append(m.PeggyTokens, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Pause) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/margin/keeper/genesis.go b/x/margin/keeper/genesis.go index 5da6ea7f35..9c9319f044 100644 --- a/x/margin/keeper/genesis.go +++ b/x/margin/keeper/genesis.go @@ -7,32 +7,29 @@ import ( ) func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) []abci.ValidatorUpdate { + // Set initial Margin parameters k.SetParams(ctx, data.Params) + // Set all the mtps + for _, mtp := range data.MtpList { + err := k.SetMTP(ctx, mtp) + if err != nil { + panic(err) + } + } + return []abci.ValidatorUpdate{} } func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { + // Retrieve the Margin parameters + params := k.GetParams(ctx) + + // Retrieve all the mtps + mtps := k.GetAllMTPS(ctx) + return &types.GenesisState{ - Params: &types.Params{ - LeverageMax: k.GetMaxLeverageParam(ctx), - InterestRateMax: k.GetInterestRateMax(ctx), - InterestRateMin: k.GetInterestRateMin(ctx), - InterestRateIncrease: k.GetInterestRateIncrease(ctx), - InterestRateDecrease: k.GetInterestRateDecrease(ctx), - HealthGainFactor: k.GetHealthGainFactor(ctx), - EpochLength: k.GetEpochLength(ctx), - ForceCloseFundPercentage: k.GetForceCloseFundPercentage(ctx), - ForceCloseFundAddress: k.GetForceCloseFundAddress(ctx).String(), - IncrementalInterestPaymentFundPercentage: k.GetIncrementalInterestPaymentFundPercentage(ctx), - IncrementalInterestPaymentFundAddress: k.GetIncrementalInterestPaymentFundAddress(ctx).String(), - PoolOpenThreshold: k.GetPoolOpenThreshold(ctx), - RemovalQueueThreshold: k.GetRemovalQueueThreshold(ctx), - MaxOpenPositions: k.GetMaxOpenPositions(ctx), - Pools: k.GetEnabledPools(ctx), - SqModifier: k.GetSqModifier(ctx), - SafetyFactor: k.GetSafetyFactor(ctx), - RowanCollateralEnabled: k.IsRowanCollateralEnabled(ctx), - }, + Params: ¶ms, + MtpList: mtps, } } diff --git a/x/margin/keeper/keeper.go b/x/margin/keeper/keeper.go index b4ea7e229a..13e48c4867 100644 --- a/x/margin/keeper/keeper.go +++ b/x/margin/keeper/keeper.go @@ -113,8 +113,8 @@ func (k Keeper) GetMTPIterator(ctx sdk.Context) sdk.Iterator { return sdk.KVStorePrefixIterator(store, types.MTPPrefix) } -func (k Keeper) GetAllMTPS(ctx sdk.Context) []types.MTP { - var mtpList []types.MTP +func (k Keeper) GetAllMTPS(ctx sdk.Context) []*types.MTP { + var mtpList []*types.MTP iterator := k.GetMTPIterator(ctx) defer func(iterator sdk.Iterator) { err := iterator.Close() @@ -127,7 +127,7 @@ func (k Keeper) GetAllMTPS(ctx sdk.Context) []types.MTP { var mtp types.MTP bytesValue := iterator.Value() k.cdc.MustUnmarshal(bytesValue, &mtp) - mtpList = append(mtpList, mtp) + mtpList = append(mtpList, &mtp) } return mtpList } diff --git a/x/margin/types/genesis.pb.go b/x/margin/types/genesis.pb.go new file mode 100644 index 0000000000..ab94eeaa8a --- /dev/null +++ b/x/margin/types/genesis.pb.go @@ -0,0 +1,391 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sifnode/margin/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 + +type GenesisState struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + MtpList []*MTP `protobuf:"bytes,2,rep,name=mtp_list,json=mtpList,proto3" json:"mtp_list,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_a69b9b183166494a, []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) GetMtpList() []*MTP { + if m != nil { + return m.MtpList + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "sifnode.margin.v1.GenesisState") +} + +func init() { proto.RegisterFile("sifnode/margin/v1/genesis.proto", fileDescriptor_a69b9b183166494a) } + +var fileDescriptor_a69b9b183166494a = []byte{ + // 234 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xce, 0x4c, 0xcb, + 0xcb, 0x4f, 0x49, 0xd5, 0xcf, 0x4d, 0x2c, 0x4a, 0xcf, 0xcc, 0xd3, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, + 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x2a, 0xd0, + 0x83, 0x28, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xcb, 0xea, 0x83, 0x58, + 0x10, 0x85, 0x52, 0x72, 0x98, 0x26, 0x15, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x0d, 0x92, 0x92, 0xc5, + 0x94, 0x2f, 0xa9, 0x2c, 0x48, 0x85, 0x4a, 0x2b, 0x95, 0x70, 0xf1, 0xb8, 0x43, 0x2c, 0x0e, 0x2e, + 0x49, 0x2c, 0x49, 0x15, 0x32, 0xe4, 0x62, 0x83, 0x68, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, + 0x92, 0xd4, 0xc3, 0x70, 0x88, 0x5e, 0x00, 0x58, 0x41, 0x10, 0x54, 0xa1, 0x90, 0x21, 0x17, 0x47, + 0x6e, 0x49, 0x41, 0x7c, 0x4e, 0x66, 0x71, 0x89, 0x04, 0x93, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0x18, + 0x16, 0x4d, 0xbe, 0x21, 0x01, 0x41, 0xec, 0xb9, 0x25, 0x05, 0x3e, 0x99, 0xc5, 0x25, 0x4e, 0x2e, + 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, + 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x95, 0x9e, 0x59, 0x92, 0x51, + 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x1f, 0x9c, 0x99, 0x96, 0x9c, 0x91, 0x98, 0x99, 0xa7, 0x0f, + 0xf3, 0x42, 0x05, 0xcc, 0x13, 0x60, 0x1f, 0x24, 0xb1, 0x81, 0xbd, 0x60, 0x0c, 0x08, 0x00, 0x00, + 0xff, 0xff, 0x3c, 0x7f, 0x34, 0x02, 0x4d, 0x01, 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.MtpList) > 0 { + for iNdEx := len(m.MtpList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MtpList[iNdEx].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 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)) + } + if len(m.MtpList) > 0 { + for _, e := range m.MtpList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + 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 MtpList", 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.MtpList = append(m.MtpList, &MTP{}) + if err := m.MtpList[len(m.MtpList)-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 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/margin/types/params.pb.go b/x/margin/types/params.pb.go new file mode 100644 index 0000000000..9510cbc28a --- /dev/null +++ b/x/margin/types/params.pb.go @@ -0,0 +1,1281 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sifnode/margin/v1/params.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_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 Params struct { + LeverageMax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=leverage_max,json=leverageMax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"leverage_max"` + InterestRateMax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=interest_rate_max,json=interestRateMax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_rate_max"` + InterestRateMin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=interest_rate_min,json=interestRateMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_rate_min"` + InterestRateIncrease github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=interest_rate_increase,json=interestRateIncrease,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_rate_increase"` + InterestRateDecrease github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=interest_rate_decrease,json=interestRateDecrease,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_rate_decrease"` + HealthGainFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=health_gain_factor,json=healthGainFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"health_gain_factor"` + EpochLength int64 `protobuf:"varint,7,opt,name=epoch_length,json=epochLength,proto3" json:"epoch_length,omitempty"` + Pools []string `protobuf:"bytes,8,rep,name=pools,proto3" json:"pools,omitempty"` + RemovalQueueThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=removal_queue_threshold,json=removalQueueThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"removal_queue_threshold"` + MaxOpenPositions uint64 `protobuf:"varint,11,opt,name=max_open_positions,json=maxOpenPositions,proto3" json:"max_open_positions,omitempty"` + PoolOpenThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=pool_open_threshold,json=poolOpenThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"pool_open_threshold"` + ForceCloseFundPercentage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=force_close_fund_percentage,json=forceCloseFundPercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"force_close_fund_percentage"` + ForceCloseFundAddress string `protobuf:"bytes,14,opt,name=force_close_fund_address,json=forceCloseFundAddress,proto3" json:"force_close_fund_address,omitempty"` + IncrementalInterestPaymentFundPercentage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,15,opt,name=incremental_interest_payment_fund_percentage,json=incrementalInterestPaymentFundPercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"incremental_interest_payment_fund_percentage"` + IncrementalInterestPaymentFundAddress string `protobuf:"bytes,16,opt,name=incremental_interest_payment_fund_address,json=incrementalInterestPaymentFundAddress,proto3" json:"incremental_interest_payment_fund_address,omitempty"` + SqModifier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,17,opt,name=sq_modifier,json=sqModifier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"sq_modifier"` + SafetyFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,18,opt,name=safety_factor,json=safetyFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"safety_factor"` + ClosedPools []string `protobuf:"bytes,19,rep,name=closed_pools,json=closedPools,proto3" json:"closed_pools,omitempty"` + IncrementalInterestPaymentEnabled bool `protobuf:"varint,20,opt,name=incremental_interest_payment_enabled,json=incrementalInterestPaymentEnabled,proto3" json:"incremental_interest_payment_enabled,omitempty"` + WhitelistingEnabled bool `protobuf:"varint,21,opt,name=whitelisting_enabled,json=whitelistingEnabled,proto3" json:"whitelisting_enabled,omitempty"` + RowanCollateralEnabled bool `protobuf:"varint,22,opt,name=rowan_collateral_enabled,json=rowanCollateralEnabled,proto3" json:"rowan_collateral_enabled,omitempty"` +} + +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_530135b2c1d7983d, []int{0} +} +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) GetEpochLength() int64 { + if m != nil { + return m.EpochLength + } + return 0 +} + +func (m *Params) GetPools() []string { + if m != nil { + return m.Pools + } + return nil +} + +func (m *Params) GetMaxOpenPositions() uint64 { + if m != nil { + return m.MaxOpenPositions + } + return 0 +} + +func (m *Params) GetForceCloseFundAddress() string { + if m != nil { + return m.ForceCloseFundAddress + } + return "" +} + +func (m *Params) GetIncrementalInterestPaymentFundAddress() string { + if m != nil { + return m.IncrementalInterestPaymentFundAddress + } + return "" +} + +func (m *Params) GetClosedPools() []string { + if m != nil { + return m.ClosedPools + } + return nil +} + +func (m *Params) GetIncrementalInterestPaymentEnabled() bool { + if m != nil { + return m.IncrementalInterestPaymentEnabled + } + return false +} + +func (m *Params) GetWhitelistingEnabled() bool { + if m != nil { + return m.WhitelistingEnabled + } + return false +} + +func (m *Params) GetRowanCollateralEnabled() bool { + if m != nil { + return m.RowanCollateralEnabled + } + return false +} + +func init() { + proto.RegisterType((*Params)(nil), "sifnode.margin.v1.Params") +} + +func init() { proto.RegisterFile("sifnode/margin/v1/params.proto", fileDescriptor_530135b2c1d7983d) } + +var fileDescriptor_530135b2c1d7983d = []byte{ + // 682 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0xc7, 0xbb, 0xf2, 0x43, 0x98, 0x16, 0xa1, 0x43, 0xc1, 0x8d, 0x26, 0xa5, 0x18, 0x35, 0xd5, + 0x60, 0x1b, 0xe2, 0x41, 0xaf, 0x02, 0x62, 0x48, 0x24, 0x94, 0xe2, 0xc1, 0x10, 0xe3, 0x64, 0xd8, + 0x7d, 0xbb, 0x3b, 0x71, 0x77, 0x66, 0x99, 0x99, 0x96, 0xf2, 0x0f, 0x78, 0x34, 0xfe, 0x59, 0x1c, + 0x39, 0x1a, 0x0f, 0xc4, 0xc0, 0x3f, 0x62, 0x76, 0x76, 0xb7, 0x14, 0x09, 0x98, 0xac, 0x9e, 0xda, + 0xbe, 0x37, 0xef, 0xf3, 0xfd, 0xbe, 0xd7, 0x79, 0x19, 0x54, 0x57, 0xcc, 0xe3, 0xc2, 0x85, 0x76, + 0x44, 0xa5, 0xcf, 0x78, 0xbb, 0xbf, 0xda, 0x8e, 0xa9, 0xa4, 0x91, 0x6a, 0xc5, 0x52, 0x68, 0x81, + 0xab, 0x59, 0xbe, 0x95, 0xe6, 0x5b, 0xfd, 0xd5, 0x07, 0x35, 0x5f, 0xf8, 0xc2, 0x64, 0xdb, 0xc9, + 0xb7, 0xf4, 0xe0, 0xa3, 0xaf, 0x33, 0x68, 0xb2, 0x63, 0x2a, 0xf1, 0x2e, 0xaa, 0x84, 0xd0, 0x07, + 0x49, 0x7d, 0x20, 0x11, 0x1d, 0xd8, 0x56, 0xc3, 0x6a, 0x4e, 0xaf, 0xb5, 0x4e, 0xce, 0x96, 0x4a, + 0x3f, 0xcf, 0x96, 0x9e, 0xfa, 0x4c, 0x07, 0xbd, 0x83, 0x96, 0x23, 0xa2, 0xb6, 0x23, 0x54, 0x24, + 0x54, 0xf6, 0xf1, 0x42, 0xb9, 0x5f, 0xda, 0xfa, 0x38, 0x06, 0xd5, 0xda, 0x00, 0xa7, 0x5b, 0xce, + 0x19, 0xdb, 0x74, 0x80, 0xf7, 0x51, 0x95, 0x71, 0x0d, 0x12, 0x94, 0x26, 0x92, 0xea, 0x94, 0x7b, + 0xa7, 0x10, 0x77, 0x36, 0x07, 0x75, 0xa9, 0xbe, 0x81, 0xcd, 0xb8, 0x3d, 0xf6, 0x1f, 0xd8, 0x8c, + 0x63, 0x17, 0x2d, 0x5e, 0x65, 0x33, 0xee, 0x48, 0xa0, 0x0a, 0xec, 0xf1, 0x42, 0x02, 0xb5, 0x51, + 0x81, 0xad, 0x8c, 0x75, 0x5d, 0xc5, 0x85, 0x4c, 0x65, 0xe2, 0xdf, 0x55, 0x36, 0x32, 0x16, 0xfe, + 0x84, 0x70, 0x00, 0x34, 0xd4, 0x01, 0xf1, 0x29, 0xe3, 0xc4, 0xa3, 0x8e, 0x16, 0xd2, 0x9e, 0x2c, + 0xa4, 0x30, 0x97, 0x92, 0xde, 0x51, 0xc6, 0x37, 0x0d, 0x07, 0x2f, 0xa3, 0x0a, 0xc4, 0xc2, 0x09, + 0x48, 0x08, 0xdc, 0xd7, 0x81, 0x7d, 0xb7, 0x61, 0x35, 0xc7, 0xba, 0x65, 0x13, 0x7b, 0x6f, 0x42, + 0xb8, 0x86, 0x26, 0x62, 0x21, 0x42, 0x65, 0x4f, 0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0x5b, 0x4c, 0x20, 0x07, 0x00, 0x00, +} + +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.RowanCollateralEnabled { + i-- + if m.RowanCollateralEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb0 + } + if m.WhitelistingEnabled { + i-- + if m.WhitelistingEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa8 + } + if m.IncrementalInterestPaymentEnabled { + i-- + if m.IncrementalInterestPaymentEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } + if len(m.ClosedPools) > 0 { + for iNdEx := len(m.ClosedPools) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ClosedPools[iNdEx]) + copy(dAtA[i:], m.ClosedPools[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.ClosedPools[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + } + { + size := m.SafetyFactor.Size() + i -= size + if _, err := m.SafetyFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + { + size := m.SqModifier.Size() + i -= size + if _, err := m.SqModifier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + if len(m.IncrementalInterestPaymentFundAddress) > 0 { + i -= len(m.IncrementalInterestPaymentFundAddress) + copy(dAtA[i:], m.IncrementalInterestPaymentFundAddress) + i = encodeVarintParams(dAtA, i, uint64(len(m.IncrementalInterestPaymentFundAddress))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + { + size := m.IncrementalInterestPaymentFundPercentage.Size() + i -= size + if _, err := m.IncrementalInterestPaymentFundPercentage.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + if len(m.ForceCloseFundAddress) > 0 { + i -= len(m.ForceCloseFundAddress) + copy(dAtA[i:], m.ForceCloseFundAddress) + i = encodeVarintParams(dAtA, i, uint64(len(m.ForceCloseFundAddress))) + i-- + dAtA[i] = 0x72 + } + { + size := m.ForceCloseFundPercentage.Size() + i -= size + if _, err := m.ForceCloseFundPercentage.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + { + size := m.PoolOpenThreshold.Size() + i -= size + if _, err := m.PoolOpenThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + if m.MaxOpenPositions != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxOpenPositions)) + i-- + dAtA[i] = 0x58 + } + { + size := m.RemovalQueueThreshold.Size() + i -= size + if _, err := m.RemovalQueueThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + if len(m.Pools) > 0 { + for iNdEx := len(m.Pools) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Pools[iNdEx]) + copy(dAtA[i:], m.Pools[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.Pools[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if m.EpochLength != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.EpochLength)) + i-- + dAtA[i] = 0x38 + } + { + size := m.HealthGainFactor.Size() + i -= size + if _, err := m.HealthGainFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size := m.InterestRateDecrease.Size() + i -= size + if _, err := m.InterestRateDecrease.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.InterestRateIncrease.Size() + i -= size + if _, err := m.InterestRateIncrease.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.InterestRateMin.Size() + i -= size + if _, err := m.InterestRateMin.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.InterestRateMax.Size() + i -= size + if _, err := m.InterestRateMax.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.LeverageMax.Size() + i -= size + if _, err := m.LeverageMax.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.LeverageMax.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.InterestRateMax.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.InterestRateMin.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.InterestRateIncrease.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.InterestRateDecrease.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.HealthGainFactor.Size() + n += 1 + l + sovParams(uint64(l)) + if m.EpochLength != 0 { + n += 1 + sovParams(uint64(m.EpochLength)) + } + if len(m.Pools) > 0 { + for _, s := range m.Pools { + l = len(s) + n += 1 + l + sovParams(uint64(l)) + } + } + l = m.RemovalQueueThreshold.Size() + n += 1 + l + sovParams(uint64(l)) + if m.MaxOpenPositions != 0 { + n += 1 + sovParams(uint64(m.MaxOpenPositions)) + } + l = m.PoolOpenThreshold.Size() + n += 1 + l + sovParams(uint64(l)) + l = m.ForceCloseFundPercentage.Size() + n += 1 + l + sovParams(uint64(l)) + l = len(m.ForceCloseFundAddress) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + l = m.IncrementalInterestPaymentFundPercentage.Size() + n += 1 + l + sovParams(uint64(l)) + l = len(m.IncrementalInterestPaymentFundAddress) + if l > 0 { + n += 2 + l + sovParams(uint64(l)) + } + l = m.SqModifier.Size() + n += 2 + l + sovParams(uint64(l)) + l = m.SafetyFactor.Size() + n += 2 + l + sovParams(uint64(l)) + if len(m.ClosedPools) > 0 { + for _, s := range m.ClosedPools { + l = len(s) + n += 2 + l + sovParams(uint64(l)) + } + } + if m.IncrementalInterestPaymentEnabled { + n += 3 + } + if m.WhitelistingEnabled { + n += 3 + } + if m.RowanCollateralEnabled { + n += 3 + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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 ErrIntOverflowParams + } + 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 != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LeverageMax", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LeverageMax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterestRateMax", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InterestRateMax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterestRateMin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InterestRateMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterestRateIncrease", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InterestRateIncrease.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterestRateDecrease", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InterestRateDecrease.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HealthGainFactor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.HealthGainFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochLength", wireType) + } + m.EpochLength = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochLength |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pools", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pools = append(m.Pools, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemovalQueueThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RemovalQueueThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxOpenPositions", wireType) + } + m.MaxOpenPositions = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxOpenPositions |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolOpenThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PoolOpenThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForceCloseFundPercentage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ForceCloseFundPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForceCloseFundAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ForceCloseFundAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncrementalInterestPaymentFundPercentage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.IncrementalInterestPaymentFundPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncrementalInterestPaymentFundAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IncrementalInterestPaymentFundAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SqModifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SqModifier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SafetyFactor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SafetyFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClosedPools", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClosedPools = append(m.ClosedPools, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncrementalInterestPaymentEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncrementalInterestPaymentEnabled = bool(v != 0) + case 21: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistingEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WhitelistingEnabled = bool(v != 0) + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RowanCollateralEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RowanCollateralEnabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/margin/types/query.pb.go b/x/margin/types/query.pb.go index 2b076f6a15..6e2534c6c1 100644 --- a/x/margin/types/query.pb.go +++ b/x/margin/types/query.pb.go @@ -902,66 +902,66 @@ func init() { func init() { proto.RegisterFile("sifnode/margin/v1/query.proto", fileDescriptor_73c14070fed1f663) } var fileDescriptor_73c14070fed1f663 = []byte{ - // 930 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x26, 0x69, 0xc0, 0xcf, 0x8d, 0x69, 0x86, 0x10, 0xc2, 0x92, 0xb8, 0x61, 0x49, 0x5a, - 0x63, 0xe1, 0xdd, 0x3a, 0x48, 0x41, 0x88, 0x03, 0x4a, 0x8a, 0x6a, 0xf5, 0x10, 0xc9, 0xdd, 0x54, - 0x02, 0xf5, 0x40, 0xb4, 0xb6, 0xc7, 0x9b, 0x51, 0xbd, 0x3b, 0x5b, 0xcf, 0xd8, 0xc5, 0x44, 0x45, - 0x88, 0x13, 0xa7, 0x8a, 0x1f, 0xff, 0x07, 0x7f, 0x00, 0x27, 0x8e, 0x1c, 0x2b, 0x71, 0xe1, 0x88, - 0x12, 0xfe, 0x10, 0xb4, 0x33, 0xb3, 0xf6, 0xae, 0x3d, 0xb6, 0xab, 0x2a, 0x52, 0x6f, 0xbb, 0x6f, - 0xbe, 0x79, 0xef, 0xfb, 0xde, 0xec, 0xfb, 0x66, 0x61, 0x9b, 0x91, 0x76, 0x48, 0x5b, 0xd8, 0x09, - 0xbc, 0xae, 0x4f, 0x42, 0xa7, 0x5f, 0x75, 0x9e, 0xf4, 0x70, 0x77, 0x60, 0x47, 0x5d, 0xca, 0x29, - 0x5a, 0x53, 0xcb, 0xb6, 0x5c, 0xb6, 0xfb, 0x55, 0x73, 0xdd, 0xa7, 0x3e, 0x15, 0xab, 0x4e, 0xfc, - 0x24, 0x81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f6, 0x5c, 0x4e, 0xb2, 0x50, 0x86, 0x54, 0x1f, - 0x36, 0x86, 0x9c, 0x8e, 0x06, 0x75, 0x4a, 0x3b, 0x49, 0x43, 0xd6, 0xe1, 0x9a, 0xc7, 0x18, 0xe6, - 0xaa, 0x1d, 0xf2, 0xe5, 0xca, 0x9a, 0xf1, 0xdc, 0x80, 0x77, 0x27, 0x0a, 0xbf, 0xce, 0x46, 0x3c, - 0x82, 0x1b, 0x43, 0x3e, 0x49, 0x0b, 0xb2, 0x62, 0x8d, 0x57, 0x16, 0xfb, 0x93, 0x01, 0x6b, 0xa9, - 0xe4, 0xaf, 0x53, 0xe6, 0x5b, 0xb0, 0x5a, 0xf7, 0xba, 0x5e, 0x90, 0x68, 0xb4, 0xee, 0x42, 0x21, - 0x09, 0x28, 0x5e, 0x55, 0x58, 0x89, 0x44, 0x44, 0x29, 0x7e, 0x4f, 0xc3, 0x4c, 0x6d, 0x51, 0xc0, - 0x38, 0xeb, 0x09, 0xf7, 0x78, 0x6f, 0x98, 0xb5, 0x05, 0x85, 0x24, 0xa0, 0xb2, 0xee, 0x42, 0x81, - 0x46, 0x38, 0x3c, 0x0d, 0x78, 0x74, 0xda, 0xa4, 0xbd, 0x50, 0x7e, 0x57, 0xcb, 0xee, 0xf5, 0x38, - 0x7a, 0xcc, 0xa3, 0xbb, 0x71, 0x0c, 0x7d, 0x0c, 0xa8, 0x43, 0xda, 0x98, 0x93, 0x00, 0xa7, 0x90, - 0x72, 0xf8, 0x6f, 0x24, 0x2b, 0x09, 0x3a, 0x3e, 0xb3, 0xaf, 0xce, 0x08, 0xc7, 0x1d, 0xc2, 0xf8, - 0x55, 0x9f, 0xd9, 0x77, 0xb0, 0x96, 0xca, 0xad, 0x44, 0x6c, 0x41, 0xee, 0x69, 0x12, 0x14, 0xe7, - 0x96, 0x73, 0x47, 0x81, 0xab, 0x3b, 0xa4, 0x12, 0xa0, 0x1a, 0xe6, 0x27, 0x0f, 0x32, 0x27, 0x85, - 0x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, 0x63, 0x83, 0xa9, 0xb4, 0x69, 0xb7, 0xa2, 0xce, 0xcd, 0x39, 0x57, - 0x0f, 0xcf, 0x26, 0x25, 0xfc, 0x6e, 0x88, 0x4f, 0x73, 0xcc, 0xb9, 0xd1, 0x47, 0xb3, 0xf8, 0x64, - 0xae, 0x15, 0xb3, 0xfc, 0x32, 0x50, 0x45, 0xfb, 0x50, 0xd0, 0xfe, 0x1c, 0x7d, 0x36, 0x95, 0x76, - 0x63, 0x50, 0x89, 0xe7, 0xc0, 0x39, 0x17, 0xb7, 0x93, 0x86, 0x30, 0x87, 0x5c, 0xcc, 0x57, 0x8c, - 0x07, 0xda, 0x99, 0xee, 0x64, 0x8a, 0xdd, 0x07, 0x33, 0x10, 0x8a, 0x94, 0x25, 0x48, 0x6d, 0x21, - 0x53, 0x7b, 0xfa, 0xb2, 0x90, 0xac, 0x2a, 0x1d, 0x50, 0x5b, 0x35, 0xe3, 0x96, 0xda, 0xaa, 0x59, - 0xfb, 0x9c, 0x5d, 0x95, 0xc9, 0x42, 0xdf, 0x40, 0x3e, 0x65, 0x06, 0x68, 0x4f, 0x93, 0x75, 0xd2, - 0x56, 0xcc, 0x5b, 0xf3, 0x60, 0xc3, 0x99, 0xfa, 0x41, 0xce, 0xd4, 0x70, 0x76, 0xb5, 0x33, 0x35, - 0x6e, 0xc8, 0xda, 0x99, 0x9a, 0x70, 0x56, 0x6b, 0x4f, 0xe8, 0xbb, 0x89, 0xb6, 0x75, 0xfa, 0x46, - 0x16, 0xfb, 0xdc, 0x80, 0xd5, 0x8c, 0x0d, 0xa1, 0xdb, 0x9a, 0xf4, 0x3a, 0x6b, 0x33, 0x4b, 0xf3, - 0x81, 0x8a, 0x4b, 0x59, 0x70, 0xd9, 0x45, 0x96, 0x8e, 0x0b, 0x61, 0x95, 0x94, 0xa3, 0x1d, 0x7d, - 0xf9, 0xd7, 0x45, 0xd1, 0x78, 0x71, 0x51, 0x34, 0xfe, 0xbd, 0x28, 0x1a, 0x3f, 0x5f, 0x16, 0x17, - 0x5e, 0x5c, 0x16, 0x17, 0xfe, 0xb9, 0x2c, 0x2e, 0x3c, 0x2a, 0xfb, 0x84, 0x9f, 0xf5, 0x1a, 0x76, - 0x93, 0x06, 0xce, 0x49, 0x92, 0x27, 0xf9, 0x25, 0xfe, 0x36, 0xc9, 0x28, 0xfe, 0x88, 0x1b, 0x2b, - 0xe2, 0x97, 0xf8, 0x93, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x9d, 0xc0, 0x4e, 0xdd, 0xc5, 0x0b, - 0x00, 0x00, + // 937 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x26, 0x69, 0xc0, 0xcf, 0x8d, 0x69, 0x86, 0x10, 0xc2, 0x92, 0x6c, 0xc3, 0x92, 0xb4, + 0xc6, 0xc2, 0xbb, 0x75, 0x90, 0x82, 0x10, 0x07, 0x94, 0x14, 0xd5, 0xea, 0x21, 0x92, 0xbb, 0xa9, + 0x04, 0xea, 0x81, 0x68, 0x6d, 0x4f, 0x36, 0xa3, 0x7a, 0x77, 0xb6, 0x9e, 0x71, 0x8a, 0x89, 0x8a, + 0x10, 0x27, 0x4e, 0x15, 0x7f, 0xbe, 0x07, 0x1f, 0x80, 0x13, 0x47, 0x8e, 0x95, 0xb8, 0x70, 0x44, + 0x09, 0x1f, 0x04, 0xed, 0xcc, 0xac, 0xbd, 0x6b, 0x8f, 0xed, 0xaa, 0x8a, 0xd4, 0xdb, 0xee, 0x7b, + 0xbf, 0x79, 0xef, 0xf7, 0xde, 0xdb, 0xf7, 0x9b, 0x85, 0x4d, 0x46, 0x4e, 0x22, 0xda, 0xc6, 0x6e, + 0xe8, 0x77, 0x03, 0x12, 0xb9, 0x67, 0x35, 0xf7, 0x49, 0x0f, 0x77, 0xfb, 0x4e, 0xdc, 0xa5, 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0xa8, 0xb8, 0x54, 0x04, 0x97, 0x6d, 0x64, 0xeb, + 0xb8, 0x10, 0x56, 0xcd, 0x28, 0xda, 0xc1, 0x97, 0x7f, 0x5d, 0x58, 0xc6, 0x8b, 0x0b, 0xcb, 0xf8, + 0xf7, 0xc2, 0x32, 0x7e, 0xbe, 0xb4, 0xe6, 0x5e, 0x5c, 0x5a, 0x73, 0xff, 0x5c, 0x5a, 0x73, 0x8f, + 0x2a, 0x01, 0xe1, 0xa7, 0xbd, 0xa6, 0xd3, 0xa2, 0xa1, 0x7b, 0x94, 0xc6, 0x49, 0xff, 0x89, 0xbf, + 0x4d, 0x23, 0x8a, 0x3f, 0xe6, 0xe6, 0x92, 0xf8, 0x25, 0xfe, 0xe4, 0xff, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xe3, 0x13, 0xf1, 0x29, 0xe5, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/margin/types/tx.pb.go b/x/margin/types/tx.pb.go index ea973a502c..df75b9236e 100644 --- a/x/margin/types/tx.pb.go +++ b/x/margin/types/tx.pb.go @@ -985,60 +985,60 @@ func init() { func init() { proto.RegisterFile("sifnode/margin/v1/tx.proto", fileDescriptor_4dd3bc05d7e781ea) } var fileDescriptor_4dd3bc05d7e781ea = []byte{ - // 841 bytes of a gzipped FileDescriptorProto + // 847 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x4e, 0xeb, 0x46, 0x14, 0xce, 0x1f, 0x21, 0x9c, 0x40, 0x00, 0x17, 0x82, 0x31, 0x6a, 0x12, 0x8c, 0x54, 0x02, 0xa8, 0xb1, 0x08, 0x8b, 0x76, 0x1b, 0xa0, 0xa8, 0x6a, 0x15, 0x15, 0xb9, 0x45, 0xb4, 0x88, 0x2a, 0x75, 0xec, 0xc1, 0x58, 0xd8, 0x1e, 0xcb, 0xe3, 0x10,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0x30, 0x09, - 0xff, 0x7c, 0x4d, 0xb4, 0x9b, 0xd0, 0xdb, 0x99, 0x61, 0x7b, 0x32, 0x23, 0xda, 0xa1, 0x44, 0xdc, - 0x26, 0xcc, 0xf7, 0xb1, 0xeb, 0xe2, 0x61, 0x68, 0xa2, 0x40, 0x4d, 0x94, 0x83, 0x58, 0x60, 0xe0, - 0x1b, 0x28, 0x39, 0x98, 0x18, 0x9e, 0x81, 0x6d, 0x7e, 0xa6, 0x91, 0x6d, 0x56, 0xda, 0x1b, 0xad, - 0x57, 0xa5, 0x6a, 0x9d, 0x86, 0x10, 0x39, 0x02, 0x73, 0x3f, 0x40, 0xc9, 0x44, 0xb7, 0xc8, 0x55, - 0x74, 0xc4, 0x17, 0xa9, 0xe1, 0x56, 0x68, 0xf8, 0xab, 0x37, 0x18, 0x3e, 0x46, 0xaa, 0x1c, 0x9d, - 0x17, 0x97, 0x61, 0x31, 0xac, 0xa9, 0x8c, 0x88, 0x83, 0x6d, 0x82, 0xc4, 0x36, 0x94, 0xba, 0x44, - 0x3f, 0x32, 0x31, 0x41, 0xa9, 0x75, 0xae, 0x40, 0xce, 0xd0, 0x68, 0x65, 0x0b, 0x72, 0xce, 0xd0, - 0x44, 0x0e, 0x96, 0x46, 0x67, 0x22, 0x9e, 0x5f, 0x61, 0xa1, 0x4b, 0xf4, 0x13, 0xec, 0xaa, 0x68, - 0x32, 0x59, 0x1d, 0xca, 0x96, 0xe7, 0xf4, 0x14, 0x4d, 0x73, 0x11, 0x21, 0xe1, 0xf7, 0x02, 0xcb, - 0x73, 0x3a, 0x41, 0x24, 0x54, 0xcb, 0x47, 0x6a, 0x6b, 0xb0, 0x3a, 0xc6, 0x1c, 0x49, 0x5e, 0xd2, - 0xdb, 0x9c, 0x39, 0x9a, 0xe2, 0xa1, 0x53, 0xc5, 0x55, 0x2c, 0x92, 0x2a, 0xba, 0x0f, 0x45, 0x87, - 0x22, 0xa8, 0x5e, 0xb9, 0xbd, 0x9e, 0x54, 0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a, 0x35, 0xc7, - 0x58, 0x23, 0xc5, 0xbf, 0xb3, 0x74, 0xa6, 0xe2, 0xe4, 0xbb, 0xcd, 0x54, 0xa2, 0xc1, 0x42, 0xa2, - 0xc1, 0x60, 0xfa, 0x62, 0x0f, 0x23, 0x77, 0xed, 0x7f, 0x67, 0x21, 0xdf, 0x25, 0x3a, 0xf7, 0x3d, - 0x14, 0xe8, 0x92, 0x16, 0x12, 0x46, 0x2a, 0x5c, 0x36, 0x82, 0x98, 0x9e, 0x8b, 0x6e, 0x9b, 0xe1, - 0x7e, 0x84, 0x99, 0xe0, 0x9a, 0x1b, 0xc9, 0x70, 0x9a, 0x14, 0xb6, 0x26, 0x24, 0x19, 0xb2, 0x0b, - 0x00, 0x66, 0x19, 0x35, 0x92, 0x0f, 0xc5, 0x08, 0xa1, 0x39, 0x0d, 0xc1, 0x70, 0xff, 0x01, 0xf3, - 0x63, 0x5b, 0x27, 0xe5, 0x7a, 0x2c, 0x46, 0xd8, 0x9d, 0x8e, 0x61, 0x14, 0x7e, 0x87, 0x32, 0xbb, - 0x5e, 0x36, 0x27, 0x1e, 0xf6, 0x21, 0xc2, 0xce, 0x54, 0x08, 0x43, 0xff, 0x17, 0xac, 0x26, 0x2f, - 0x90, 0xbd, 0x49, 0x2c, 0x2f, 0xc0, 0xc2, 0xc1, 0x67, 0x80, 0x19, 0xf1, 0x73, 0x98, 0x8b, 0x77, - 0x45, 0x3d, 0x99, 0x23, 0x02, 0x08, 0xdb, 0x53, 0x00, 0xe3, 0x45, 0x63, 0x77, 0x42, 0x4a, 0xd1, - 0x18, 0x48, 0x5a, 0xd1, 0x92, 0xc6, 0x9f, 0x76, 0x14, 0x33, 0x8a, 0x29, 0x1d, 0x15, 0x23, 0xd2, - 0x3a, 0xea, 0xf5, 0x28, 0x89, 0x19, 0x4e, 0x85, 0x85, 0xf1, 0xcd, 0xb2, 0x35, 0xed, 0x70, 0xc7, - 0x34, 0x85, 0xbd, 0x37, 0x80, 0x62, 0x91,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0x7b, 0x03, 0x29, 0x36, 0x39, 0x3c, 0xbe, + 0x7f, 0xaa, 0x65, 0x1f, 0x9e, 0x6a, 0xd9, 0x8f, 0x4f, 0xb5, 0xec, 0x3f, 0xcf, 0xb5, 0xcc, 0xc3, + 0x73, 0x2d, 0xf3, 0xff, 0x73, 0x2d, 0x73, 0xb1, 0xcb, 0xbc, 0x24, 0x7e, 0x36, 0xae, 0xd4, 0x6b, + 0xc5, 0xb0, 0xa5, 0xd1, 0x03, 0xed, 0x6e, 0xf4, 0x44, 0xa3, 0x2f, 0x8a, 0x7e, 0x91, 0xbe, 0xcf, + 0x0e, 0x3e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x32, 0xce, 0xff, 0x7b, 0x25, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/margin/types/types.pb.go b/x/margin/types/types.pb.go index b7ab49f7ad..b333061eac 100644 --- a/x/margin/types/types.pb.go +++ b/x/margin/types/types.pb.go @@ -52,170 +52,6 @@ func (Position) EnumDescriptor() ([]byte, []int) { return fileDescriptor_b3994728d56e8650, []int{0} } -type GenesisState struct { - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,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_b3994728d56e8650, []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 -} - -type Params struct { - LeverageMax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=leverage_max,json=leverageMax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"leverage_max"` - InterestRateMax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=interest_rate_max,json=interestRateMax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_rate_max"` - InterestRateMin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=interest_rate_min,json=interestRateMin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_rate_min"` - InterestRateIncrease github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=interest_rate_increase,json=interestRateIncrease,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_rate_increase"` - InterestRateDecrease github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=interest_rate_decrease,json=interestRateDecrease,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"interest_rate_decrease"` - HealthGainFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=health_gain_factor,json=healthGainFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"health_gain_factor"` - EpochLength int64 `protobuf:"varint,7,opt,name=epoch_length,json=epochLength,proto3" json:"epoch_length,omitempty"` - Pools []string `protobuf:"bytes,8,rep,name=pools,proto3" json:"pools,omitempty"` - RemovalQueueThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=removal_queue_threshold,json=removalQueueThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"removal_queue_threshold"` - MaxOpenPositions uint64 `protobuf:"varint,11,opt,name=max_open_positions,json=maxOpenPositions,proto3" json:"max_open_positions,omitempty"` - PoolOpenThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=pool_open_threshold,json=poolOpenThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"pool_open_threshold"` - ForceCloseFundPercentage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,13,opt,name=force_close_fund_percentage,json=forceCloseFundPercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"force_close_fund_percentage"` - ForceCloseFundAddress string `protobuf:"bytes,14,opt,name=force_close_fund_address,json=forceCloseFundAddress,proto3" json:"force_close_fund_address,omitempty"` - IncrementalInterestPaymentFundPercentage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,15,opt,name=incremental_interest_payment_fund_percentage,json=incrementalInterestPaymentFundPercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"incremental_interest_payment_fund_percentage"` - IncrementalInterestPaymentFundAddress string `protobuf:"bytes,16,opt,name=incremental_interest_payment_fund_address,json=incrementalInterestPaymentFundAddress,proto3" json:"incremental_interest_payment_fund_address,omitempty"` - SqModifier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,17,opt,name=sq_modifier,json=sqModifier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"sq_modifier"` - SafetyFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,18,opt,name=safety_factor,json=safetyFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"safety_factor"` - ClosedPools []string `protobuf:"bytes,19,rep,name=closed_pools,json=closedPools,proto3" json:"closed_pools,omitempty"` - IncrementalInterestPaymentEnabled bool `protobuf:"varint,20,opt,name=incremental_interest_payment_enabled,json=incrementalInterestPaymentEnabled,proto3" json:"incremental_interest_payment_enabled,omitempty"` - WhitelistingEnabled bool `protobuf:"varint,21,opt,name=whitelisting_enabled,json=whitelistingEnabled,proto3" json:"whitelisting_enabled,omitempty"` - RowanCollateralEnabled bool `protobuf:"varint,22,opt,name=rowan_collateral_enabled,json=rowanCollateralEnabled,proto3" json:"rowan_collateral_enabled,omitempty"` -} - -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_b3994728d56e8650, []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) GetEpochLength() int64 { - if m != nil { - return m.EpochLength - } - return 0 -} - -func (m *Params) GetPools() []string { - if m != nil { - return m.Pools - } - return nil -} - -func (m *Params) GetMaxOpenPositions() uint64 { - if m != nil { - return m.MaxOpenPositions - } - return 0 -} - -func (m *Params) GetForceCloseFundAddress() string { - if m != nil { - return m.ForceCloseFundAddress - } - return "" -} - -func (m *Params) GetIncrementalInterestPaymentFundAddress() string { - if m != nil { - return m.IncrementalInterestPaymentFundAddress - } - return "" -} - -func (m *Params) GetClosedPools() []string { - if m != nil { - return m.ClosedPools - } - return nil -} - -func (m *Params) GetIncrementalInterestPaymentEnabled() bool { - if m != nil { - return m.IncrementalInterestPaymentEnabled - } - return false -} - -func (m *Params) GetWhitelistingEnabled() bool { - if m != nil { - return m.WhitelistingEnabled - } - return false -} - -func (m *Params) GetRowanCollateralEnabled() bool { - if m != nil { - return m.RowanCollateralEnabled - } - return false -} - type MTP struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` CollateralAsset string `protobuf:"bytes,2,opt,name=collateral_asset,json=collateralAsset,proto3" json:"collateral_asset,omitempty"` @@ -236,7 +72,7 @@ func (m *MTP) Reset() { *m = MTP{} } func (m *MTP) String() string { return proto.CompactTextString(m) } func (*MTP) ProtoMessage() {} func (*MTP) Descriptor() ([]byte, []int) { - return fileDescriptor_b3994728d56e8650, []int{2} + return fileDescriptor_b3994728d56e8650, []int{0} } func (m *MTP) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -302,341 +138,45 @@ func (m *MTP) GetId() uint64 { func init() { proto.RegisterEnum("sifnode.margin.v1.Position", Position_name, Position_value) - proto.RegisterType((*GenesisState)(nil), "sifnode.margin.v1.GenesisState") - proto.RegisterType((*Params)(nil), "sifnode.margin.v1.Params") proto.RegisterType((*MTP)(nil), "sifnode.margin.v1.MTP") } func init() { proto.RegisterFile("sifnode/margin/v1/types.proto", fileDescriptor_b3994728d56e8650) } var fileDescriptor_b3994728d56e8650 = []byte{ - // 985 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcd, 0x72, 0xdb, 0x36, - 0x10, 0xc7, 0x4d, 0x7f, 0x4a, 0x2b, 0xd9, 0x96, 0x60, 0xd9, 0x65, 0x93, 0xa9, 0xa2, 0xb8, 0x5f, - 0x4a, 0x26, 0x95, 0xea, 0xf4, 0x90, 0x5e, 0x1d, 0x7f, 0xc5, 0x9d, 0x38, 0x92, 0x29, 0xbb, 0xd3, - 0xc9, 0x64, 0xca, 0x81, 0x49, 0x48, 0xc2, 0x94, 0x04, 0x68, 0x02, 0x72, 0xe4, 0x17, 0xe8, 0xb1, - 0xd3, 0x7b, 0x5f, 0x28, 0xc7, 0x1c, 0x3b, 0x3d, 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 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 m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(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.RowanCollateralEnabled { - i-- - if m.RowanCollateralEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xb0 - } - if m.WhitelistingEnabled { - i-- - if m.WhitelistingEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa8 - } - if m.IncrementalInterestPaymentEnabled { - i-- - if m.IncrementalInterestPaymentEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0xa0 - } - if len(m.ClosedPools) > 0 { - for iNdEx := len(m.ClosedPools) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ClosedPools[iNdEx]) - copy(dAtA[i:], m.ClosedPools[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ClosedPools[iNdEx]))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x9a - } - } - { - size := m.SafetyFactor.Size() - i -= size - if _, err := m.SafetyFactor.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 - { - size := m.SqModifier.Size() - i -= size - if _, err := m.SqModifier.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - if len(m.IncrementalInterestPaymentFundAddress) > 0 { - i -= len(m.IncrementalInterestPaymentFundAddress) - copy(dAtA[i:], m.IncrementalInterestPaymentFundAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.IncrementalInterestPaymentFundAddress))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - { - size := m.IncrementalInterestPaymentFundPercentage.Size() - i -= size - if _, err := m.IncrementalInterestPaymentFundPercentage.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - if len(m.ForceCloseFundAddress) > 0 { - i -= len(m.ForceCloseFundAddress) - copy(dAtA[i:], m.ForceCloseFundAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ForceCloseFundAddress))) - i-- - dAtA[i] = 0x72 - } - { - size := m.ForceCloseFundPercentage.Size() - i -= size - if _, err := m.ForceCloseFundPercentage.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - { - size := m.PoolOpenThreshold.Size() - i -= size - if _, err := m.PoolOpenThreshold.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - if m.MaxOpenPositions != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxOpenPositions)) - i-- - dAtA[i] = 0x58 - } - { - size := m.RemovalQueueThreshold.Size() - i -= size - if _, err := m.RemovalQueueThreshold.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - if len(m.Pools) > 0 { - for iNdEx := len(m.Pools) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Pools[iNdEx]) - copy(dAtA[i:], m.Pools[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Pools[iNdEx]))) - i-- - dAtA[i] = 0x42 - } - } - if m.EpochLength != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.EpochLength)) - i-- - dAtA[i] = 0x38 - } - { - size := m.HealthGainFactor.Size() - i -= size - if _, err := m.HealthGainFactor.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size := m.InterestRateDecrease.Size() - i -= size - if _, err := m.InterestRateDecrease.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size := m.InterestRateIncrease.Size() - i -= size - if _, err := m.InterestRateIncrease.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.InterestRateMin.Size() - i -= size - if _, err := m.InterestRateMin.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.InterestRateMax.Size() - i -= size - if _, err := m.InterestRateMax.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.LeverageMax.Size() - i -= size - if _, err := m.LeverageMax.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + // 506 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcd, 0x6e, 0xd3, 0x40, + 0x14, 0x85, 0xed, 0x34, 0x6d, 0x9c, 0x9b, 0x36, 0x4d, 0x87, 0x1f, 0x8d, 0x8a, 0x70, 0x23, 0x90, + 0x20, 0x54, 0xc2, 0xa6, 0xb0, 0x60, 0xdd, 0x36, 0x85, 0x16, 0xd1, 0x36, 0x38, 0x0d, 0x0b, 0x84, + 0x14, 0x4d, 0xec, 0xa9, 0x33, 0xc2, 0xf6, 0x58, 0x9e, 0x49, 0x44, 0xdf, 0x82, 0x3d, 0x2f, 0xd4, + 0x65, 0x97, 0x88, 0x45, 0x85, 0x92, 0x17, 0x41, 0xf1, 0x5f, 0x4d, 0xd9, 0x54, 0x5e, 0xd9, 0xbe, + 0xf7, 0xf8, 0x3b, 0x3e, 0xd6, 0x9d, 0x0b, 0x8f, 0x05, 0x3b, 0x0f, 0xb8, 0x43, 0x4d, 0x9f, 0x44, + 0x2e, 0x0b, 0xcc, 0xe9, 0x8e, 0x29, 0x2f, 0x42, 0x2a, 0x8c, 0x30, 0xe2, 0x92, 0xa3, 0x8d, 0xb4, + 0x6d, 0x24, 0x6d, 0x63, 0xba, 0xb3, 0x79, 0xdf, 0xe5, 0x2e, 0x8f, 0xbb, 0xe6, 0xe2, 0x2e, 0x11, + 0x3e, 0xf9, 0x59, 0x83, 0xa5, 0xe3, 0xb3, 0x1e, 0xc2, 0x50, 0x23, 0x8e, 0x13, 0x51, 0x21, 0xb0, + 0xda, 0x56, 0x3b, 0x75, 0x2b, 0x7b, 0x44, 0x2f, 0xa0,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, 0x22, + 0x2e, 0xc5, 0x10, 0x13, 0x8d, 0x94, 0xf8, 0xec, 0x0e, 0xc4, 0x2e, 0xb5, 0xad, 0xfc, 0x7d, 0x74, + 0x0c, 0xe0, 0xcb, 0x70, 0x38, 0xa6, 0xc4, 0x93, 0x63, 0xdc, 0x28, 0x45, 0xab, 0xfb, 0x32, 0x3c, + 0x8c, 0x01, 0xe8, 0x2d, 0x68, 0x21, 0x17, 0x4c, 0x32, 0x1e, 0xe0, 0xd5, 0xb6, 0xda, 0x69, 0xbe, + 0x7e, 0x64, 0xfc, 0x77, 0x20, 0x8d, 0x5e, 0x2a, 0xb1, 0x72, 0x31, 0x6a, 0x42, 0x85, 0x39, 0x78, + 0xad, 0xad, 0x76, 0xaa, 0x56, 0x85, 0x39, 0xdb, 0xaf, 0x40, 0xcb, 0x54, 0x68, 0x1d, 0x1a, 0x83, + 0x93, 0x7e, 0xef, 0x60, 0xff, 0xe8, 0xdd, 0xd1, 0x41, 0xb7, 0xa5, 0x20, 0x0d, 0xaa, 0x1f, 0x4f, + 0x4f, 0xde, 0xb7, 0x54, 0x54, 0x87, 0xe5, 0xfe, 0xe1, 0xa9, 0x75, 0xd6, 0xaa, 0xec, 0x75, 0x2f, + 0x67, 0xba, 0x7a, 0x35, 0xd3, 0xd5, 0x3f, 0x33, 0x5d, 0xfd, 0x31, 0xd7, 0x95, 0xab, 0xb9, 0xae, + 0xfc, 0x9a, 0xeb, 0xca, 0x97, 0xed, 0x42, 0x8e, 0x3e, 0x3b, 0xb7, 0xc7, 0x84, 0x05, 0x66, 0xb6, + 0x45, 0xbe, 0x67, 0x7b, 0x24, 0xce, 0x33, 0x5a, 0x89, 0x97, 0xc3, 0x9b, 0xbf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xba, 0xae, 0xaa, 0xee, 0x66, 0x04, 0x00, 0x00, } func (m *MTP) Marshal() (dAtA []byte, err error) { @@ -784,87 +324,6 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { 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 + sovTypes(uint64(l)) - } - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.LeverageMax.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.InterestRateMax.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.InterestRateMin.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.InterestRateIncrease.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.InterestRateDecrease.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.HealthGainFactor.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.EpochLength != 0 { - n += 1 + sovTypes(uint64(m.EpochLength)) - } - if len(m.Pools) > 0 { - for _, s := range m.Pools { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - l = m.RemovalQueueThreshold.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.MaxOpenPositions != 0 { - n += 1 + sovTypes(uint64(m.MaxOpenPositions)) - } - l = m.PoolOpenThreshold.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.ForceCloseFundPercentage.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.ForceCloseFundAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.IncrementalInterestPaymentFundPercentage.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.IncrementalInterestPaymentFundAddress) - if l > 0 { - n += 2 + l + sovTypes(uint64(l)) - } - l = m.SqModifier.Size() - n += 2 + l + sovTypes(uint64(l)) - l = m.SafetyFactor.Size() - n += 2 + l + sovTypes(uint64(l)) - if len(m.ClosedPools) > 0 { - for _, s := range m.ClosedPools { - l = len(s) - n += 2 + l + sovTypes(uint64(l)) - } - } - if m.IncrementalInterestPaymentEnabled { - n += 3 - } - if m.WhitelistingEnabled { - n += 3 - } - if m.RowanCollateralEnabled { - n += 3 - } - return n -} - func (m *MTP) Size() (n int) { if m == nil { return 0 @@ -914,776 +373,6 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(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 ErrIntOverflowTypes - } - 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 ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - 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 - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - 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 ErrIntOverflowTypes - } - 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 != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LeverageMax", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LeverageMax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterestRateMax", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InterestRateMax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterestRateMin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InterestRateMin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterestRateIncrease", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InterestRateIncrease.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterestRateDecrease", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InterestRateDecrease.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HealthGainFactor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.HealthGainFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochLength", wireType) - } - m.EpochLength = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EpochLength |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pools", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Pools = append(m.Pools, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemovalQueueThreshold", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RemovalQueueThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxOpenPositions", wireType) - } - m.MaxOpenPositions = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxOpenPositions |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolOpenThreshold", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PoolOpenThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ForceCloseFundPercentage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ForceCloseFundPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ForceCloseFundAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ForceCloseFundAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 15: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IncrementalInterestPaymentFundPercentage", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.IncrementalInterestPaymentFundPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 16: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IncrementalInterestPaymentFundAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IncrementalInterestPaymentFundAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SqModifier", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SqModifier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SafetyFactor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SafetyFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 19: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClosedPools", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClosedPools = append(m.ClosedPools, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 20: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IncrementalInterestPaymentEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IncrementalInterestPaymentEnabled = bool(v != 0) - case 21: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WhitelistingEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.WhitelistingEnabled = bool(v != 0) - case 22: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RowanCollateralEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RowanCollateralEnabled = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MTP) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/genesis.pb.go b/x/oracle/types/genesis.pb.go new file mode 100644 index 0000000000..f5f1d67111 --- /dev/null +++ b/x/oracle/types/genesis.pb.go @@ -0,0 +1,439 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sifnode/oracle/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 + +type GenesisState struct { + AddressWhitelist []string `protobuf:"bytes,1,rep,name=address_whitelist,json=addressWhitelist,proto3" json:"address_whitelist,omitempty"` + AdminAddress string `protobuf:"bytes,2,opt,name=admin_address,json=adminAddress,proto3" json:"admin_address,omitempty"` + Prophecies []*DBProphecy `protobuf:"bytes,3,rep,name=prophecies,proto3" json:"prophecies,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_1eb098560757ad78, []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) GetAddressWhitelist() []string { + if m != nil { + return m.AddressWhitelist + } + return nil +} + +func (m *GenesisState) GetAdminAddress() string { + if m != nil { + return m.AdminAddress + } + return "" +} + +func (m *GenesisState) GetProphecies() []*DBProphecy { + if m != nil { + return m.Prophecies + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "sifnode.oracle.v1.GenesisState") +} + +func init() { proto.RegisterFile("sifnode/oracle/v1/genesis.proto", fileDescriptor_1eb098560757ad78) } + +var fileDescriptor_1eb098560757ad78 = []byte{ + // 260 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xce, 0x4c, 0xcb, + 0xcb, 0x4f, 0x49, 0xd5, 0xcf, 0x2f, 0x4a, 0x4c, 0xce, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, + 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x84, 0x2a, 0xd0, + 0x83, 0x28, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xcb, 0xea, 0x83, 0x58, + 0x10, 0x85, 0x52, 0xb2, 0x98, 0x26, 0x95, 0x54, 0x16, 0xa4, 0x42, 0xcd, 0x51, 0x9a, 0xcf, 0xc8, + 0xc5, 0xe3, 0x0e, 0x31, 0x39, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0x48, 0x9b, 0x4b, 0x30, 0x31, 0x25, + 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xbe, 0x3c, 0x23, 0xb3, 0x24, 0x35, 0x27, 0xb3, 0xb8, 0x44, 0x82, + 0x51, 0x81, 0x59, 0x83, 0x33, 0x48, 0x00, 0x2a, 0x11, 0x0e, 0x13, 0x17, 0x52, 0xe6, 0xe2, 0x4d, + 0x4c, 0xc9, 0xcd, 0xcc, 0x8b, 0x87, 0xca, 0x48, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x06, 0xf1, 0x80, + 0x05, 0x1d, 0x21, 0x62, 0x42, 0xb6, 0x5c, 0x5c, 0x05, 0x45, 0xf9, 0x05, 0x19, 0xa9, 0xc9, 0x99, + 0xa9, 0xc5, 0x12, 0xcc, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0xb2, 0x7a, 0x18, 0xee, 0xd7, 0x73, 0x71, + 0x0a, 0x80, 0x28, 0xab, 0x0c, 0x42, 0xd2, 0xe0, 0xe4, 0x72, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, + 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, + 0xc7, 0x72, 0x0c, 0x51, 0x5a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, + 0xc1, 0x99, 0x69, 0xc9, 0x19, 0x89, 0x99, 0x79, 0xfa, 0x30, 0xef, 0x56, 0xc0, 0x3c, 0x0c, 0xf6, + 0x6d, 0x12, 0x1b, 0xd8, 0xbb, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x17, 0x1b, 0x0a, + 0x59, 0x01, 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.Prophecies) > 0 { + for iNdEx := len(m.Prophecies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Prophecies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.AdminAddress) > 0 { + i -= len(m.AdminAddress) + copy(dAtA[i:], m.AdminAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.AdminAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.AddressWhitelist) > 0 { + for iNdEx := len(m.AddressWhitelist) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AddressWhitelist[iNdEx]) + copy(dAtA[i:], m.AddressWhitelist[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.AddressWhitelist[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + 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 len(m.AddressWhitelist) > 0 { + for _, s := range m.AddressWhitelist { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = len(m.AdminAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.Prophecies) > 0 { + for _, e := range m.Prophecies { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + 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 AddressWhitelist", 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.AddressWhitelist = append(m.AddressWhitelist, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AdminAddress", 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.AdminAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prophecies", 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.Prophecies = append(m.Prophecies, &DBProphecy{}) + if err := m.Prophecies[len(m.Prophecies)-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 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/oracle/types/types.pb.go b/x/oracle/types/types.pb.go index d02b61eb88..fb61e1b87f 100644 --- a/x/oracle/types/types.pb.go +++ b/x/oracle/types/types.pb.go @@ -59,66 +59,6 @@ func (StatusText) EnumDescriptor() ([]byte, []int) { return fileDescriptor_dac1b931484f4203, []int{0} } -type GenesisState struct { - AddressWhitelist []string `protobuf:"bytes,1,rep,name=address_whitelist,json=addressWhitelist,proto3" json:"address_whitelist,omitempty"` - AdminAddress string `protobuf:"bytes,2,opt,name=admin_address,json=adminAddress,proto3" json:"admin_address,omitempty"` - Prophecies []*DBProphecy `protobuf:"bytes,3,rep,name=prophecies,proto3" json:"prophecies,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_dac1b931484f4203, []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) GetAddressWhitelist() []string { - if m != nil { - return m.AddressWhitelist - } - return nil -} - -func (m *GenesisState) GetAdminAddress() string { - if m != nil { - return m.AdminAddress - } - return "" -} - -func (m *GenesisState) GetProphecies() []*DBProphecy { - if m != nil { - return m.Prophecies - } - return nil -} - // Claim contains an arbitrary claim with arbitrary content made by a given // validator type Claim struct { @@ -131,7 +71,7 @@ func (m *Claim) Reset() { *m = Claim{} } func (m *Claim) String() string { return proto.CompactTextString(m) } func (*Claim) ProtoMessage() {} func (*Claim) Descriptor() ([]byte, []int) { - return fileDescriptor_dac1b931484f4203, []int{1} + return fileDescriptor_dac1b931484f4203, []int{0} } func (m *Claim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -195,7 +135,7 @@ func (m *DBProphecy) Reset() { *m = DBProphecy{} } func (m *DBProphecy) String() string { return proto.CompactTextString(m) } func (*DBProphecy) ProtoMessage() {} func (*DBProphecy) Descriptor() ([]byte, []int) { - return fileDescriptor_dac1b931484f4203, []int{2} + return fileDescriptor_dac1b931484f4203, []int{1} } func (m *DBProphecy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -262,7 +202,7 @@ func (m *Status) Reset() { *m = Status{} } func (m *Status) String() string { return proto.CompactTextString(m) } func (*Status) ProtoMessage() {} func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_dac1b931484f4203, []int{3} + return fileDescriptor_dac1b931484f4203, []int{2} } func (m *Status) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -307,7 +247,6 @@ func (m *Status) GetFinalClaim() string { func init() { proto.RegisterEnum("sifnode.oracle.v1.StatusText", StatusText_name, StatusText_value) - proto.RegisterType((*GenesisState)(nil), "sifnode.oracle.v1.GenesisState") proto.RegisterType((*Claim)(nil), "sifnode.oracle.v1.Claim") proto.RegisterType((*DBProphecy)(nil), "sifnode.oracle.v1.DBProphecy") proto.RegisterType((*Status)(nil), "sifnode.oracle.v1.Status") @@ -316,91 +255,33 @@ func init() { func init() { proto.RegisterFile("sifnode/oracle/v1/types.proto", fileDescriptor_dac1b931484f4203) } var fileDescriptor_dac1b931484f4203 = []byte{ - // 485 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x6e, 0xda, 0x40, - 0x18, 0x85, 0x31, 0x50, 0xaa, 0xfc, 0xd0, 0xd4, 0x99, 0x56, 0x8d, 0xdb, 0x2a, 0x0e, 0xa2, 0x1b, - 0x9a, 0x4a, 0xb6, 0x48, 0x17, 0x5d, 0x75, 0x01, 0xd8, 0x89, 0x90, 0x2a, 0x84, 0x6c, 0xd3, 0x56, - 0x55, 0x55, 0x6b, 0x62, 0x0f, 0x30, 0x92, 0xf1, 0x20, 0xcf, 0x84, 0x92, 0x5b, 0xf4, 0x06, 0x3d, - 0x40, 0x2f, 0x92, 0x65, 0x96, 0x5d, 0x55, 0x15, 0x5c, 0x24, 0x62, 0x6c, 0x03, 0x4a, 0xb2, 0xb3, - 0xdf, 0xf7, 0x66, 0xde, 0x9b, 0x5f, 0x3f, 0x1c, 0x71, 0x3a, 0x8a, 0x59, 0x48, 0x4c, 0x96, 0xe0, - 0x20, 0x22, 0xe6, 0xbc, 0x65, 0x8a, 0xab, 0x19, 0xe1, 0xc6, 0x2c, 0x61, 0x82, 0xa1, 0x83, 0x0c, - 0x1b, 0x29, 0x36, 0xe6, 0xad, 0x57, 0xcf, 0xc7, 0x6c, 0xcc, 0x24, 0x35, 0xd7, 0x5f, 0xa9, 0xb1, - 0xf1, 0x5b, 0x81, 0xda, 0x39, 0x89, 0x09, 0xa7, 0xdc, 0x15, 0x58, 0x10, 0xf4, 0x0e, 0x0e, 0x70, - 0x18, 0x26, 0x84, 0x73, 0xff, 0xe7, 0x84, 0x0a, 0x12, 0x51, 0x2e, 0x34, 0xa5, 0x5e, 0x6a, 0xee, - 0x39, 0x6a, 0x06, 0xbe, 0xe4, 0x3a, 0x7a, 0x03, 0x4f, 0x70, 0x38, 0xa5, 0xb1, 0x9f, 0x11, 0xad, - 0x58, 0x57, 0x9a, 0x7b, 0x4e, 0x4d, 0x8a, 0xed, 0x54, 0x43, 0x1f, 0x01, 0x66, 0x09, 0x9b, 0x4d, - 0x48, 0x40, 0x09, 0xd7, 0x4a, 0xf5, 0x52, 0xb3, 0x7a, 0x7a, 0x64, 0xdc, 0x2b, 0x68, 0x58, 0x9d, - 0x41, 0x6a, 0xbb, 0x72, 0x76, 0x0e, 0x34, 0x7e, 0xc0, 0xa3, 0x6e, 0x84, 0xe9, 0x14, 0xed, 0x43, - 0x91, 0x86, 0x9a, 0x22, 0x13, 0x8a, 0x34, 0x5c, 0x37, 0x9d, 0xe3, 0x88, 0x86, 0x58, 0xb0, 0xe4, - 0x4e, 0x01, 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0x95, 0x9b, 0xa5, 0xae, 0xfc, 0x5f, 0xea, 0xca, 0xaf, - 0x95, 0x5e, 0xb8, 0x59, 0xe9, 0x85, 0xbf, 0x2b, 0xbd, 0xf0, 0xed, 0x64, 0x4c, 0xc5, 0xe4, 0xf2, - 0xc2, 0x08, 0xd8, 0xd4, 0x74, 0xe9, 0x28, 0x98, 0x60, 0x1a, 0x9b, 0xf9, 0xe2, 0x2f, 0xf2, 0xd5, - 0x97, 0x7b, 0x7f, 0x51, 0x91, 0xfb, 0xfc, 0xfe, 0x36, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x8f, 0x95, - 0x2e, 0x19, 0x03, 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.Prophecies) > 0 { - for iNdEx := len(m.Prophecies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Prophecies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.AdminAddress) > 0 { - i -= len(m.AdminAddress) - copy(dAtA[i:], m.AdminAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AdminAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.AddressWhitelist) > 0 { - for iNdEx := len(m.AddressWhitelist) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AddressWhitelist[iNdEx]) - copy(dAtA[i:], m.AddressWhitelist[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AddressWhitelist[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil + // 412 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x8b, 0xd3, 0x40, + 0x1c, 0xc5, 0x93, 0x6c, 0xad, 0xf8, 0x5f, 0x59, 0xb3, 0xa3, 0xb8, 0x51, 0xd9, 0xac, 0xf4, 0xa4, + 0x2b, 0x24, 0x74, 0x3d, 0x78, 0x6e, 0x93, 0xac, 0x04, 0xa4, 0x94, 0x4c, 0x2a, 0x22, 0x62, 0x98, + 0x4d, 0xa6, 0xed, 0x40, 0x36, 0x53, 0x32, 0xb3, 0xa5, 0xfb, 0x2d, 0xfc, 0x1e, 0x7e, 0x91, 0x1e, + 0x7b, 0xf4, 0x24, 0xd2, 0x7e, 0x11, 0xe9, 0xa4, 0x4d, 0x8b, 0xc5, 0x5b, 0xf2, 0x7e, 0x2f, 0xf3, + 0x5e, 0x86, 0x07, 0xe7, 0x82, 0x0d, 0x0b, 0x9e, 0x51, 0x97, 0x97, 0x24, 0xcd, 0xa9, 0x3b, 0x6d, + 0xbb, 0xf2, 0x7e, 0x42, 0x85, 0x33, 0x29, 0xb9, 0xe4, 0xe8, 0x74, 0x83, 0x9d, 0x0a, 0x3b, 0xd3, + 0xf6, 0xcb, 0x67, 0x23, 0x3e, 0xe2, 0x8a, 0xba, 0xeb, 0xa7, 0xca, 0xd8, 0xfa, 0x0e, 0x0f, 0xbc, + 0x9c, 0xb0, 0x5b, 0x74, 0x02, 0x06, 0xcb, 0x2c, 0xfd, 0xb5, 0xfe, 0xe6, 0x51, 0x64, 0xb0, 0x0c, + 0xbd, 0x83, 0xd3, 0x29, 0xc9, 0x59, 0x46, 0x24, 0x2f, 0x13, 0x92, 0x65, 0x25, 0x15, 0xc2, 0x32, + 0x14, 0x36, 0x6b, 0xd0, 0xa9, 0x74, 0x64, 0xc1, 0xc3, 0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0x8b, + 0xa5, 0xad, 0xff, 0x59, 0xda, 0xfa, 0x8f, 0x95, 0xad, 0x2d, 0x56, 0xb6, 0xf6, 0x6b, 0x65, 0x6b, + 0x5f, 0x2f, 0x47, 0x4c, 0x8e, 0xef, 0x6e, 0x9c, 0x94, 0xdf, 0xba, 0x98, 0x0d, 0xd3, 0x31, 0x61, + 0x85, 0xbb, 0x9d, 0xd5, 0x6c, 0x3b, 0x2c, 0xb5, 0xaa, 0x9b, 0xa6, 0x5a, 0xcb, 0xfb, 0xbf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xfb, 0x1f, 0xeb, 0xbe, 0x77, 0x02, 0x00, 0x00, } func (m *Claim) Marshal() (dAtA []byte, err error) { @@ -547,31 +428,6 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.AddressWhitelist) > 0 { - for _, s := range m.AddressWhitelist { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - l = len(m.AdminAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if len(m.Prophecies) > 0 { - for _, e := range m.Prophecies { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - func (m *Claim) Size() (n int) { if m == nil { return 0 @@ -638,154 +494,6 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(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 ErrIntOverflowTypes - } - 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 AddressWhitelist", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AddressWhitelist = append(m.AddressWhitelist, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AdminAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AdminAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Prophecies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Prophecies = append(m.Prophecies, &DBProphecy{}) - if err := m.Prophecies[len(m.Prophecies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Claim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/tokenregistry/types/genesis.pb.go b/x/tokenregistry/types/genesis.pb.go new file mode 100644 index 0000000000..0df2de0fb9 --- /dev/null +++ b/x/tokenregistry/types/genesis.pb.go @@ -0,0 +1,329 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sifnode/tokenregistry/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 + +type GenesisState struct { + Registry *Registry `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,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_2a69af2562302b0b, []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) GetRegistry() *Registry { + if m != nil { + return m.Registry + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "sifnode.tokenregistry.v1.GenesisState") +} + +func init() { + proto.RegisterFile("sifnode/tokenregistry/v1/genesis.proto", fileDescriptor_2a69af2562302b0b) +} + +var fileDescriptor_2a69af2562302b0b = []byte{ + // 196 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2b, 0xce, 0x4c, 0xcb, + 0xcb, 0x4f, 0x49, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x2b, 0x4a, 0x4d, 0xcf, 0x2c, 0x2e, 0x29, + 0xaa, 0xd4, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x92, 0x80, 0xaa, 0xd3, 0x43, 0x51, 0xa7, 0x57, 0x66, 0x28, 0x25, 0x92, 0x9e, + 0x9f, 0x9e, 0x0f, 0x56, 0xa4, 0x0f, 0x62, 0x41, 0xd4, 0x4b, 0xa9, 0xe0, 0x34, 0xb7, 0xa4, 0xb2, + 0x20, 0x15, 0x6a, 0xaa, 0x92, 0x1f, 0x17, 0x8f, 0x3b, 0xc4, 0x9a, 0xe0, 0x92, 0xc4, 0x92, 0x54, + 0x21, 0x3b, 0x2e, 0x0e, 0x98, 0x52, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x25, 0x3d, 0x5c, + 0x16, 0xeb, 0x05, 0x41, 0xd9, 0x41, 0x70, 0x3d, 0x4e, 0xde, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, + 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, + 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x98, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, + 0x1f, 0x9c, 0x99, 0x96, 0x9c, 0x91, 0x98, 0x99, 0xa7, 0x0f, 0x73, 0x63, 0x05, 0x9a, 0x2b, 0xc1, + 0x4e, 0x4c, 0x62, 0x03, 0xbb, 0xd1, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x7f, 0x88, 0x94, + 0x23, 0x01, 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 m.Registry != nil { + { + size, err := m.Registry.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + 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.Registry != nil { + l = m.Registry.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + 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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Registry", 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.Registry == nil { + m.Registry = &Registry{} + } + if err := m.Registry.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 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/tokenregistry/types/types.pb.go b/x/tokenregistry/types/types.pb.go index 1667105a6e..a5f1200621 100644 --- a/x/tokenregistry/types/types.pb.go +++ b/x/tokenregistry/types/types.pb.go @@ -60,50 +60,6 @@ func (Permission) EnumDescriptor() ([]byte, []int) { return fileDescriptor_d08afdaf425e66ea, []int{0} } -type GenesisState struct { - Registry *Registry `protobuf:"bytes,2,opt,name=registry,proto3" json:"registry,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_d08afdaf425e66ea, []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) GetRegistry() *Registry { - if m != nil { - return m.Registry - } - return nil -} - type Registry struct { Entries []*RegistryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` } @@ -112,7 +68,7 @@ func (m *Registry) Reset() { *m = Registry{} } func (m *Registry) String() string { return proto.CompactTextString(m) } func (*Registry) ProtoMessage() {} func (*Registry) Descriptor() ([]byte, []int) { - return fileDescriptor_d08afdaf425e66ea, []int{1} + return fileDescriptor_d08afdaf425e66ea, []int{0} } func (m *Registry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -186,7 +142,7 @@ func (m *RegistryEntry) Reset() { *m = RegistryEntry{} } func (m *RegistryEntry) String() string { return proto.CompactTextString(m) } func (*RegistryEntry) ProtoMessage() {} func (*RegistryEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_d08afdaf425e66ea, []int{2} + return fileDescriptor_d08afdaf425e66ea, []int{1} } func (m *RegistryEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -329,7 +285,6 @@ func (m *RegistryEntry) GetIbcCounterpartyChainId() string { func init() { proto.RegisterEnum("sifnode.tokenregistry.v1.Permission", Permission_name, Permission_value) - proto.RegisterType((*GenesisState)(nil), "sifnode.tokenregistry.v1.GenesisState") proto.RegisterType((*Registry)(nil), "sifnode.tokenregistry.v1.Registry") proto.RegisterType((*RegistryEntry)(nil), "sifnode.tokenregistry.v1.RegistryEntry") } @@ -339,80 +294,43 @@ func init() { } var fileDescriptor_d08afdaf425e66ea = []byte{ - // 602 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x94, 0x4f, 0x4f, 0x13, 0x41, - 0x18, 0xc6, 0xbb, 0xb4, 0xa5, 0xed, 0xdb, 0x3f, 0xac, 0x13, 0x42, 0x46, 0x8c, 0x4d, 0x6d, 0x20, - 0x34, 0x1e, 0xda, 0x80, 0x5e, 0x3c, 0x68, 0x42, 0x4b, 0x31, 0xab, 0x05, 0x9b, 0x56, 0x12, 0xf5, - 0xd2, 0xcc, 0x76, 0x87, 0x32, 0x61, 0x77, 0x66, 0x33, 0x33, 0x20, 0xfd, 0x00, 0xde, 0xfd, 0x58, - 0x1e, 0x39, 0x7a, 0x34, 0xf0, 0x45, 0xcc, 0xce, 0xee, 0x42, 0x01, 0x89, 0xb7, 0x79, 0x9f, 0xe7, - 0xf7, 0xbc, 0x99, 0xec, 0x93, 0x1d, 0xd8, 0x50, 0xec, 0x98, 0x0b, 0x8f,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4f, 0x8c, 0x3b, 0xde, 0x87, 0x5c, 0xd1, 0xb2, - 0x97, 0x5e, 0xce, 0x00, 0x6e, 0x2f, 0x8c, 0x56, 0xa0, 0x7c, 0x74, 0x38, 0x1e, 0xf6, 0x7b, 0xce, - 0xbe, 0xd3, 0xdf, 0xb3, 0x33, 0xa8, 0x00, 0xd9, 0xde, 0x60, 0x68, 0x5b, 0xa8, 0x0a, 0x25, 0xa7, - 0xdb, 0xeb, 0x7f, 0x19, 0x7e, 0x1a, 0x7d, 0xb6, 0x97, 0x92, 0xd1, 0x39, 0x30, 0x63, 0x36, 0xca, - 0xed, 0x39, 0xe3, 0xdd, 0xee, 0xa0, 0x3f, 0xe9, 0x1e, 0x7d, 0xb5, 0x73, 0xc8, 0x86, 0x4a, 0x2a, - 0x8c, 0xfb, 0x83, 0x81, 0x9d, 0xef, 0x7e, 0xfc, 0x75, 0x55, 0xb7, 0x2e, 0xaf, 0xea, 0xd6, 0x9f, - 0xab, 0xba, 0xf5, 0xf3, 0xba, 0x9e, 0xb9, 0xbc, 0xae, 0x67, 0x7e, 0x5f, 0xd7, 0x33, 0xdf, 0xb6, - 0x67, 0x4c, 0x9f, 0x9c, 0xb9, 0xed, 0xa9, 0x08, 0x3a, 0x63, 0x76, 0x6c, 0xae, 0xdf, 0x49, 0xdf, - 0x84, 0x8b, 0x7b, 0xaf, 0x82, 0x79, 0x12, 0xdc, 0x65, 0xf3, 0x8f, 0xbf, 0xfa, 0x1b, 0x00, 0x00, - 0xff, 0xff, 0x3c, 0x80, 0xb9, 0xb6, 0x3b, 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 m.Registry != nil { - { - size, err := m.Registry.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil + // 575 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xcd, 0x4e, 0xdb, 0x4e, + 0x14, 0xc5, 0x63, 0x92, 0x90, 0xe4, 0xe6, 0x03, 0xff, 0x47, 0x08, 0xcd, 0x9f, 0xaa, 0x51, 0x8a, + 0x40, 0x44, 0x5d, 0x24, 0x82, 0x76, 0xd3, 0x45, 0x17, 0x24, 0x18, 0xc9, 0x6d, 0xa0, 0x91, 0x53, + 0xa4, 0xb6, 0x1b, 0xcb, 0x8e, 0x87, 0x30, 0xc2, 0x9e, 0xb1, 0x66, 0x06, 0x8a, 0x1f, 0xa0, 0xfb, + 0x3e, 0x56, 0x97, 0x2c, 0xbb, 0xac, 0xe0, 0x45, 0x2a, 0x8f, 0x6d, 0x3e, 0xcb, 0x6e, 0xee, 0x39, + 0xbf, 0x33, 0x1a, 0xcd, 0xd1, 0x85, 0x4d, 0x49, 0x4f, 0x18, 0x0f, 0xc8, 0x50, 0xf1, 0x33, 0xc2, + 0x04, 0x59, 0x50, 0xa9, 0x44, 0x32, 0xbc, 0xd8, 0x19, 0xaa, 0x24, 0x26, 0x72, 0x10, 0x0b, 0xae, + 0x38, 0xc2, 0x39, 0x35, 0x78, 0x40, 0x0d, 0x2e, 0x76, 0xd6, 0x57, 0x17, 0x7c, 0xc1, 0x35, 0x34, + 0x4c, 0x4f, 0x19, 0xbf, 0x71, 0x08, 0x75, 0x27, 0x87, 0xd0, 0x1e, 0xd4, 0x08, 0x53, 0x82, 0x12, + 0x89, 0x8d, 0x5e, 0xb9, 0xdf, 0xdc, 0xdd, 0x1e, 0x3c, 0x77, 0xdb, 0xa0, 0x08, 0x59, 0x4c, 0x89, + 0xc4, 0x29, 0x72, 0x1b, 0x3f, 0xaa, 0xd0, 0x7e, 0x60, 0xa1, 0x75, 0xa8, 0x07, 0x64, 0x4e, 0x23, + 0x2f, 0x94, 0x78, 0xa9, 0x67, 0xf4, 0xcb, 0xce, 0xed, 0x8c, 0x56, 0xa1, 0x1a, 0x10, 0xc6, 0x23, + 0x5c, 0xee, 0x19, 0xfd, 0x86, 0x93, 0x0d, 0xe8, 0x25, 0x80, 0xef, 0x49, 0xe2, 0x66, 0x56, 0x45, + 0x5b, 0x8d, 0x54, 0xd9, 0xd7, 0x36, 0x82, 0x4a, 0xec, 0xa9, 0x53, 0x5c, 0xd5, 0x86, 0x3e, 0xa3, + 0x4d, 0xe8, 0x50, 0x7f, 0xee, 0xce, 0x4f, 0x3d, 0xc6, 0x48, 0xe8, 0xd2, 0x00, 0x2f, 0x6b, 0xb7, + 0x45, 0xfd, 0xf9, 0x38, 0x13, 0xed, 0x00, 0xbd, 0x87, 0x17, 0x9a, 0xe2, 0xe7, 0x4c, 0x11, 0x11, + 0x7b, 0x42, 0x25, 0xf7, 0x23, 0x35, 0x1d, 0xc1, 0x69, 0xe4, 0x1e, 0x71, 0x17, 0x7f, 0x05, 0xad, + 0x80, 0xca, 0x38, 0xf4, 0x12, 0x97, 0x79, 0x11, 0xc1, 0x75, 0xcd, 0x37, 0x73, 0xed, 0xc8, 0x8b, + 0x08, 0xda, 0x82, 0x4e, 0x81, 0xc8, 0x24, 0xf2, 0x79, 0x88, 0x1b, 0x1a, 0x6a, 0xe7, 0xea, 0x4c, + 0x8b, 0x08, 0x43, 0x8d, 0x11, 0xf5, 0x9d, 0x8b, 0x33, 0x0c, 0xda, 0x2f, 0xc6, 0xd4, 0xf1, 0x82, + 0x40, 0x10, 0x29, 0x71, 0x33, 0x73, 0xf2, 0x11, 0x6d, 0xc3, 0x0a, 0xb9, 0x54, 0x44,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 0xf1, 0xe7, 0xba, 0x6b, 0xfc, 0xbc, 0xe9, 0x96, 0xae, 0x6e, 0xba, 0xa5, + 0xdf, 0x37, 0xdd, 0xd2, 0xb7, 0x9d, 0x05, 0x55, 0xa7, 0xe7, 0xfe, 0x60, 0xce, 0xa3, 0xe1, 0x8c, + 0x9e, 0xe8, 0xe7, 0x0f, 0x8b, 0x1d, 0xbe, 0x7c, 0xb4, 0xc5, 0x7a, 0x85, 0xfd, 0x65, 0xbd, 0x93, + 0x6f, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0xb9, 0xaa, 0x5e, 0x23, 0xeb, 0x03, 0x00, 0x00, } func (m *Registry) Marshal() (dAtA []byte, err error) { @@ -500,20 +418,20 @@ func (m *RegistryEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x82 } if len(m.Permissions) > 0 { - dAtA3 := make([]byte, len(m.Permissions)*10) - var j2 int + dAtA2 := make([]byte, len(m.Permissions)*10) + var j1 int for _, num := range m.Permissions { for num >= 1<<7 { - dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j2++ + j1++ } - dAtA3[j2] = uint8(num) - j2++ + dAtA2[j1] = uint8(num) + j1++ } - i -= j2 - copy(dAtA[i:], dAtA3[:j2]) - i = encodeVarintTypes(dAtA, i, uint64(j2)) + i -= j1 + copy(dAtA[i:], dAtA2[:j1]) + i = encodeVarintTypes(dAtA, i, uint64(j1)) i-- dAtA[i] = 0x7a } @@ -613,19 +531,6 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Registry != nil { - l = m.Registry.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func (m *Registry) Size() (n int) { if m == nil { return 0 @@ -722,92 +627,6 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(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 ErrIntOverflowTypes - } - 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 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Registry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Registry == nil { - m.Registry = &Registry{} - } - if err := m.Registry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Registry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0