From 765aa23cb74590f0494374aa35bfee1f58978f7c Mon Sep 17 00:00:00 2001 From: deep-quality-dev <84747155+deep-quality-dev@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:45:34 +0100 Subject: [PATCH] Migration for v1.0.3 upgrade (#115) * Setup chain upgrade handler * Set store loader with default upgrades * Add migrator * Resolve cycle import * Missing interface * Remove unused code * Refactor issuer creator, return issuer creator in query response * Remove unused variable --- app/app.go | 97 +- app/setup_handler.go | 153 -- app/upgrades/v1_0_3/constants.go | 5 + app/upgrades/v1_0_3/upgrades.go | 24 + proto/swisstronik/compliance/entities.proto | 3 + proto/swisstronik/compliance/genesis.proto | 3 +- proto/swisstronik/compliance/query.proto | 1 + x/compliance/genesis.go | 4 +- x/compliance/genesis_test.go | 25 +- x/compliance/keeper/integration_test.go | 12 +- x/compliance/keeper/keeper.go | 29 +- x/compliance/keeper/keeper_test.go | 30 +- x/compliance/keeper/migrations.go | 20 + x/compliance/keeper/msg_server.go | 42 +- x/compliance/keeper/msg_server_test.go | 75 +- x/compliance/keeper/query.go | 1 + x/compliance/keeper/query_test.go | 4 +- x/compliance/migrations/v1_0_3/migrate.go | 50 + .../migrations/v1_0_3/types/entities.pb.go | 1904 +++++++++++++++++ .../migrations/v1_0_3/types/genesis.pb.go | 1327 ++++++++++++ .../migrations/v1_0_3/types/params.go | 39 + .../migrations/v1_0_3/types/params.pb.go | 265 +++ x/compliance/module.go | 12 +- x/compliance/types/entities.pb.go | 144 +- x/compliance/types/events.go | 1 + x/compliance/types/genesis.pb.go | 106 +- x/compliance/types/interfaces.go | 13 + x/compliance/types/keys.go | 2 - x/compliance/types/msg.go | 13 +- x/compliance/types/proposal_test.go | 4 +- x/compliance/types/query.pb.go | 199 +- x/evm/keeper/sgxvm_connector_test.go | 10 +- 32 files changed, 4080 insertions(+), 537 deletions(-) delete mode 100644 app/setup_handler.go create mode 100644 app/upgrades/v1_0_3/constants.go create mode 100644 app/upgrades/v1_0_3/upgrades.go create mode 100644 x/compliance/keeper/migrations.go create mode 100644 x/compliance/migrations/v1_0_3/migrate.go create mode 100644 x/compliance/migrations/v1_0_3/types/entities.pb.go create mode 100644 x/compliance/migrations/v1_0_3/types/genesis.pb.go create mode 100644 x/compliance/migrations/v1_0_3/types/params.go create mode 100644 x/compliance/migrations/v1_0_3/types/params.pb.go create mode 100644 x/compliance/types/interfaces.go diff --git a/app/app.go b/app/app.go index 56f52fa1..1b282c56 100644 --- a/app/app.go +++ b/app/app.go @@ -9,42 +9,35 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" - "github.com/cosmos/cosmos-sdk/runtime" - runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" - - "swisstronik/x/evm" - "swisstronik/x/feemarket" - - "github.com/cosmos/cosmos-sdk/x/auth/posthandler" - "github.com/cosmos/cosmos-sdk/x/group" - "github.com/gorilla/mux" - "github.com/rakyll/statik/fs" - + simappparams "cosmossdk.io/simapp/params" + dbm "github.com/cometbft/cometbft-db" + abci "github.com/cometbft/cometbft/abci/types" + tmjson "github.com/cometbft/cometbft/libs/json" + "github.com/cometbft/cometbft/libs/log" + tmos "github.com/cometbft/cometbft/libs/os" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/store/streaming" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/mempool" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + "github.com/cosmos/cosmos-sdk/x/auth/posthandler" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - dbm "github.com/cometbft/cometbft-db" - abci "github.com/cometbft/cometbft/abci/types" - tmjson "github.com/cometbft/cometbft/libs/json" - "github.com/cometbft/cometbft/libs/log" - tmos "github.com/cometbft/cometbft/libs/os" "github.com/cosmos/cosmos-sdk/x/authz" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" @@ -54,6 +47,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/capability" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/cosmos-sdk/x/consensus" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" @@ -74,7 +70,7 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - + "github.com/cosmos/cosmos-sdk/x/group" "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -114,36 +110,30 @@ import ( ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" ibctesting "github.com/cosmos/ibc-go/v7/testing" ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types" + "github.com/gorilla/mux" + "github.com/rakyll/statik/fs" "github.com/spf13/cast" - vestingmodule "swisstronik/x/vesting" - vestingmodulekeeper "swisstronik/x/vesting/keeper" - vestingmoduletypes "swisstronik/x/vesting/types" - - compliancemodule "swisstronik/x/compliance" - compliancemoduleclient "swisstronik/x/compliance/client" - compliancemodulekeeper "swisstronik/x/compliance/keeper" - compliancemoduletypes "swisstronik/x/compliance/types" - + evmante "swisstronik/app/ante" + "swisstronik/app/upgrades/v1_0_3" "swisstronik/docs" "swisstronik/encoding" - - simappparams "cosmossdk.io/simapp/params" - - evmante "swisstronik/app/ante" + "swisstronik/ethereum/eip712" srvflags "swisstronik/server/flags" evmcommontypes "swisstronik/types" + compliancemodule "swisstronik/x/compliance" + compliancemoduleclient "swisstronik/x/compliance/client" + compliancemodulekeeper "swisstronik/x/compliance/keeper" + compliancemoduletypes "swisstronik/x/compliance/types" + "swisstronik/x/evm" evmkeeper "swisstronik/x/evm/keeper" evmtypes "swisstronik/x/evm/types" + "swisstronik/x/feemarket" feemarketkeeper "swisstronik/x/feemarket/keeper" feemarkettypes "swisstronik/x/feemarket/types" - - "swisstronik/ethereum/eip712" - - "github.com/cosmos/cosmos-sdk/types/mempool" - "github.com/cosmos/cosmos-sdk/x/consensus" - consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + vestingmodule "swisstronik/x/vesting" + vestingmodulekeeper "swisstronik/x/vesting/keeper" + vestingmoduletypes "swisstronik/x/vesting/types" ) const ( @@ -803,7 +793,7 @@ func New( app.setAnteHandler(encodingConfig.TxConfig, maxGasWanted) app.setPostHandler() app.SetEndBlocker(app.EndBlocker) - SetupHandlers(app, app.EvmKeeper, app.IBCKeeper.ClientKeeper, app.ParamsKeeper, appCodec) + app.setupUpgradeHandlers() if loadLatest { if err := app.LoadLatestVersion(); err != nil { @@ -1068,6 +1058,35 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino return paramsKeeper } +func (app *App) setupUpgradeHandlers() { + app.UpgradeKeeper.SetUpgradeHandler( + v1_0_3.UpgradeName, + v1_0_3.CreateUpgradeHandler( + app.mm, app.configurator, + ), + ) + + // When a planned update height is reached, the old binary will panic + // writing on disk the height and name of the update that triggered it + // This will read that value, and execute the preparations for the upgrade. + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(fmt.Errorf("failed to read upgrade info from disk: %w", err)) + } + + if app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + return + } + + if upgradeInfo.Name == v1_0_3.UpgradeName { + // 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, + // so that new stores start with the correct version (the current height of chain), + // instead the default which is the latest version that store last committed i.e 0 for new stores. + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storetypes.StoreUpgrades{})) + } +} + // SimulationManager implements runtime.AppI func (*App) SimulationManager() *module.SimulationManager { panic("unimplemented") diff --git a/app/setup_handler.go b/app/setup_handler.go deleted file mode 100644 index 33636dc2..00000000 --- a/app/setup_handler.go +++ /dev/null @@ -1,153 +0,0 @@ -package app - -import ( - evmkeeper "swisstronik/x/evm/keeper" - evmmoduletypes "swisstronik/x/evm/types" - feemarketmoduletypes "swisstronik/x/feemarket/types" - vestmoduletypes "swisstronik/x/vesting/types" - - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/codec" - 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" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" - crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations" -) - -func SetupHandlers( - app *App, - ek *evmkeeper.Keeper, - clientKeeper ibctmmigrations.ClientKeeper, - pk paramskeeper.Keeper, - cdc codec.BinaryCodec) { - setUpgradeHandler(app, ek, clientKeeper, pk, cdc) - - loadUpgradeStore(app) -} - -func setUpgradeHandler( - app *App, - ek *evmkeeper.Keeper, - clientKeeper ibctmmigrations.ClientKeeper, - pk paramskeeper.Keeper, - cdc codec.BinaryCodec) { - // Set param key table for params module migration - for _, subspace := range app.ParamsKeeper.GetSubspaces() { - subspace := subspace - - app.Logger().Info("Setting up upgrade handler for " + subspace.Name()) - - var keyTable paramstypes.KeyTable - switch subspace.Name() { - case authtypes.ModuleName: - keyTable = authtypes.ParamKeyTable() //nolint:staticcheck - case banktypes.ModuleName: - keyTable = banktypes.ParamKeyTable() //nolint:staticcheck - case stakingtypes.ModuleName: - keyTable = stakingtypes.ParamKeyTable() //nolint:staticcheck - case minttypes.ModuleName: - keyTable = minttypes.ParamKeyTable() //nolint:staticcheck - case slashingtypes.ModuleName: - keyTable = slashingtypes.ParamKeyTable() //nolint:staticcheck - case govtypes.ModuleName: - keyTable = govv1.ParamKeyTable() //nolint:staticcheck - case crisistypes.ModuleName: - keyTable = crisistypes.ParamKeyTable() //nolint:staticcheck - case evmmoduletypes.ModuleName: - keyTable = evmmoduletypes.ParamKeyTable() - case feemarketmoduletypes.ModuleName: - keyTable = feemarketmoduletypes.ParamKeyTable() - case vestmoduletypes.ModuleName: - keyTable = vestmoduletypes.ParamKeyTable() - case distrtypes.ModuleName: - keyTable = distrtypes.ParamKeyTable() - default: - continue - } - - if !subspace.HasKeyTable() { - subspace.WithKeyTable(keyTable) - } - } - - baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) - - app.UpgradeKeeper.SetUpgradeHandler( - version.Version, - func(ctx sdk.Context, plan upgradetypes.Plan, vm m.VersionMap) (m.VersionMap, error) { - app.Logger().Info("Running upgrade handler for " + version.Version) - - // Migrate Tendermint consensus parameters from x/params module to a - // dedicated x/consensus module. - baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper) - - // Include this when migrating to ibc-go v7 (optional) - // source: https://github.com/cosmos/ibc-go/blob/v7.2.0/docs/migrations/v6-to-v7.md - // prune expired tendermint consensus states to save storage space - if _, err := ibctmmigrations.PruneExpiredConsensusStates(ctx, cdc, clientKeeper); err != nil { - return nil, err - } - // !! ATTENTION !! - - // Add EIP contained in Shanghai hard fork to the extra EIPs - // in the EVM parameters. This enables using the PUSH0 opcode and - // thus supports Solidity v0.8.20. - // - app.Logger().Info("adding EIP 3855 to EVM parameters") - err := EnableEIPs(ctx, ek, 3855) - if err != nil { - app.Logger().Error("error while enabling EIPs", "error", err) - } - - app.Logger().Debug("running module migrations ...") - return app.mm.RunMigrations(ctx, app.configurator, vm) - }, - ) -} - -// EnableEIPs enables the given EIPs in the EVM parameters. -func EnableEIPs(ctx sdk.Context, ek *evmkeeper.Keeper, eips ...int64) error { - evmParams := ek.GetParams(ctx) - evmParams.ExtraEIPs = append(evmParams.ExtraEIPs, eips...) - - return ek.SetParams(ctx, evmParams) -} - -func loadUpgradeStore(app *App) { - upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() - if err != nil { - panic(err) - } - - if shouldLoadUpgradeStore(app, upgradeInfo) { - storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{ - consensusparamtypes.StoreKey, - crisistypes.ModuleName, - }, - } - // 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, - // so that new stores start with the correct version (the current height of chain), - // instead the default which is the latest version that store last committed i.e 0 for new stores. - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) - } -} - -func shouldLoadUpgradeStore(app *App, upgradeInfo upgradetypes.Plan) bool { - return upgradeInfo.Name == version.Version && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) -} diff --git a/app/upgrades/v1_0_3/constants.go b/app/upgrades/v1_0_3/constants.go new file mode 100644 index 00000000..ee7efae4 --- /dev/null +++ b/app/upgrades/v1_0_3/constants.go @@ -0,0 +1,5 @@ +package v1_0_3 + +const ( + UpgradeName = "v1.0.3" +) diff --git a/app/upgrades/v1_0_3/upgrades.go b/app/upgrades/v1_0_3/upgrades.go new file mode 100644 index 00000000..5579d8c0 --- /dev/null +++ b/app/upgrades/v1_0_3/upgrades.go @@ -0,0 +1,24 @@ +package v1_0_3 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info("Starting module migrations...") + + vm, err := mm.RunMigrations(ctx, configurator, vm) + if err != nil { + return vm, err + } + + ctx.Logger().Info("Upgrade complete") + return vm, err + } +} diff --git a/proto/swisstronik/compliance/entities.proto b/proto/swisstronik/compliance/entities.proto index f3988c93..6ed41ebb 100644 --- a/proto/swisstronik/compliance/entities.proto +++ b/proto/swisstronik/compliance/entities.proto @@ -40,6 +40,7 @@ message OperatorDetails { message IssuerDetails { // Allows to easily understand // what entity can be associated with issuer address. + // Issuer name string name = 1; // Basic issuer description string description = 2; @@ -49,6 +50,8 @@ message IssuerDetails { string logo = 4; // Legal entity name string legalEntity = 5; + // Issuer creator who created current issuer + string creator = 6; } message AddressDetails { diff --git a/proto/swisstronik/compliance/genesis.proto b/proto/swisstronik/compliance/genesis.proto index 15fc9732..920f35e8 100644 --- a/proto/swisstronik/compliance/genesis.proto +++ b/proto/swisstronik/compliance/genesis.proto @@ -18,8 +18,7 @@ message GenesisState { message GenesisIssuerDetails { string address = 1; - string creator = 2; - IssuerDetails details = 3; + IssuerDetails details = 2; } message GenesisAddressDetails { diff --git a/proto/swisstronik/compliance/query.proto b/proto/swisstronik/compliance/query.proto index 7bd5323d..b6d425d4 100644 --- a/proto/swisstronik/compliance/query.proto +++ b/proto/swisstronik/compliance/query.proto @@ -125,6 +125,7 @@ message QueryIssuersDetailsResponse { string url = 4; string logo = 5; string legalEntity = 6; + string creator = 7; } // issuers is a slice of registered issuers for the compliance module diff --git a/x/compliance/genesis.go b/x/compliance/genesis.go index 945df495..d9efad26 100644 --- a/x/compliance/genesis.go +++ b/x/compliance/genesis.go @@ -32,11 +32,11 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) if err != nil { panic(err) } - creator, err := sdk.AccAddressFromBech32(issuerData.Creator) + _, err = sdk.AccAddressFromBech32(issuerData.Details.Creator) if err != nil { panic(err) } - if err = k.SetIssuerDetails(ctx, creator, address, issuerData.Details); err != nil { + if err = k.SetIssuerDetails(ctx, address, issuerData.Details); err != nil { panic(err) } } diff --git a/x/compliance/genesis_test.go b/x/compliance/genesis_test.go index dfc05e98..e1afeb4c 100644 --- a/x/compliance/genesis_test.go +++ b/x/compliance/genesis_test.go @@ -66,9 +66,10 @@ func TestInitGenesis_Validation(t *testing.T) { IssuerDetails: []*types.GenesisIssuerDetails{ { Address: "swtr199wynlfwhj6ytkvujjf6mel5z7fl0mwzqck8l6", - Creator: "invalid issuer creator", // invalid issuer creator + // Creator: "", // missing issuer creator Details: &types.IssuerDetails{ - Name: "test issuer", + Creator: "invalid issuer creator", // invalid issuer creator + Name: "test issuer", }, }, }, @@ -160,9 +161,9 @@ func TestInitGenesis_Validation(t *testing.T) { IssuerDetails: []*types.GenesisIssuerDetails{ { Address: "swtr199wynlfwhj6ytkvujjf6mel5z7fl0mwzqck8l6", - Creator: "swtr1734tyvkylw3f7vc9xmwxp6g5n79qvsrvjhsvs4", Details: &types.IssuerDetails{ - Name: "test issuer", + Creator: "swtr1734tyvkylw3f7vc9xmwxp6g5n79qvsrvjhsvs4", + Name: "test issuer", }, }, }, @@ -190,9 +191,9 @@ func TestInitGenesis_Validation(t *testing.T) { IssuerDetails: []*types.GenesisIssuerDetails{ { Address: "swtr199wynlfwhj6ytkvujjf6mel5z7fl0mwzqck8l6", - Creator: "swtr1734tyvkylw3f7vc9xmwxp6g5n79qvsrvjhsvs4", Details: &types.IssuerDetails{ - Name: "test issuer", + Creator: "swtr1734tyvkylw3f7vc9xmwxp6g5n79qvsrvjhsvs4", + Name: "test issuer", }, }, }, @@ -231,9 +232,9 @@ func TestInitGenesis_Validation(t *testing.T) { IssuerDetails: []*types.GenesisIssuerDetails{ { Address: "swtr199wynlfwhj6ytkvujjf6mel5z7fl0mwzqck8l6", - Creator: "swtr1734tyvkylw3f7vc9xmwxp6g5n79qvsrvjhsvs4", Details: &types.IssuerDetails{ - Name: "test issuer", + Creator: "swtr1734tyvkylw3f7vc9xmwxp6g5n79qvsrvjhsvs4", + Name: "test issuer", }, }, }, @@ -311,15 +312,15 @@ func TestGenesis_Success(t *testing.T) { IssuerDetails: []*types.GenesisIssuerDetails{ { Address: "swtr199wynlfwhj6ytkvujjf6mel5z7fl0mwzqck8l6", - Creator: "swtr16vgqffr8v0sh3n5qeqdksfpzdkqf3rtk49thun", Details: &types.IssuerDetails{ - Name: "test issuer", + Creator: "swtr16vgqffr8v0sh3n5qeqdksfpzdkqf3rtk49thun", + Name: "test issuer", }, }, { Address: "swtr13wl63dpe3xdhzvphp32cm9cv2vs9nvhkpaspwu", - Creator: "swtr16vgqffr8v0sh3n5qeqdksfpzdkqf3rtk49thun", Details: &types.IssuerDetails{ + Creator: "swtr16vgqffr8v0sh3n5qeqdksfpzdkqf3rtk49thun", Name: "test issuer2", Description: "test description2", }, @@ -416,11 +417,9 @@ func TestGenesis_Success(t *testing.T) { for _, issuerData := range tc.genState.IssuerDetails { address, err := sdk.AccAddressFromBech32(issuerData.Address) require.NoError(t, err) - creator := k.GetIssuerCreator(ctx, address) details, err := k.GetIssuerDetails(ctx, address) require.NoError(t, err) require.NotNil(t, details) - require.Equal(t, issuerData.Creator, creator.String()) require.Equal(t, issuerData.Details, details) } diff --git a/x/compliance/keeper/integration_test.go b/x/compliance/keeper/integration_test.go index 8412f5c7..9a082fb9 100644 --- a/x/compliance/keeper/integration_test.go +++ b/x/compliance/keeper/integration_test.go @@ -64,8 +64,8 @@ var _ = Describe("VerifyIssuer", Ordered, func() { Describe("valid issuer has been verified", func() { BeforeEach(func() { // Set issuer details(not verified) - issuerDetails := &types.IssuerDetails{Name: "test issuer"} - _ = s.keeper.SetIssuerDetails(s.ctx, issuerCreator, validIssuer, issuerDetails) + issuerDetails := &types.IssuerDetails{Creator: issuerCreator.String(), Name: "test issuer"} + _ = s.keeper.SetIssuerDetails(s.ctx, validIssuer, issuerDetails) // Submit proposal with sufficient deposit content := types.NewVerifyIssuerProposal("test title", "test description", validIssuer.String()) @@ -101,8 +101,8 @@ var _ = Describe("VerifyIssuer", Ordered, func() { Describe("invalid issuer has not been verified", func() { BeforeEach(func() { // Set issuer details(not verified) - issuerDetails := &types.IssuerDetails{Name: "test issuer"} - _ = s.keeper.SetIssuerDetails(s.ctx, issuerCreator, invalidIssuer, issuerDetails) + issuerDetails := &types.IssuerDetails{Creator: issuerCreator.String(), Name: "test issuer"} + _ = s.keeper.SetIssuerDetails(s.ctx, invalidIssuer, issuerDetails) // Submit proposal with sufficient deposit content := types.NewVerifyIssuerProposal("test title", "test description", invalidIssuer.String()) @@ -133,8 +133,8 @@ var _ = Describe("VerifyIssuer", Ordered, func() { Describe("should not create a proposal for verified issuer", func() { BeforeEach(func() { // Set issuer details(verified) - issuerDetails := &types.IssuerDetails{Name: "test issuer"} - _ = s.keeper.SetIssuerDetails(s.ctx, issuerCreator, validIssuer, issuerDetails) + issuerDetails := &types.IssuerDetails{Creator: issuerCreator.String(), Name: "test issuer"} + _ = s.keeper.SetIssuerDetails(s.ctx, validIssuer, issuerDetails) _ = s.keeper.SetAddressVerificationStatus(s.ctx, validIssuer, true) }) It("should fail in submitting proposal", func() { diff --git a/x/compliance/keeper/keeper.go b/x/compliance/keeper/keeper.go index 1fc32c8e..d6b3b2fb 100644 --- a/x/compliance/keeper/keeper.go +++ b/x/compliance/keeper/keeper.go @@ -45,7 +45,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { } // SetIssuerDetails sets details for provided issuer address -func (k Keeper) SetIssuerDetails(ctx sdk.Context, issuerCreatorAddress, issuerAddress sdk.AccAddress, details *types.IssuerDetails) error { +func (k Keeper) SetIssuerDetails(ctx sdk.Context, issuerAddress sdk.AccAddress, details *types.IssuerDetails) error { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixIssuerDetails) detailsBytes, err := details.Marshal() @@ -55,7 +55,6 @@ func (k Keeper) SetIssuerDetails(ctx sdk.Context, issuerCreatorAddress, issuerAd store.Set(issuerAddress.Bytes(), detailsBytes) - k.SetIssuerCreator(ctx, issuerAddress, issuerCreatorAddress) return nil } @@ -88,24 +87,6 @@ func (k Keeper) GetIssuerDetails(ctx sdk.Context, issuerAddress sdk.AccAddress) return &issuerDetails, nil } -// GetIssuerCreator returns issuer creator's address -func (k Keeper) GetIssuerCreator(ctx sdk.Context, issuerAddress sdk.AccAddress) sdk.AccAddress { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixIssuerCreators) - - detailsBytes := store.Get(issuerAddress.Bytes()) - if detailsBytes == nil { - return nil - } - - return detailsBytes -} - -// SetIssuerCreator writes issuer creator's address -func (k Keeper) SetIssuerCreator(ctx sdk.Context, issuerAddress, issuerCreatorAddress sdk.AccAddress) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixIssuerCreators) - store.Set(issuerAddress.Bytes(), issuerCreatorAddress.Bytes()) -} - // IssuerExists checks if issuer exists by checking operator address func (k Keeper) IssuerExists(ctx sdk.Context, issuerAddress sdk.AccAddress) (bool, error) { res, err := k.GetIssuerDetails(ctx, issuerAddress) @@ -622,13 +603,9 @@ func (k Keeper) ExportIssuerDetails(ctx sdk.Context) ([]*types.GenesisIssuerDeta if err != nil { return false } - creator := k.GetIssuerCreator(ctx, address) - if creator == nil { - return false - } issuerDetails = append(issuerDetails, &types.GenesisIssuerDetails{ - Creator: creator.String(), - Address: address.String(), Details: details, + Address: address.String(), + Details: details, }) return true }) diff --git a/x/compliance/keeper/keeper_test.go b/x/compliance/keeper/keeper_test.go index 060a2bd1..1c6f33fc 100644 --- a/x/compliance/keeper/keeper_test.go +++ b/x/compliance/keeper/keeper_test.go @@ -116,10 +116,9 @@ func (suite *KeeperTestSuite) CommitAfter(t time.Duration) { } func (suite *KeeperTestSuite) TestCreateSimpleAndFetchSimpleIssuer() { - details := &types.IssuerDetails{Name: "testIssuer"} - creator := tests.RandomAccAddress() + details := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "testIssuer"} issuer := tests.RandomAccAddress() - err := suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + err := suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) suite.Require().NoError(err) i, err := suite.keeper.GetIssuerDetails(suite.ctx, issuer) suite.Require().Equal(details, i) @@ -139,10 +138,9 @@ func (suite *KeeperTestSuite) TestNonExistingIssuer() { } func (suite *KeeperTestSuite) TestSuspendedIssuer() { - details := &types.IssuerDetails{Name: "testIssuer"} - creator := tests.RandomAccAddress() + details := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "testIssuer"} issuer := tests.RandomAccAddress() - err := suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + err := suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) suite.Require().NoError(err) // Revoke verification status for test issuer @@ -174,10 +172,9 @@ func (suite *KeeperTestSuite) TestSuspendedIssuer() { } func (suite *KeeperTestSuite) TestRemovedIssuer() { - issuerDetails := &types.IssuerDetails{Name: "testIssuer"} - creator := tests.RandomAccAddress() + issuerDetails := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "testIssuer"} issuer := tests.RandomAccAddress() - err := suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, issuerDetails) + err := suite.keeper.SetIssuerDetails(suite.ctx, issuer, issuerDetails) suite.Require().NoError(err) err = suite.keeper.SetAddressVerificationStatus(suite.ctx, issuer, true) @@ -238,10 +235,9 @@ func (suite *KeeperTestSuite) TestRemovedIssuer() { } func (suite *KeeperTestSuite) TestAddVerificationDetails() { - details := &types.IssuerDetails{Name: "testIssuer"} - creator := tests.RandomAccAddress() + details := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "testIssuer"} issuer := tests.RandomAccAddress() - err := suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + err := suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) suite.Require().NoError(err) err = suite.keeper.SetAddressVerificationStatus(suite.ctx, issuer, true) @@ -311,10 +307,9 @@ func (suite *KeeperTestSuite) TestAddVerificationDetails() { } func (suite *KeeperTestSuite) TestAddressDetailsCRUD() { - issuerDetails := &types.IssuerDetails{Name: "testIssuer"} - creator := tests.RandomAccAddress() + issuerDetails := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "testIssuer"} issuer := tests.RandomAccAddress() - err := suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, issuerDetails) + err := suite.keeper.SetIssuerDetails(suite.ctx, issuer, issuerDetails) suite.Require().NoError(err) address := tests.RandomAccAddress() @@ -385,10 +380,9 @@ func (suite *KeeperTestSuite) TestAddressDetailsSetVerificationStatus() { } func (suite *KeeperTestSuite) TestSetVerificationDetails() { - creator := tests.RandomAccAddress() issuer := tests.RandomAccAddress() - issuerDetails := &types.IssuerDetails{Name: "testIssuer"} - err := suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, issuerDetails) + issuerDetails := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "testIssuer"} + err := suite.keeper.SetIssuerDetails(suite.ctx, issuer, issuerDetails) suite.Require().NoError(err) verificationDetails := &types.VerificationDetails{ diff --git a/x/compliance/keeper/migrations.go b/x/compliance/keeper/migrations.go new file mode 100644 index 00000000..1dc16cf1 --- /dev/null +++ b/x/compliance/keeper/migrations.go @@ -0,0 +1,20 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "swisstronik/x/compliance/migrations/v1_0_3" +) + +type Migrator struct { + keeper Keeper +} + +func NewMigrator(keeper Keeper) Migrator { + return Migrator{ + keeper: keeper, + } +} + +func (m Migrator) Migrate1_0_2to1_0_3(ctx sdk.Context) error { + return v1_0_3.MigrateStore(ctx, m.keeper) +} diff --git a/x/compliance/keeper/msg_server.go b/x/compliance/keeper/msg_server.go index faee441f..f8355f37 100644 --- a/x/compliance/keeper/msg_server.go +++ b/x/compliance/keeper/msg_server.go @@ -163,8 +163,10 @@ func (k msgServer) HandleCreateIssuer(goCtx context.Context, msg *types.MsgCreat return nil, errors.Wrap(types.ErrInvalidIssuer, "issuer already exists") } + msg.Details.Creator = signer.String() + // Store issuer details with creator address - if err = k.SetIssuerDetails(ctx, signer, issuer, msg.Details); err != nil { + if err = k.SetIssuerDetails(ctx, issuer, msg.Details); err != nil { return nil, err } @@ -176,7 +178,7 @@ func (k msgServer) HandleCreateIssuer(goCtx context.Context, msg *types.MsgCreat ctx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeAddIssuer, - sdk.NewAttribute(types.AttributeKeyOperator, msg.Signer), + sdk.NewAttribute(types.AttributeKeyIssuerCreator, msg.Signer), sdk.NewAttribute(types.AttributeKeyIssuer, msg.Issuer), sdk.NewAttribute(types.AttributeKeyIssuerDetails, msg.Details.String()), ), @@ -200,31 +202,32 @@ func (k msgServer) HandleUpdateIssuerDetails(goCtx context.Context, msg *types.M return nil, err } + details, err := k.GetIssuerDetails(ctx, issuer) + if err != nil || len(details.Name) < 1 { + return nil, errors.Wrap(types.ErrInvalidIssuer, "issuer does not exist") + } + // Operator or issuer creator can update issuer - creator := k.GetIssuerCreator(ctx, issuer) - if !signer.Equals(creator) { + if details.Creator != signer.String() { if exists, err := k.OperatorExists(ctx, signer); !exists || err != nil { - return nil, types.ErrNotOperatorOrIssuerCreator + // If signer is neither an operator nor issuer creator + return nil, errors.Wrap(types.ErrNotOperatorOrIssuerCreator, "issuer creator does not match") } } - if exists, err := k.IssuerExists(ctx, issuer); !exists || err != nil { - return nil, errors.Wrap(types.ErrInvalidIssuer, "issuer does not exist") - } - // Revoke verification if address was verified if err = k.SetAddressVerificationStatus(ctx, issuer, false); err != nil { return nil, err } - if err = k.SetIssuerDetails(ctx, creator, issuer, msg.Details); err != nil { + if err = k.SetIssuerDetails(ctx, issuer, msg.Details); err != nil { return nil, err } ctx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeUpdateIssuer, - sdk.NewAttribute(types.AttributeKeyOperator, msg.Signer), + sdk.NewAttribute(types.AttributeKeyIssuerCreator, msg.Signer), sdk.NewAttribute(types.AttributeKeyIssuer, msg.Issuer), sdk.NewAttribute(types.AttributeKeyIssuerDetails, msg.Details.String()), ), @@ -248,24 +251,25 @@ func (k msgServer) HandleRemoveIssuer(goCtx context.Context, msg *types.MsgRemov return nil, err } + details, err := k.GetIssuerDetails(ctx, issuer) + if err != nil || len(details.Name) < 1 { + return nil, errors.Wrap(types.ErrInvalidIssuer, "issuer does not exist") + } + // Operator or issuer creator can update issuer - creator := k.GetIssuerCreator(ctx, issuer) - if !signer.Equals(creator) { + if details.Creator != signer.String() { if exists, err := k.OperatorExists(ctx, signer); !exists || err != nil { - return nil, types.ErrNotOperatorOrIssuerCreator + // If signer is neither an operator nor issuer creator + return nil, errors.Wrap(types.ErrNotOperatorOrIssuerCreator, "issuer creator does not match") } } - if exists, err := k.IssuerExists(ctx, issuer); !exists || err != nil { - return nil, errors.Wrap(types.ErrInvalidIssuer, "issuer does not exist") - } - k.RemoveIssuer(ctx, issuer) ctx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeRemoveIssuer, - sdk.NewAttribute(types.AttributeKeyOperator, msg.Signer), + sdk.NewAttribute(types.AttributeKeyIssuerCreator, msg.Signer), sdk.NewAttribute(types.AttributeKeyIssuer, msg.Issuer), ), ) diff --git a/x/compliance/keeper/msg_server_test.go b/x/compliance/keeper/msg_server_test.go index f4197585..949fe54e 100644 --- a/x/compliance/keeper/msg_server_test.go +++ b/x/compliance/keeper/msg_server_test.go @@ -272,7 +272,6 @@ func (suite *KeeperTestSuite) TestRemoveOperator() { func (suite *KeeperTestSuite) TestSetVerificationStatus() { var ( operator sdk.AccAddress - creator sdk.AccAddress issuer sdk.AccAddress ) testCases := []struct { @@ -344,11 +343,10 @@ func (suite *KeeperTestSuite) TestSetVerificationStatus() { err := suite.keeper.AddOperator(suite.ctx, operator, types.OperatorType_OT_REGULAR) suite.Require().NoError(err) - creator = tests.RandomAccAddress() issuer = tests.RandomAccAddress() - details := &types.IssuerDetails{Name: "testIssuer"} - err = suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + details := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "testIssuer"} + err = suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) suite.Require().NoError(err) }, malleate: func() *types.MsgSetVerificationStatus { @@ -473,13 +471,10 @@ func (suite *KeeperTestSuite) TestCreateIssuer() { suite.Require().NoError(err) suite.Require().Equal(false, addressDetails.IsVerified) - // Check if creator is operator - issuerCreator := suite.keeper.GetIssuerCreator(suite.ctx, issuer) - suite.Require().Equal(operator, issuerCreator) - // Check if issuer details are stored correctly details, err := suite.keeper.GetIssuerDetails(suite.ctx, issuer) suite.Require().NoError(err) + suite.Require().Equal(operator.String(), details.Creator) suite.Require().Equal("issuer name", details.Name) suite.Require().Equal("issuer description", details.Description) suite.Require().Equal("issuer url", details.Url) @@ -524,14 +519,11 @@ func (suite *KeeperTestSuite) TestCreateIssuer() { suite.Require().NoError(err) suite.Require().Equal(false, addressDetails.IsVerified) - // Check if creator is operator - issuerCreator := suite.keeper.GetIssuerCreator(suite.ctx, issuer) - suite.Require().NotEqual(operator, issuerCreator) - suite.Require().Equal(creator, issuerCreator) - // Check if issuer details are stored correctly details, err := suite.keeper.GetIssuerDetails(suite.ctx, issuer) suite.Require().NoError(err) + suite.Require().NotEqual(operator.String(), details.Creator) + suite.Require().Equal(creator.String(), details.Creator) suite.Require().Equal("issuer name", details.Name) suite.Require().Equal("issuer description", details.Description) suite.Require().Equal("issuer url", details.Url) @@ -547,10 +539,9 @@ func (suite *KeeperTestSuite) TestCreateIssuer() { { name: "existing issuer", init: func() { - details := &types.IssuerDetails{Name: "test issuer"} - creator = tests.RandomAccAddress() + details := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "test issuer"} issuer = tests.RandomAccAddress() - _ = suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + _ = suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) operator = tests.RandomAccAddress() @@ -623,10 +614,15 @@ func (suite *KeeperTestSuite) TestUpdateIssuerDetails() { }, }, { - name: "not operator", + name: "issuer creator does not match", init: func() { issuer = tests.RandomAccAddress() + creator = tests.RandomAccAddress() operator = tests.RandomAccAddress() + + issuer = tests.RandomAccAddress() + details := &types.IssuerDetails{Creator: creator.String(), Name: "test issuer"} + _ = suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) }, malleate: func() *types.MsgUpdateIssuerDetails { msg := types.NewUpdateIssuerDetailsMsg( @@ -646,7 +642,7 @@ func (suite *KeeperTestSuite) TestUpdateIssuerDetails() { }, }, { - name: "issuer not exist", + name: "issuer does not exist", init: func() { issuer = tests.RandomAccAddress() operator = tests.RandomAccAddress() @@ -678,8 +674,8 @@ func (suite *KeeperTestSuite) TestUpdateIssuerDetails() { suite.Require().NoError(err) issuer = tests.RandomAccAddress() - details := &types.IssuerDetails{Name: "test issuer"} - _ = suite.keeper.SetIssuerDetails(suite.ctx, operator, issuer, details) + details := &types.IssuerDetails{Creator: operator.String(), Name: "test issuer"} + _ = suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) }, malleate: func() *types.MsgUpdateIssuerDetails { msg := types.NewUpdateIssuerDetailsMsg( @@ -707,13 +703,10 @@ func (suite *KeeperTestSuite) TestUpdateIssuerDetails() { suite.Require().NoError(err) suite.Require().Equal(false, addressDetails.IsVerified) - // Check if creator is operator - issuerCreator := suite.keeper.GetIssuerCreator(suite.ctx, issuer) - suite.Require().Equal(operator, issuerCreator) - // Check if issuer details are stored correctly details, err := suite.keeper.GetIssuerDetails(suite.ctx, issuer) suite.Require().NoError(err) + suite.Require().Equal(operator.String(), details.Creator) suite.Require().Equal("issuer name", details.Name) suite.Require().Equal("issuer description", details.Description) suite.Require().Equal("issuer url", details.Url) @@ -731,12 +724,13 @@ func (suite *KeeperTestSuite) TestUpdateIssuerDetails() { init: func() { creator = tests.RandomAccAddress() issuer = tests.RandomAccAddress() - details := &types.IssuerDetails{Name: "test issuer"} - _ = suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + + details := &types.IssuerDetails{Creator: creator.String(), Name: "test issuer"} + _ = suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) }, malleate: func() *types.MsgUpdateIssuerDetails { msg := types.NewUpdateIssuerDetailsMsg( - operator.String(), + creator.String(), issuer.String(), "issuer name", "issuer description", @@ -760,14 +754,11 @@ func (suite *KeeperTestSuite) TestUpdateIssuerDetails() { suite.Require().NoError(err) suite.Require().Equal(false, addressDetails.IsVerified) - // Check if creator is operator - issuerCreator := suite.keeper.GetIssuerCreator(suite.ctx, issuer) - suite.Require().NotEqual(operator, issuerCreator) - suite.Require().Equal(creator, issuerCreator) - // Check if issuer details are stored correctly details, err := suite.keeper.GetIssuerDetails(suite.ctx, issuer) suite.Require().NoError(err) + suite.Require().NotEqual(operator.String(), details.Creator) + suite.Require().Equal(creator.String(), details.Creator) suite.Require().Equal("issuer name", details.Name) suite.Require().Equal("issuer description", details.Description) suite.Require().Equal("issuer url", details.Url) @@ -790,8 +781,8 @@ func (suite *KeeperTestSuite) TestUpdateIssuerDetails() { creator = tests.RandomAccAddress() issuer = tests.RandomAccAddress() - details := &types.IssuerDetails{Name: "test issuer"} - _ = suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + details := &types.IssuerDetails{Creator: creator.String(), Name: "test issuer"} + _ = suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) _ = suite.keeper.SetAddressVerificationStatus(suite.ctx, issuer, true) @@ -856,7 +847,6 @@ func (suite *KeeperTestSuite) TestUpdateIssuerDetails() { func (suite *KeeperTestSuite) TestRemoveIssuer() { var ( - creator sdk.AccAddress issuer sdk.AccAddress operator sdk.AccAddress signer sdk.AccAddress @@ -898,10 +888,9 @@ func (suite *KeeperTestSuite) TestRemoveIssuer() { { name: "not operator", init: func() { - details := &types.IssuerDetails{Name: "test issuer"} - creator = tests.RandomAccAddress() issuer = tests.RandomAccAddress() - _ = suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + details := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "test issuer"} + _ = suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) operator = tests.RandomAccAddress() }, @@ -921,10 +910,9 @@ func (suite *KeeperTestSuite) TestRemoveIssuer() { err := suite.keeper.AddOperator(suite.ctx, operator, types.OperatorType_OT_REGULAR) suite.Require().NoError(err) - creator = tests.RandomAccAddress() issuer = tests.RandomAccAddress() - details := &types.IssuerDetails{Name: "test issuer"} - _ = suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + details := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "test issuer"} + _ = suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) }, malleate: func() *types.MsgRemoveIssuer { msg := types.NewRemoveIssuerMsg(operator.String(), issuer.String()) @@ -958,10 +946,9 @@ func (suite *KeeperTestSuite) TestRemoveIssuer() { err := suite.keeper.AddOperator(suite.ctx, operator, types.OperatorType_OT_REGULAR) suite.Require().NoError(err) - creator = tests.RandomAccAddress() issuer = tests.RandomAccAddress() - details := &types.IssuerDetails{Name: "test issuer"} - _ = suite.keeper.SetIssuerDetails(suite.ctx, creator, issuer, details) + details := &types.IssuerDetails{Creator: tests.RandomAccAddress().String(), Name: "test issuer"} + _ = suite.keeper.SetIssuerDetails(suite.ctx, issuer, details) _ = suite.keeper.SetAddressVerificationStatus(suite.ctx, issuer, true) diff --git a/x/compliance/keeper/query.go b/x/compliance/keeper/query.go index 78ed56a9..707f3174 100644 --- a/x/compliance/keeper/query.go +++ b/x/compliance/keeper/query.go @@ -129,6 +129,7 @@ func (k Querier) IssuersDetails(goCtx context.Context, req *types.QueryIssuersDe // NOTE: MUST CONTAIN ALL THE MEMBERS OF `IssuerDetails` AND ITERATING KEY issuers = append(issuers, types.QueryIssuersDetailsResponse_MergedIssuerDetails{ IssuerAddress: sdk.AccAddress(key).String(), + Creator: issuerDetails.Creator, Name: issuerDetails.Name, Description: issuerDetails.Description, Url: issuerDetails.Url, diff --git a/x/compliance/keeper/query_test.go b/x/compliance/keeper/query_test.go index 9ab1fb52..13db8a14 100644 --- a/x/compliance/keeper/query_test.go +++ b/x/compliance/keeper/query_test.go @@ -47,8 +47,8 @@ func (suite *QuerierTestSuite) SetupTest() { suite.user = tests.RandomAccAddress() // Create issuer - issuerDetails := &types.IssuerDetails{Name: "testIssuer"} - err := suite.keeper.SetIssuerDetails(suite.ctx, suite.issuerCreator, suite.issuer, issuerDetails) + issuerDetails := &types.IssuerDetails{Creator: suite.issuerCreator.String(), Name: "testIssuer"} + err := suite.keeper.SetIssuerDetails(suite.ctx, suite.issuer, issuerDetails) suite.Require().NoError(err) // Set verification status as true for issuer details diff --git a/x/compliance/migrations/v1_0_3/migrate.go b/x/compliance/migrations/v1_0_3/migrate.go new file mode 100644 index 00000000..8a0147e2 --- /dev/null +++ b/x/compliance/migrations/v1_0_3/migrate.go @@ -0,0 +1,50 @@ +package v1_0_3 + +import ( + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "swisstronik/x/compliance/types" +) + +func MigrateStore(ctx sdk.Context, k types.ComplianceKeeper) error { + var ( + operators []*types.OperatorDetails + operatorDetails *types.OperatorDetails + issuerDetails *types.IssuerDetails + err error + ) + k.IterateOperatorDetails(ctx, func(address sdk.AccAddress) (continue_ bool) { + operatorDetails, err = k.GetOperatorDetails(ctx, address) + if err != nil { + return false + } + if operatorDetails.OperatorType == types.OperatorType_OT_INITIAL { + operators = append(operators, operatorDetails) + } + return true + }) + + if len(operators) < 1 || err != nil { + panic(errors.Wrapf(types.ErrInvalidOperator, "empty initial operators")) + } + + defaultIssuerCreator, _ := sdk.AccAddressFromBech32(operators[0].Operator) + k.IterateIssuerDetails(ctx, func(address sdk.AccAddress) bool { + issuerDetails, err = k.GetIssuerDetails(ctx, address) + if issuerDetails == nil || err != nil { + return false + } + if len(issuerDetails.Creator) < 1 { + // In v1.0.2, only operator can create/update/remove issuer. + // The operators who signed the transaction for creating/updating issuer were stored in + // EventManager as event log. + // There's no guarantee if any node in the network can fetch all the signers from EventManager during upgrade. + // So let's initialize issuer's creator with first initial operator by default if issuer is valid + issuerDetails.Creator = defaultIssuerCreator.String() + _ = k.SetIssuerDetails(ctx, address, issuerDetails) + } + return true + }) + + return nil +} diff --git a/x/compliance/migrations/v1_0_3/types/entities.pb.go b/x/compliance/migrations/v1_0_3/types/entities.pb.go new file mode 100644 index 00000000..25962fc1 --- /dev/null +++ b/x/compliance/migrations/v1_0_3/types/entities.pb.go @@ -0,0 +1,1904 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: swisstronik/compliance/entities.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/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 VerificationType int32 + +const ( + // VT_UNSPECIFIED defines an invalid/undefined verification type. + VerificationType_VT_UNSPECIFIED VerificationType = 0 + VerificationType_VT_KYC VerificationType = 1 + VerificationType_VT_KYB VerificationType = 2 + VerificationType_VT_KYW VerificationType = 3 + VerificationType_VT_HUMANITY VerificationType = 4 + VerificationType_VT_AML VerificationType = 5 + VerificationType_VT_ADDRESS VerificationType = 6 + VerificationType_VT_CUSTOM VerificationType = 7 + VerificationType_VT_CREDIT_SCORE VerificationType = 8 +) + +var VerificationType_name = map[int32]string{ + 0: "VT_UNSPECIFIED", + 1: "VT_KYC", + 2: "VT_KYB", + 3: "VT_KYW", + 4: "VT_HUMANITY", + 5: "VT_AML", + 6: "VT_ADDRESS", + 7: "VT_CUSTOM", + 8: "VT_CREDIT_SCORE", +} + +var VerificationType_value = map[string]int32{ + "VT_UNSPECIFIED": 0, + "VT_KYC": 1, + "VT_KYB": 2, + "VT_KYW": 3, + "VT_HUMANITY": 4, + "VT_AML": 5, + "VT_ADDRESS": 6, + "VT_CUSTOM": 7, + "VT_CREDIT_SCORE": 8, +} + +func (x VerificationType) String() string { + return proto.EnumName(VerificationType_name, int32(x)) +} + +func (VerificationType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a6b6c3ec8e3c39ee, []int{0} +} + +type OperatorType int32 + +const ( + // OT_UNSPECIFIED defines an invalid/undefined operator type. + OperatorType_OT_UNSPECIFIED OperatorType = 0 + // Initial Operator, can't be removed from the list of operators. + // Both initial (constant) and regular operators can add or remove regular operators. + OperatorType_OT_INITIAL OperatorType = 1 + OperatorType_OT_REGULAR OperatorType = 2 +) + +var OperatorType_name = map[int32]string{ + 0: "OT_UNSPECIFIED", + 1: "OT_INITIAL", + 2: "OT_REGULAR", +} + +var OperatorType_value = map[string]int32{ + "OT_UNSPECIFIED": 0, + "OT_INITIAL": 1, + "OT_REGULAR": 2, +} + +func (x OperatorType) String() string { + return proto.EnumName(OperatorType_name, int32(x)) +} + +func (OperatorType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a6b6c3ec8e3c39ee, []int{1} +} + +type OperatorDetails struct { + // Operator address, who can add / update / remove issuers + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // Operator type + OperatorType OperatorType `protobuf:"varint,2,opt,name=operator_type,json=operatorType,proto3,enum=swisstronik.compliance.OperatorType" json:"operator_type,omitempty"` +} + +func (m *OperatorDetails) Reset() { *m = OperatorDetails{} } +func (m *OperatorDetails) String() string { return proto.CompactTextString(m) } +func (*OperatorDetails) ProtoMessage() {} +func (*OperatorDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_a6b6c3ec8e3c39ee, []int{0} +} +func (m *OperatorDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OperatorDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OperatorDetails.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 *OperatorDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperatorDetails.Merge(m, src) +} +func (m *OperatorDetails) XXX_Size() int { + return m.Size() +} +func (m *OperatorDetails) XXX_DiscardUnknown() { + xxx_messageInfo_OperatorDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_OperatorDetails proto.InternalMessageInfo + +func (m *OperatorDetails) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *OperatorDetails) GetOperatorType() OperatorType { + if m != nil { + return m.OperatorType + } + return OperatorType_OT_UNSPECIFIED +} + +type IssuerDetails struct { + // Allows to easily understand + // what entity can be associated with issuer address. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Basic issuer description + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // URL to issuer website + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` + // URL to issuer logo + Logo string `protobuf:"bytes,4,opt,name=logo,proto3" json:"logo,omitempty"` + // Legal entity name + LegalEntity string `protobuf:"bytes,5,opt,name=legalEntity,proto3" json:"legalEntity,omitempty"` +} + +func (m *IssuerDetails) Reset() { *m = IssuerDetails{} } +func (m *IssuerDetails) String() string { return proto.CompactTextString(m) } +func (*IssuerDetails) ProtoMessage() {} +func (*IssuerDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_a6b6c3ec8e3c39ee, []int{1} +} +func (m *IssuerDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IssuerDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IssuerDetails.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 *IssuerDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_IssuerDetails.Merge(m, src) +} +func (m *IssuerDetails) XXX_Size() int { + return m.Size() +} +func (m *IssuerDetails) XXX_DiscardUnknown() { + xxx_messageInfo_IssuerDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_IssuerDetails proto.InternalMessageInfo + +func (m *IssuerDetails) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *IssuerDetails) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *IssuerDetails) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *IssuerDetails) GetLogo() string { + if m != nil { + return m.Logo + } + return "" +} + +func (m *IssuerDetails) GetLegalEntity() string { + if m != nil { + return m.LegalEntity + } + return "" +} + +type AddressDetails struct { + // Marks if contract deployed under this address is verified + // by community. Only verified contracts will be allowed to write + // to x/compliance module. + IsVerified bool `protobuf:"varint,1,opt,name=is_verified,json=isVerified,proto3" json:"is_verified,omitempty"` + // Marks if verification for this address was revoked. + IsRevoked bool `protobuf:"varint,2,opt,name=is_revoked,json=isRevoked,proto3" json:"is_revoked,omitempty"` + // Verifications passed by this address + Verifications []*Verification `protobuf:"bytes,3,rep,name=verifications,proto3" json:"verifications,omitempty"` +} + +func (m *AddressDetails) Reset() { *m = AddressDetails{} } +func (m *AddressDetails) String() string { return proto.CompactTextString(m) } +func (*AddressDetails) ProtoMessage() {} +func (*AddressDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_a6b6c3ec8e3c39ee, []int{2} +} +func (m *AddressDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressDetails.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 *AddressDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressDetails.Merge(m, src) +} +func (m *AddressDetails) XXX_Size() int { + return m.Size() +} +func (m *AddressDetails) XXX_DiscardUnknown() { + xxx_messageInfo_AddressDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressDetails proto.InternalMessageInfo + +func (m *AddressDetails) GetIsVerified() bool { + if m != nil { + return m.IsVerified + } + return false +} + +func (m *AddressDetails) GetIsRevoked() bool { + if m != nil { + return m.IsRevoked + } + return false +} + +func (m *AddressDetails) GetVerifications() []*Verification { + if m != nil { + return m.Verifications + } + return nil +} + +type Verification struct { + // Contains information about verification type (KYC, proof-of-humanity, etc). + Type VerificationType `protobuf:"varint,1,opt,name=type,proto3,enum=swisstronik.compliance.VerificationType" json:"type,omitempty"` + // Contains ID of details of passed verification in storage. + VerificationId []byte `protobuf:"bytes,2,opt,name=verification_id,json=verificationId,proto3" json:"verification_id,omitempty"` + // Issuer of verification + IssuerAddress string `protobuf:"bytes,3,opt,name=issuer_address,json=issuerAddress,proto3" json:"issuer_address,omitempty"` +} + +func (m *Verification) Reset() { *m = Verification{} } +func (m *Verification) String() string { return proto.CompactTextString(m) } +func (*Verification) ProtoMessage() {} +func (*Verification) Descriptor() ([]byte, []int) { + return fileDescriptor_a6b6c3ec8e3c39ee, []int{3} +} +func (m *Verification) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Verification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Verification.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 *Verification) XXX_Merge(src proto.Message) { + xxx_messageInfo_Verification.Merge(m, src) +} +func (m *Verification) XXX_Size() int { + return m.Size() +} +func (m *Verification) XXX_DiscardUnknown() { + xxx_messageInfo_Verification.DiscardUnknown(m) +} + +var xxx_messageInfo_Verification proto.InternalMessageInfo + +func (m *Verification) GetType() VerificationType { + if m != nil { + return m.Type + } + return VerificationType_VT_UNSPECIFIED +} + +func (m *Verification) GetVerificationId() []byte { + if m != nil { + return m.VerificationId + } + return nil +} + +func (m *Verification) GetIssuerAddress() string { + if m != nil { + return m.IssuerAddress + } + return "" +} + +// VerificationDetails must have same members with VerificationDetails in "proto/swisstronik/compliance/entities.proto" +// But the member types can be different, such as string(address) to bytes +type VerificationDetails struct { + // Verification type + Type VerificationType `protobuf:"varint,1,opt,name=type,proto3,enum=swisstronik.compliance.VerificationType" json:"type,omitempty"` + // Verification issuer address + IssuerAddress string `protobuf:"bytes,2,opt,name=issuer_address,json=issuerAddress,proto3" json:"issuer_address,omitempty"` + // From which chain proof was transferred + OriginChain string `protobuf:"bytes,3,opt,name=origin_chain,json=originChain,proto3" json:"origin_chain,omitempty"` + // Original issuance timestamp + IssuanceTimestamp uint32 `protobuf:"varint,4,opt,name=issuance_timestamp,json=issuanceTimestamp,proto3" json:"issuance_timestamp,omitempty"` + // Original expiration timestamp + ExpirationTimestamp uint32 `protobuf:"varint,5,opt,name=expiration_timestamp,json=expirationTimestamp,proto3" json:"expiration_timestamp,omitempty"` + // Original proof data (ZK-proof) + OriginalData []byte `protobuf:"bytes,6,opt,name=original_data,json=originalData,proto3" json:"original_data,omitempty"` + // ZK-proof original schema + Schema string `protobuf:"bytes,7,opt,name=schema,proto3" json:"schema,omitempty"` + // Verification id for checking(KYC/KYB/AML etc) from issuer side + IssuerVerificationId string `protobuf:"bytes,8,opt,name=issuer_verification_id,json=issuerVerificationId,proto3" json:"issuer_verification_id,omitempty"` + // Version + Version uint32 `protobuf:"varint,9,opt,name=version,proto3" json:"version,omitempty"` +} + +func (m *VerificationDetails) Reset() { *m = VerificationDetails{} } +func (m *VerificationDetails) String() string { return proto.CompactTextString(m) } +func (*VerificationDetails) ProtoMessage() {} +func (*VerificationDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_a6b6c3ec8e3c39ee, []int{4} +} +func (m *VerificationDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VerificationDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VerificationDetails.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 *VerificationDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_VerificationDetails.Merge(m, src) +} +func (m *VerificationDetails) XXX_Size() int { + return m.Size() +} +func (m *VerificationDetails) XXX_DiscardUnknown() { + xxx_messageInfo_VerificationDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_VerificationDetails proto.InternalMessageInfo + +func (m *VerificationDetails) GetType() VerificationType { + if m != nil { + return m.Type + } + return VerificationType_VT_UNSPECIFIED +} + +func (m *VerificationDetails) GetIssuerAddress() string { + if m != nil { + return m.IssuerAddress + } + return "" +} + +func (m *VerificationDetails) GetOriginChain() string { + if m != nil { + return m.OriginChain + } + return "" +} + +func (m *VerificationDetails) GetIssuanceTimestamp() uint32 { + if m != nil { + return m.IssuanceTimestamp + } + return 0 +} + +func (m *VerificationDetails) GetExpirationTimestamp() uint32 { + if m != nil { + return m.ExpirationTimestamp + } + return 0 +} + +func (m *VerificationDetails) GetOriginalData() []byte { + if m != nil { + return m.OriginalData + } + return nil +} + +func (m *VerificationDetails) GetSchema() string { + if m != nil { + return m.Schema + } + return "" +} + +func (m *VerificationDetails) GetIssuerVerificationId() string { + if m != nil { + return m.IssuerVerificationId + } + return "" +} + +func (m *VerificationDetails) GetVersion() uint32 { + if m != nil { + return m.Version + } + return 0 +} + +func init() { + proto.RegisterEnum("swisstronik.compliance.VerificationType", VerificationType_name, VerificationType_value) + proto.RegisterEnum("swisstronik.compliance.OperatorType", OperatorType_name, OperatorType_value) + proto.RegisterType((*OperatorDetails)(nil), "swisstronik.compliance.OperatorDetails") + proto.RegisterType((*IssuerDetails)(nil), "swisstronik.compliance.IssuerDetails") + proto.RegisterType((*AddressDetails)(nil), "swisstronik.compliance.AddressDetails") + proto.RegisterType((*Verification)(nil), "swisstronik.compliance.Verification") + proto.RegisterType((*VerificationDetails)(nil), "swisstronik.compliance.VerificationDetails") +} + +func init() { + proto.RegisterFile("swisstronik/compliance/entities.proto", fileDescriptor_a6b6c3ec8e3c39ee) +} + +var fileDescriptor_a6b6c3ec8e3c39ee = []byte{ + // 703 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff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f, 0xa6, 0x50, 0x19, + 0xf2, 0x03, 0x87, 0xbc, 0xee, 0xef, 0x35, 0xf7, 0x6d, 0xe7, 0xc0, 0x4c, 0x87, 0xc5, 0xe6, 0xde, + 0xae, 0xb9, 0x84, 0x4a, 0x00, 0x2a, 0x6e, 0xb7, 0x71, 0xa7, 0xd7, 0x33, 0x33, 0xa8, 0x08, 0xb9, + 0x81, 0x43, 0x5a, 0xfd, 0x9e, 0xd3, 0xdd, 0x33, 0x97, 0xd1, 0x0a, 0x94, 0x55, 0x8a, 0x3b, 0x6d, + 0xdb, 0x21, 0xbd, 0x56, 0x17, 0x77, 0xcc, 0xec, 0xd6, 0x0e, 0x14, 0xe2, 0x0f, 0x83, 0x12, 0xd6, + 0xbd, 0x2e, 0xac, 0x04, 0xd0, 0x75, 0x88, 0xbd, 0x6f, 0x3b, 0x76, 0x73, 0xd7, 0x34, 0xc2, 0x1c, + 0x77, 0x5e, 0xf5, 0x77, 0x9b, 0xd8, 0x4c, 0xee, 0x3c, 0xff, 0x79, 0x51, 0x31, 0xce, 0x2f, 0x2a, + 0xc6, 0xef, 0x8b, 0x8a, 0xf1, 0xed, 0xb2, 0x92, 0x38, 0xbf, 0xac, 0x24, 0x7e, 0x5d, 0x56, 0x12, + 0x1f, 0x2a, 0xf1, 0x77, 0xef, 0x34, 0xfe, 0xf2, 0xa9, 0x6f, 0x4a, 0x7e, 0xcc, 0xe8, 0x97, 0xef, + 0xe9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x38, 0x68, 0xf2, 0xa4, 0x75, 0x05, 0x00, 0x00, +} + +func (m *OperatorDetails) 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 *OperatorDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OperatorDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OperatorType != 0 { + i = encodeVarintEntities(dAtA, i, uint64(m.OperatorType)) + i-- + dAtA[i] = 0x10 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintEntities(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IssuerDetails) 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 *IssuerDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IssuerDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LegalEntity) > 0 { + i -= len(m.LegalEntity) + copy(dAtA[i:], m.LegalEntity) + i = encodeVarintEntities(dAtA, i, uint64(len(m.LegalEntity))) + i-- + dAtA[i] = 0x2a + } + if len(m.Logo) > 0 { + i -= len(m.Logo) + copy(dAtA[i:], m.Logo) + i = encodeVarintEntities(dAtA, i, uint64(len(m.Logo))) + i-- + dAtA[i] = 0x22 + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintEntities(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintEntities(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEntities(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressDetails) 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 *AddressDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Verifications) > 0 { + for iNdEx := len(m.Verifications) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Verifications[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEntities(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.IsRevoked { + i-- + if m.IsRevoked { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.IsVerified { + i-- + if m.IsVerified { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Verification) 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 *Verification) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Verification) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.IssuerAddress) > 0 { + i -= len(m.IssuerAddress) + copy(dAtA[i:], m.IssuerAddress) + i = encodeVarintEntities(dAtA, i, uint64(len(m.IssuerAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.VerificationId) > 0 { + i -= len(m.VerificationId) + copy(dAtA[i:], m.VerificationId) + i = encodeVarintEntities(dAtA, i, uint64(len(m.VerificationId))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintEntities(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *VerificationDetails) 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 *VerificationDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VerificationDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Version != 0 { + i = encodeVarintEntities(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x48 + } + if len(m.IssuerVerificationId) > 0 { + i -= len(m.IssuerVerificationId) + copy(dAtA[i:], m.IssuerVerificationId) + i = encodeVarintEntities(dAtA, i, uint64(len(m.IssuerVerificationId))) + i-- + dAtA[i] = 0x42 + } + if len(m.Schema) > 0 { + i -= len(m.Schema) + copy(dAtA[i:], m.Schema) + i = encodeVarintEntities(dAtA, i, uint64(len(m.Schema))) + i-- + dAtA[i] = 0x3a + } + if len(m.OriginalData) > 0 { + i -= len(m.OriginalData) + copy(dAtA[i:], m.OriginalData) + i = encodeVarintEntities(dAtA, i, uint64(len(m.OriginalData))) + i-- + dAtA[i] = 0x32 + } + if m.ExpirationTimestamp != 0 { + i = encodeVarintEntities(dAtA, i, uint64(m.ExpirationTimestamp)) + i-- + dAtA[i] = 0x28 + } + if m.IssuanceTimestamp != 0 { + i = encodeVarintEntities(dAtA, i, uint64(m.IssuanceTimestamp)) + i-- + dAtA[i] = 0x20 + } + if len(m.OriginChain) > 0 { + i -= len(m.OriginChain) + copy(dAtA[i:], m.OriginChain) + i = encodeVarintEntities(dAtA, i, uint64(len(m.OriginChain))) + i-- + dAtA[i] = 0x1a + } + if len(m.IssuerAddress) > 0 { + i -= len(m.IssuerAddress) + copy(dAtA[i:], m.IssuerAddress) + i = encodeVarintEntities(dAtA, i, uint64(len(m.IssuerAddress))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintEntities(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEntities(dAtA []byte, offset int, v uint64) int { + offset -= sovEntities(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *OperatorDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + if m.OperatorType != 0 { + n += 1 + sovEntities(uint64(m.OperatorType)) + } + return n +} + +func (m *IssuerDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + l = len(m.Logo) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + l = len(m.LegalEntity) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + return n +} + +func (m *AddressDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IsVerified { + n += 2 + } + if m.IsRevoked { + n += 2 + } + if len(m.Verifications) > 0 { + for _, e := range m.Verifications { + l = e.Size() + n += 1 + l + sovEntities(uint64(l)) + } + } + return n +} + +func (m *Verification) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovEntities(uint64(m.Type)) + } + l = len(m.VerificationId) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + l = len(m.IssuerAddress) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + return n +} + +func (m *VerificationDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovEntities(uint64(m.Type)) + } + l = len(m.IssuerAddress) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + l = len(m.OriginChain) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + if m.IssuanceTimestamp != 0 { + n += 1 + sovEntities(uint64(m.IssuanceTimestamp)) + } + if m.ExpirationTimestamp != 0 { + n += 1 + sovEntities(uint64(m.ExpirationTimestamp)) + } + l = len(m.OriginalData) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + l = len(m.Schema) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + l = len(m.IssuerVerificationId) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } + if m.Version != 0 { + n += 1 + sovEntities(uint64(m.Version)) + } + return n +} + +func sovEntities(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEntities(x uint64) (n int) { + return sovEntities(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *OperatorDetails) 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 ErrIntOverflowEntities + } + 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: OperatorDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OperatorDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorType", wireType) + } + m.OperatorType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OperatorType |= OperatorType(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEntities(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEntities + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IssuerDetails) 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 ErrIntOverflowEntities + } + 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: IssuerDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IssuerDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LegalEntity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LegalEntity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEntities(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEntities + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressDetails) 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 ErrIntOverflowEntities + } + 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: AddressDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsVerified", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsVerified = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsRevoked", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsRevoked = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Verifications", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEntities + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Verifications = append(m.Verifications, &Verification{}) + if err := m.Verifications[len(m.Verifications)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEntities(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEntities + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Verification) 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 ErrIntOverflowEntities + } + 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: Verification: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Verification: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= VerificationType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerificationId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEntities + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VerificationId = append(m.VerificationId[:0], dAtA[iNdEx:postIndex]...) + if m.VerificationId == nil { + m.VerificationId = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IssuerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IssuerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEntities(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEntities + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VerificationDetails) 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 ErrIntOverflowEntities + } + 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: VerificationDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VerificationDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= VerificationType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IssuerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IssuerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OriginChain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OriginChain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IssuanceTimestamp", wireType) + } + m.IssuanceTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.IssuanceTimestamp |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTimestamp", wireType) + } + m.ExpirationTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpirationTimestamp |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OriginalData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthEntities + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OriginalData = append(m.OriginalData[:0], dAtA[iNdEx:postIndex]...) + if m.OriginalData == nil { + m.OriginalData = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Schema = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IssuerVerificationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IssuerVerificationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEntities(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEntities + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEntities(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, ErrIntOverflowEntities + } + 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, ErrIntOverflowEntities + } + 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, ErrIntOverflowEntities + } + 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, ErrInvalidLengthEntities + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEntities + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEntities + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEntities = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEntities = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEntities = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/compliance/migrations/v1_0_3/types/genesis.pb.go b/x/compliance/migrations/v1_0_3/types/genesis.pb.go new file mode 100644 index 00000000..26ad3a9e --- /dev/null +++ b/x/compliance/migrations/v1_0_3/types/genesis.pb.go @@ -0,0 +1,1327 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: swisstronik/compliance/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/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 defines the compliance module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Issuers []*IssuerGenesisAccount `protobuf:"bytes,2,rep,name=issuers,proto3" json:"issuers,omitempty"` + AddressDetails []*GenesisAddressDetails `protobuf:"bytes,3,rep,name=addressDetails,proto3" json:"addressDetails,omitempty"` + VerificationDetails []*GenesisVerificationDetails `protobuf:"bytes,4,rep,name=verificationDetails,proto3" json:"verificationDetails,omitempty"` + Operators []*OperatorDetails `protobuf:"bytes,5,rep,name=operators,proto3" json:"operators,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_d430e46e02363948, []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 Params{} +} + +func (m *GenesisState) GetIssuers() []*IssuerGenesisAccount { + if m != nil { + return m.Issuers + } + return nil +} + +func (m *GenesisState) GetAddressDetails() []*GenesisAddressDetails { + if m != nil { + return m.AddressDetails + } + return nil +} + +func (m *GenesisState) GetVerificationDetails() []*GenesisVerificationDetails { + if m != nil { + return m.VerificationDetails + } + return nil +} + +func (m *GenesisState) GetOperators() []*OperatorDetails { + if m != nil { + return m.Operators + } + return nil +} + +type IssuerGenesisAccount struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Details *IssuerDetails `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` + +} + +func (m *IssuerGenesisAccount) Reset() { *m = IssuerGenesisAccount{} } +func (m *IssuerGenesisAccount) String() string { return proto.CompactTextString(m) } +func (*IssuerGenesisAccount) ProtoMessage() {} +func (*IssuerGenesisAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_d430e46e02363948, []int{1} +} +func (m *IssuerGenesisAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IssuerGenesisAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IssuerGenesisAccount.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 *IssuerGenesisAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_IssuerGenesisAccount.Merge(m, src) +} +func (m *IssuerGenesisAccount) XXX_Size() int { + return m.Size() +} +func (m *IssuerGenesisAccount) XXX_DiscardUnknown() { + xxx_messageInfo_IssuerGenesisAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_IssuerGenesisAccount proto.InternalMessageInfo + +func (m *IssuerGenesisAccount) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *IssuerGenesisAccount) GetDetails() *IssuerDetails { + + + + + + + + if m != nil { + return m.Details + } + return nil +} + +type GenesisAddressDetails struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Details *AddressDetails `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` +} + +func (m *GenesisAddressDetails) Reset() { *m = GenesisAddressDetails{} } +func (m *GenesisAddressDetails) String() string { return proto.CompactTextString(m) } +func (*GenesisAddressDetails) ProtoMessage() {} +func (*GenesisAddressDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_d430e46e02363948, []int{2} +} +func (m *GenesisAddressDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisAddressDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisAddressDetails.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 *GenesisAddressDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisAddressDetails.Merge(m, src) +} +func (m *GenesisAddressDetails) XXX_Size() int { + return m.Size() +} +func (m *GenesisAddressDetails) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisAddressDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisAddressDetails proto.InternalMessageInfo + +func (m *GenesisAddressDetails) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *GenesisAddressDetails) GetDetails() *AddressDetails { + if m != nil { + return m.Details + } + return nil +} + +type GenesisVerificationDetails struct { + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Details *VerificationDetails `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` +} + +func (m *GenesisVerificationDetails) Reset() { *m = GenesisVerificationDetails{} } +func (m *GenesisVerificationDetails) String() string { return proto.CompactTextString(m) } +func (*GenesisVerificationDetails) ProtoMessage() {} +func (*GenesisVerificationDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_d430e46e02363948, []int{3} +} +func (m *GenesisVerificationDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisVerificationDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisVerificationDetails.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 *GenesisVerificationDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisVerificationDetails.Merge(m, src) +} +func (m *GenesisVerificationDetails) XXX_Size() int { + return m.Size() +} +func (m *GenesisVerificationDetails) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisVerificationDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisVerificationDetails proto.InternalMessageInfo + +func (m *GenesisVerificationDetails) GetId() []byte { + if m != nil { + return m.Id + } + return nil +} + +func (m *GenesisVerificationDetails) GetDetails() *VerificationDetails { + if m != nil { + return m.Details + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "swisstronik.compliance.GenesisState") + proto.RegisterType((*IssuerGenesisAccount)(nil), "swisstronik.compliance.IssuerGenesisAccount") + proto.RegisterType((*GenesisAddressDetails)(nil), "swisstronik.compliance.GenesisAddressDetails") + proto.RegisterType((*GenesisVerificationDetails)(nil), "swisstronik.compliance.GenesisVerificationDetails") +} + +func init() { + proto.RegisterFile("swisstronik/compliance/genesis.proto", fileDescriptor_d430e46e02363948) +} + +var fileDescriptor_d430e46e02363948 = []byte{ + // 404 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x4f, 0x6f, 0xda, 0x30, + 0x18, 0xc6, 0x93, 0xc0, 0x40, 0x18, 0xc4, 0xc1, 0x63, 0x53, 0x94, 0x83, 0x87, 0xd8, 0xd8, 0x90, + 0xb6, 0x05, 0x89, 0x5d, 0x76, 0x98, 0xb4, 0x0d, 0x8d, 0x55, 0x3d, 0xb5, 0x4a, 0xd5, 0x1e, 0x7a, + 0x73, 0x13, 0x17, 0x59, 0x85, 0x38, 0xb5, 0x4d, 0xff, 0x7c, 0x8b, 0x1e, 0xfb, 0x91, 0x38, 0x72, + 0xec, 0xa9, 0xaa, 0xe0, 0x8b, 0x54, 0x35, 0xb1, 0x48, 0xd3, 0x98, 0xde, 0x12, 0xe9, 0x79, 0x7e, + 0x3f, 0xfb, 0x7d, 0x65, 0xf0, 0x49, 0x5c, 0x52, 0x21, 0x24, 0x67, 0x31, 0x3d, 0xeb, 0x87, 0x6c, + 0x9a, 0x4c, 0x28, 0x8e, 0x43, 0xd2, 0x1f, 0x93, 0x98, 0x08, 0x2a, 0xfc, 0x84, 0x33, 0xc9, 0xe0, + 0xfb, 0x4c, 0xca, 0xdf, 0xa4, 0xbc, 0xd6, 0x98, 0x8d, 0x99, 0x8a, 0xf4, 0x9f,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, 0xd3, 0xd7, 0x52, 0xdd, 0xea, 0x08, 0xf0, 0xae, 0x70, 0x90, 0x5b, 0x9c, + 0x7f, 0xf2, 0xce, 0xcf, 0x26, 0x67, 0x6e, 0x37, 0x19, 0xa9, 0x67, 0x9e, 0x30, 0x6c, 0x02, 0x87, + 0x46, 0x4a, 0xda, 0x08, 0x1c, 0x1a, 0xc1, 0x51, 0xde, 0xf7, 0xd5, 0xe4, 0x2b, 0xda, 0x97, 0xee, + 0x0e, 0x7f, 0xce, 0x97, 0xc8, 0x5e, 0x2c, 0x91, 0xfd, 0xb0, 0x44, 0xf6, 0xcd, 0x0a, 0x59, 0x8b, + 0x15, 0xb2, 0xee, 0x56, 0xc8, 0x3a, 0x46, 0xd9, 0x87, 0x73, 0x95, 0x7d, 0x3a, 0xf2, 0x3a, 0x21, + 0xe2, 0xa4, 0xa2, 0x1e, 0xce, 0x8f, 0xc7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x67, 0x42, 0x89, 0x3c, + 0xda, 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.Operators) > 0 { + for iNdEx := len(m.Operators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Operators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.VerificationDetails) > 0 { + for iNdEx := len(m.VerificationDetails) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VerificationDetails[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.AddressDetails) > 0 { + for iNdEx := len(m.AddressDetails) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AddressDetails[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.Issuers) > 0 { + for iNdEx := len(m.Issuers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Issuers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *IssuerGenesisAccount) 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 *IssuerGenesisAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IssuerGenesisAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Details != nil { + { + size, err := m.Details.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + + + + + + + + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GenesisAddressDetails) 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 *GenesisAddressDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisAddressDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Details != nil { + { + size, err := m.Details.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GenesisVerificationDetails) 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 *GenesisVerificationDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisVerificationDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Details != nil { + { + size, err := m.Details.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Id))) + 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 = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.Issuers) > 0 { + for _, e := range m.Issuers { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.AddressDetails) > 0 { + for _, e := range m.AddressDetails { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.VerificationDetails) > 0 { + for _, e := range m.VerificationDetails { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Operators) > 0 { + for _, e := range m.Operators { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func (m *IssuerGenesisAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + + + + + if m.Details != nil { + l = m.Details.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *GenesisAddressDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Details != nil { + l = m.Details.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *GenesisVerificationDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Details != nil { + l = m.Details.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 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 Issuers", 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.Issuers = append(m.Issuers, &IssuerGenesisAccount{}) + if err := m.Issuers[len(m.Issuers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressDetails", 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.AddressDetails = append(m.AddressDetails, &GenesisAddressDetails{}) + if err := m.AddressDetails[len(m.AddressDetails)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerificationDetails", 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.VerificationDetails = append(m.VerificationDetails, &GenesisVerificationDetails{}) + if err := m.VerificationDetails[len(m.VerificationDetails)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operators", 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.Operators = append(m.Operators, &OperatorDetails{}) + if err := m.Operators[len(m.Operators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IssuerGenesisAccount) 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: IssuerGenesisAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IssuerGenesisAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", 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.Details == nil { + m.Details = &IssuerDetails{} + } + if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisAddressDetails) 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: GenesisAddressDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisAddressDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", 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.Details == nil { + m.Details = &AddressDetails{} + } + if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisVerificationDetails) 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: GenesisVerificationDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisVerificationDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) + if m.Id == nil { + m.Id = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", 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.Details == nil { + m.Details = &VerificationDetails{} + } + if err := m.Details.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/compliance/migrations/v1_0_3/types/params.go b/x/compliance/migrations/v1_0_3/types/params.go new file mode 100644 index 00000000..357196ad --- /dev/null +++ b/x/compliance/migrations/v1_0_3/types/params.go @@ -0,0 +1,39 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams() +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/x/compliance/migrations/v1_0_3/types/params.pb.go b/x/compliance/migrations/v1_0_3/types/params.pb.go new file mode 100644 index 00000000..c9a502b0 --- /dev/null +++ b/x/compliance/migrations/v1_0_3/types/params.pb.go @@ -0,0 +1,265 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: swisstronik/compliance/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/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 + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_25da6e1942c61052, []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 init() { + proto.RegisterType((*Params)(nil), "swisstronik.compliance.Params") +} + +func init() { + proto.RegisterFile("swisstronik/compliance/params.proto", fileDescriptor_25da6e1942c61052) +} + +var fileDescriptor_25da6e1942c61052 = []byte{ + // 139 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2e, 0x2e, 0xcf, 0x2c, + 0x2e, 0x2e, 0x29, 0xca, 0xcf, 0xcb, 0xcc, 0xd6, 0x4f, 0xce, 0xcf, 0x2d, 0xc8, 0xc9, 0x4c, 0xcc, + 0x4b, 0x4e, 0xd5, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x43, 0x52, 0xa4, 0x87, 0x50, 0x24, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa2, 0x0f, + 0x62, 0x41, 0x54, 0x2b, 0xf1, 0x71, 0xb1, 0x05, 0x80, 0x75, 0x5b, 0xb1, 0xcc, 0x58, 0x20, 0xcf, + 0xe0, 0x64, 0x71, 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, 0x72, 0xc8, 0x96, + 0x57, 0x20, 0x5b, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x36, 0xd0, 0x18, 0x10, 0x00, + 0x00, 0xff, 0xff, 0xb1, 0x48, 0x30, 0x5b, 0xa5, 0x00, 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 + 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 + 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 { + 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/compliance/module.go b/x/compliance/module.go index 8c69e545..140b5579 100644 --- a/x/compliance/module.go +++ b/x/compliance/module.go @@ -21,6 +21,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" ) +// ConsensusVersion defines the current x/compliance module consensus version. +const ConsensusVersion = 2 + var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} @@ -105,6 +108,11 @@ func NewAppModule( func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier{Keeper: am.keeper}) + + m := keeper.NewMigrator(am.keeper) + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1_0_2to1_0_3); err != nil { + panic(err) + } } // RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) @@ -128,7 +136,9 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1 -func (AppModule) ConsensusVersion() uint64 { return 1 } +func (AppModule) ConsensusVersion() uint64 { + return ConsensusVersion +} // BeginBlock contains the logic that is automatically triggered at the beginning of each block func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} diff --git a/x/compliance/types/entities.pb.go b/x/compliance/types/entities.pb.go index 25962fc1..80017148 100644 --- a/x/compliance/types/entities.pb.go +++ b/x/compliance/types/entities.pb.go @@ -158,6 +158,7 @@ func (m *OperatorDetails) GetOperatorType() OperatorType { type IssuerDetails struct { // Allows to easily understand // what entity can be associated with issuer address. + // Issuer name Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Basic issuer description Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` @@ -167,6 +168,8 @@ type IssuerDetails struct { Logo string `protobuf:"bytes,4,opt,name=logo,proto3" json:"logo,omitempty"` // Legal entity name LegalEntity string `protobuf:"bytes,5,opt,name=legalEntity,proto3" json:"legalEntity,omitempty"` + // Issuer creator who created current issuer + Creator string `protobuf:"bytes,6,opt,name=creator,proto3" json:"creator,omitempty"` } func (m *IssuerDetails) Reset() { *m = IssuerDetails{} } @@ -237,6 +240,13 @@ func (m *IssuerDetails) GetLegalEntity() string { return "" } +func (m *IssuerDetails) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + type AddressDetails struct { // Marks if contract deployed under this address is verified // by community. Only verified contracts will be allowed to write @@ -499,51 +509,52 @@ func init() { } var fileDescriptor_a6b6c3ec8e3c39ee = []byte{ - // 703 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x6f, 0x12, 0x41, - 0x14, 0x66, 0x81, 0x52, 0x78, 0xfc, 0x5a, 0xa7, 0x4d, 0xb3, 0x69, 0x22, 0x22, 0xb5, 0x91, 0x34, - 0x91, 0xc6, 0x1f, 0x07, 0x0f, 0x5e, 0x28, 0xa0, 0xae, 0xb6, 0xc5, 0x0c, 0x0b, 0xa6, 0x5e, 0x26, - 0x23, 0x8c, 0x74, 0x52, 0x60, 0x36, 0x3b, 0xdb, 0xda, 0xfe, 0x0f, 0x9a, 0x78, 0xd7, 0x3f, 0xc8, - 0x63, 0x8f, 0x1e, 0x4d, 0xfb, 0x8f, 0x98, 0x99, 0xdd, 0x85, 0x6d, 0x6d, 0x13, 0x13, 0x6f, 0xef, - 0x7d, 0xef, 0xbd, 0xef, 0x7d, 0x7c, 0x6f, 0x19, 0xd8, 0x94, 0x9f, 0xb9, 0x94, 0xbe, 0x27, 0x66, - 0xfc, 0x68, 0x7b, 0x28, 0xa6, 0xee, 0x84, 0xd3, 0xd9, 0x90, 0x6d, 0xb3, 0x99, 0xcf, 0x7d, 0xce, - 0x64, 0xc3, 0xf5, 0x84,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2, 0x92, 0x38, 0xbf, 0xac, 0x24, 0x7e, 0x5d, 0x56, 0x12, - 0x1f, 0x2a, 0xf1, 0x77, 0xef, 0x34, 0xfe, 0xf2, 0xa9, 0x6f, 0x4a, 0x7e, 0xcc, 0xe8, 0x97, 0xef, - 0xe9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x38, 0x68, 0xf2, 0xa4, 0x75, 0x05, 0x00, 0x00, + // 718 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0xd3, 0x4c, + 0x10, 0x8e, 0x93, 0x34, 0x1f, 0x93, 0x2f, 0xbf, 0xdb, 0xaa, 0xb2, 0x2a, 0xbd, 0x79, 0xf3, 0xa6, + 0x54, 0x44, 0x95, 0x48, 0xc5, 0xc7, 0x81, 0x03, 0x97, 0x34, 0x09, 0x60, 0x68, 0x1b, 0xb4, 0x71, + 0x82, 0xca, 0xc5, 0x5a, 0x92, 0x25, 0x5d, 0x35, 0xc9, 0x5a, 0xbb, 0x6e, 0x69, 0xff, 0x03, 0x07, + 0xee, 0x70, 0xe7, 0xaf, 0x70, 0xec, 0x91, 0x23, 0x6a, 0xff, 0x08, 0xda, 0xb5, 0x9d, 0xb8, 0xa5, + 0x95, 0x90, 0xb8, 0xcd, 0x3c, 0x33, 0xf3, 0xcc, 0xe3, 0x99, 0xf5, 0xc0, 0x96, 0xfc, 0xc8, 0xa4, + 0xf4, 0x05, 0x9f, 0xb3, 0xe3, 0x9d, 0x11, 0x9f, 0x79, 0x53, 0x46, 0xe6, 0x23, 0xba, 0x43, 0xe7, + 0x3e, 0xf3, 0x19, 0x95, 0x4d, 0x4f, 0x70, 0x9f, 0xa3, 0xf5, 0x58, 0x5a, 0x73, 0x99, 0xb6, 0xb1, + 0x36, 0xe1, 0x13, 0xae, 0x53, 0x76, 0x94, 0x15, 0x64, 0x6f, 0x6c, 0xde, 0x41, 0xea, 0x11, 0x41, + 0x66, 0x21, 0x65, 0xfd, 0x0c, 0x2a, 0x3d, 0x8f, 0x0a, 0xe2, 0x73, 0xd1, 0xa1, 0x3e, 0x61, 0x53, + 0x89, 0x36, 0x20, 0xc7, 0x43, 0xc8, 0x32, 0x6a, 0x46, 0x23, 0x8f, 0x17, 0x3e, 0xb2, 0xa1, 0x14, + 0xd9, 0xae, 0x7f, 0xee, 0x51, 0x2b, 0x59, 0x33, 0x1a, 0xe5, 0x47, 0xf7, 0x9a, 0xb7, 0x2b, 0x6b, + 0x46, 0xdc, 0xce, 0xb9, 0x47, 0x71, 0x91, 0xc7, 0xbc, 0xfa, 0x37, 0x03, 0x4a, 0xb6, 0x94, 0x27, + 0x74, 0xd1, 0x18, 0x41, 0x7a, 0x4e, 0x66, 0x34, 0x6c, 0xaa, 0x6d, 0x54, 0x83, 0xc2, 0x98, 0xca, + 0x91, 0x60, 0x9e, 0xcf, 0xf8, 0x5c, 0xb7, 0xcb, 0xe3, 0x38, 0x84, 0x4c, 0x48, 0x9d, 0x88, 0xa9, + 0x95, 0xd2, 0x11, 0x65, 0x2a, 0x9e, 0x29, 0x9f, 0x70, 0x2b, 0x1d, 0xf0, 0x28, 0x5b, 0xf1, 0x4c, + 0xe9, 0x84, 0x4c, 0xbb, 0x6a, 0xa2, 0xe7, 0xd6, 0x4a, 0xc0, 0x13, 0x83, 0x90, 0x05, 0xd9, 0x91, + 0xa0, 0xfa, 0xab, 0x33, 0x3a, 0x1a, 0xb9, 0xf5, 0xaf, 0x06, 0x94, 0x5b, 0xe3, 0xb1, 0xa0, 0x52, + 0x46, 0x52, 0xff, 0x83, 0x02, 0x93, 0xee, 0x29, 0x15, 0xec, 0x03, 0xa3, 0x63, 0xad, 0x38, 0x87, + 0x81, 0xc9, 0x61, 0x88, 0xa0, 0x7f, 0x01, 0x98, 0x74, 0x05, 0x3d, 0xe5, 0xc7, 0x74, 0xac, 0x65, + 0xe7, 0x70, 0x9e, 0x49, 0x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, 0xe2, + 0x5d, 0x35, 0x7e, 0x11, 0xcf, 0xe2, 0x37, 0x51, 0xbd, 0x29, 0xf9, 0x3e, 0xa3, 0x6f, 0xe2, 0xe3, + 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x27, 0x51, 0x2e, 0x1d, 0x8f, 0x05, 0x00, 0x00, } func (m *OperatorDetails) Marshal() (dAtA []byte, err error) { @@ -601,6 +612,13 @@ func (m *IssuerDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintEntities(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x32 + } if len(m.LegalEntity) > 0 { i -= len(m.LegalEntity) copy(dAtA[i:], m.LegalEntity) @@ -869,6 +887,10 @@ func (m *IssuerDetails) Size() (n int) { if l > 0 { n += 1 + l + sovEntities(uint64(l)) } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovEntities(uint64(l)) + } return n } @@ -1250,6 +1272,38 @@ func (m *IssuerDetails) Unmarshal(dAtA []byte) error { } m.LegalEntity = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEntities + } + 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 ErrInvalidLengthEntities + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEntities + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEntities(dAtA[iNdEx:]) diff --git a/x/compliance/types/events.go b/x/compliance/types/events.go index 03099bc5..e66c762d 100644 --- a/x/compliance/types/events.go +++ b/x/compliance/types/events.go @@ -9,6 +9,7 @@ const ( EventTypeVerifyIssuer = "verify_issuer" AttributeKeyOperator = "operator" + AttributeKeyIssuerCreator = "creator" AttributeKeyIssuer = "issuer" AttributeKeyIssuerDetails = "issuer_details" AttributeKeyVerificationStatus = "verification_status" diff --git a/x/compliance/types/genesis.pb.go b/x/compliance/types/genesis.pb.go index 70ac9079..39b94315 100644 --- a/x/compliance/types/genesis.pb.go +++ b/x/compliance/types/genesis.pb.go @@ -102,8 +102,7 @@ func (m *GenesisState) GetOperators() []*OperatorDetails { type GenesisIssuerDetails struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` - Details *IssuerDetails `protobuf:"bytes,3,opt,name=details,proto3" json:"details,omitempty"` + Details *IssuerDetails `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` } func (m *GenesisIssuerDetails) Reset() { *m = GenesisIssuerDetails{} } @@ -146,13 +145,6 @@ func (m *GenesisIssuerDetails) GetAddress() string { return "" } -func (m *GenesisIssuerDetails) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - func (m *GenesisIssuerDetails) GetDetails() *IssuerDetails { if m != nil { return m.Details @@ -276,33 +268,32 @@ func init() { } var fileDescriptor_d430e46e02363948 = []byte{ - // 415 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x4f, 0x6f, 0xda, 0x30, - 0x18, 0xc6, 0x93, 0xc0, 0x40, 0x18, 0xc6, 0xc1, 0x63, 0x53, 0x94, 0x83, 0x87, 0xd8, 0xd8, 0x90, - 0xb6, 0x05, 0x89, 0x5d, 0x76, 0x98, 0xb4, 0x0d, 0x0d, 0x55, 0x3d, 0xb5, 0x4a, 0xd5, 0x1e, 0x7a, - 0x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// 397 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x4f, 0x4f, 0xe2, 0x40, + 0x18, 0xc6, 0x5b, 0x60, 0x21, 0x0c, 0x2c, 0x87, 0x59, 0x76, 0xd3, 0xf4, 0x30, 0x4b, 0xd8, 0x45, + 0x49, 0xd4, 0x92, 0xe0, 0xc5, 0x83, 0x89, 0x4a, 0x24, 0xc6, 0x93, 0xa6, 0x46, 0x0f, 0xde, 0x46, + 0x3a, 0x92, 0x89, 0xd0, 0xa9, 0x33, 0xe3, 0xbf, 0x6f, 0xe1, 0x87, 0xf0, 0xc3, 0x70, 0xe4, 0xe8, + 0xc9, 0x18, 0xf8, 0x22, 0x86, 0xa1, 0x95, 0x52, 0x3b, 0x72, 0x6b, 0x93, 0xe7, 0xf9, 0x3d, 0xef, + 0xbc, 0x4f, 0x5e, 0xf0, 0x5f, 0x3c, 0x50, 0x21, 0x24, 0x67, 0x3e, 0xbd, 0x69, 0xf5, 0xd8, 0x30, + 0x18, 0x50, 0xec, 0xf7, 0x48, 0xab, 0x4f, 0x7c, 0x22, 0xa8, 0x70, 0x02, 0xce, 0x24, 0x83, 0x7f, + 0x62, 0x2a, 0x67, 0xa1, 0xb2, 0xab, 0x7d, 0xd6, 0x67, 0x4a, 0xd2, 0x9a, 0x7d, 0xcd, 0xd5, 0xf6, + 0x3f, 0x0d, 0x33, 0xc0, 0x1c, 0x0f, 0x43, 0xa4, 0xdd, 0xd0, 0x88, 0x88, 0x2f, 0xa9, 0xa4, 0x24, + 0x94, 0xd5, 0x5f, 0xb2, 0xa0, 0x7c, 0x34, 0x9f, 0xe5, 0x4c, 0x62, 0x49, 0xe0, 0x2e, 0xc8, 0xcf, + 0x39, 0x96, 0x59, 0x33, 0x9b, 0xa5, 0x36, 0x72, 0xd2, 0x67, 0x73, 0x4e, 0x95, 0xaa, 0x93, 0x1b, + 0xbd, 0xfd, 0x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6, 0x53, 0x64, 0xbc, 0x4e, 0x91, 0x71, + 0x89, 0xe2, 0x47, 0xf4, 0x18, 0x3f, 0x23, 0xf9, 0x14, 0x10, 0x71, 0x95, 0x57, 0x47, 0xb4, 0xfd, + 0x11, 0x00, 0x00, 0xff, 0xff, 0x96, 0xf3, 0x85, 0xab, 0xe6, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -424,13 +415,6 @@ func (m *GenesisIssuerDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Creator))) - i-- dAtA[i] = 0x12 } if len(m.Address) > 0 { @@ -583,10 +567,6 @@ func (m *GenesisIssuerDetails) Size() (n int) { if l > 0 { n += 1 + l + sovGenesis(uint64(l)) } - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } if m.Details != nil { l = m.Details.Size() n += 1 + l + sovGenesis(uint64(l)) @@ -915,38 +895,6 @@ func (m *GenesisIssuerDetails) Unmarshal(dAtA []byte) error { m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) } diff --git a/x/compliance/types/interfaces.go b/x/compliance/types/interfaces.go new file mode 100644 index 00000000..e83d4bff --- /dev/null +++ b/x/compliance/types/interfaces.go @@ -0,0 +1,13 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type ComplianceKeeper interface { + IterateOperatorDetails(ctx sdk.Context, callback func(address sdk.AccAddress) (continue_ bool)) + IterateIssuerDetails(ctx sdk.Context, callback func(address sdk.AccAddress) (continue_ bool)) + GetOperatorDetails(ctx sdk.Context, operator sdk.AccAddress) (*OperatorDetails, error) + GetIssuerDetails(ctx sdk.Context, issuerAddress sdk.AccAddress) (*IssuerDetails, error) + SetIssuerDetails(ctx sdk.Context, issuerAddress sdk.AccAddress, details *IssuerDetails) error +} diff --git a/x/compliance/types/keys.go b/x/compliance/types/keys.go index 530c56e8..2d048aea 100644 --- a/x/compliance/types/keys.go +++ b/x/compliance/types/keys.go @@ -24,13 +24,11 @@ const ( prefixAddressDetails prefixVerificationDetails prefixOperatorDetails - prefixIssuerCreators ) var ( KeyPrefixOperatorDetails = []byte{prefixOperatorDetails} KeyPrefixIssuerDetails = []byte{prefixIssuerDetails} - KeyPrefixIssuerCreators = []byte{prefixIssuerCreators} KeyPrefixAddressDetails = []byte{prefixAddressDetails} KeyPrefixVerificationDetails = []byte{prefixVerificationDetails} ) diff --git a/x/compliance/types/msg.go b/x/compliance/types/msg.go index 8ca63591..3a3b9a1e 100644 --- a/x/compliance/types/msg.go +++ b/x/compliance/types/msg.go @@ -108,7 +108,7 @@ func (msg *MsgSetVerificationStatus) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } -func NewCreateIssuerMsg(operatorAddress, issuerAddress, issuerName, issuerDescription, issuerURL, issuerLogo, issuerLegalEntity string) MsgCreateIssuer { +func NewCreateIssuerMsg(createAddress, issuerAddress, issuerName, issuerDescription, issuerURL, issuerLogo, issuerLegalEntity string) MsgCreateIssuer { issuerDetails := IssuerDetails{ Name: issuerName, Description: issuerDescription, @@ -117,7 +117,7 @@ func NewCreateIssuerMsg(operatorAddress, issuerAddress, issuerName, issuerDescri LegalEntity: issuerLegalEntity, } return MsgCreateIssuer{ - Signer: operatorAddress, + Signer: createAddress, Issuer: issuerAddress, Details: &issuerDetails, } @@ -150,8 +150,9 @@ func (msg *MsgCreateIssuer) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } -func NewUpdateIssuerDetailsMsg(operatorAddress, issuerAddress, issuerName, issuerDescription, issuerURL, issuerLogo, issuerLegalEntity string) MsgUpdateIssuerDetails { +func NewUpdateIssuerDetailsMsg(creatorAddress, issuerAddress, issuerName, issuerDescription, issuerURL, issuerLogo, issuerLegalEntity string) MsgUpdateIssuerDetails { issuerDetails := IssuerDetails{ + Creator: creatorAddress, Name: issuerName, Description: issuerDescription, Url: issuerURL, @@ -159,7 +160,7 @@ func NewUpdateIssuerDetailsMsg(operatorAddress, issuerAddress, issuerName, issue LegalEntity: issuerLegalEntity, } return MsgUpdateIssuerDetails{ - Signer: operatorAddress, + Signer: creatorAddress, Issuer: issuerAddress, Details: &issuerDetails, } @@ -173,7 +174,7 @@ func (msg *MsgUpdateIssuerDetails) GetSignBytes() []byte { func (msg *MsgUpdateIssuerDetails) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid operator address (%s)", err) + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid signer address (%s)", err) } _, err = sdk.AccAddressFromBech32(msg.Issuer) @@ -207,7 +208,7 @@ func (msg *MsgRemoveIssuer) GetSignBytes() []byte { func (msg *MsgRemoveIssuer) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid operator address (%s)", err) + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid signer address (%s)", err) } _, err = sdk.AccAddressFromBech32(msg.Issuer) diff --git a/x/compliance/types/proposal_test.go b/x/compliance/types/proposal_test.go index b9a242e4..944a962a 100644 --- a/x/compliance/types/proposal_test.go +++ b/x/compliance/types/proposal_test.go @@ -36,8 +36,8 @@ func (suite *ProposalTestSuite) SetupTest() { suite.validIssuer = tests.RandomAccAddress() // Set issuer details - issuerDetails := &types.IssuerDetails{Name: "testIssuer"} - err := suite.keeper.SetIssuerDetails(suite.ctx, suite.issuerCreator, suite.validIssuer, issuerDetails) + issuerDetails := &types.IssuerDetails{Creator: suite.issuerCreator.String(), Name: "testIssuer"} + err := suite.keeper.SetIssuerDetails(suite.ctx, suite.validIssuer, issuerDetails) suite.Require().NoError(err) // Set verification status as true for issuer details diff --git a/x/compliance/types/query.pb.go b/x/compliance/types/query.pb.go index c0300c6a..4395e239 100644 --- a/x/compliance/types/query.pb.go +++ b/x/compliance/types/query.pb.go @@ -669,6 +669,7 @@ type QueryIssuersDetailsResponse_MergedIssuerDetails struct { Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` Logo string `protobuf:"bytes,5,opt,name=logo,proto3" json:"logo,omitempty"` LegalEntity string `protobuf:"bytes,6,opt,name=legalEntity,proto3" json:"legalEntity,omitempty"` + Creator string `protobuf:"bytes,7,opt,name=creator,proto3" json:"creator,omitempty"` } func (m *QueryIssuersDetailsResponse_MergedIssuerDetails) Reset() { @@ -750,6 +751,13 @@ func (m *QueryIssuersDetailsResponse_MergedIssuerDetails) GetLegalEntity() strin return "" } +func (m *QueryIssuersDetailsResponse_MergedIssuerDetails) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + // QueryVerificationDetailsRequest is request type for the Query/VerificationDetails RPC method. type QueryVerificationDetailsRequest struct { VerificationID string `protobuf:"bytes,1,opt,name=verificationID,proto3" json:"verificationID,omitempty"` @@ -1090,83 +1098,83 @@ func init() { } var fileDescriptor_f80d6bdaf4aa1245 = []byte{ - // 1201 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0xdc, 0x44, + // 1212 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0xdc, 0x44, 0x14, 0x8e, 0xbb, 0xe9, 0xa6, 0x79, 0x9b, 0xa4, 0x61, 0xb2, 0x8a, 0xdc, 0xa5, 0xdd, 0x24, 0x4e, 0xf3, 0xa3, 0x8d, 0xba, 0x26, 0x9b, 0xb4, 0x0d, 0x15, 0x08, 0xa5, 0xa4, 0x44, 0xa9, 0x84, 0x28, 0x6e, 0x54, 0x09, 0x24, 0xb4, 0x9a, 0xac, 0xa7, 0xee, 0xd0, 0x5d, 0xdb, 0xf5, 0x38, 0xa1, 0x51, - 0x14, 0x21, 0x71, 0x41, 0x88, 0x0b, 0x12, 0x07, 0xee, 0x1c, 0x11, 0xe2, 0x0c, 0x88, 0x13, 0x17, - 0x7a, 0xac, 0xe0, 0xc2, 0x09, 0xa1, 0x84, 0x3f, 0x04, 0x79, 0x66, 0xdc, 0xb5, 0xa7, 0xf6, 0x76, - 0x37, 0x6a, 0x6f, 0xde, 0x37, 0xef, 0xbd, 0xef, 0x7b, 0x33, 0xdf, 0x9b, 0x79, 0x0b, 0x06, 0xfb, - 0x8c, 0x32, 0x16, 0x06, 0x9e, 0x4b, 0x1f, 0x9a, 0x4d, 0xaf, 0xed, 0xb7, 0x28, 0x76, 0x9b, 0xc4, - 0x7c, 0xb4, 0x4b, 0x82, 0xfd, 0x9a, 0x1f, 0x78, 0xa1, 0x87, 0x26, 0x13, 0x3e, 0xb5, 0x8e, 0x4f, - 0xa5, 0xec, 0x78, 0x8e, 0xc7, 0x5d, 0xcc, 0xe8, 0x4b, 0x78, 0x57, 0xce, 0x3b, 0x9e, 0xe7, 0xb4, - 0x88, 0x89, 0x7d, 0x6a, 0x62, 0xd7, 0xf5, 0x42, 0x1c, 0x52, 0xcf, 0x65, 0x72, 0xf5, 0x72, 0xd3, - 0x63, 0x6d, 0x8f, 0x99, 0x3b, 0x98, 0x49, 0x10, 0x73, 0x6f, 0x79, 0x87, 0x84, 0x78, 0xd9, 0xf4, - 0xb1, 0x43, 0x5d, 0xee, 0x2c, 0x7d, 0x67, 0x73, 0xb8, 0xf9, 0x38, 0xc0, 0xed, 0x38, 0xe1, 0x5c, - 0x8e, 0x13, 0x71, 0x43, 0x1a, 0x52, 0x22, 0xdd, 0x8c, 0x32, 0xa0, 0x0f, 0x23, 0xb4, 0x3b, 0x3c, - 0xd6, 0x22, 0x8f, 0x76, 0x09, 0x0b, 0x8d, 0xbb, 0x30, 0x91, 0xb2, 0x32, 0xdf, 0x73, 0x19, 0x41, - 0x6f, 0x41, 0x51, 0x60, 0xe8, 0xda, 0xb4, 0xb6, 0x58, 0xaa, 0x57, 0x6b, 0xd9, 0x3b, 0x50, 0x13, - 0x71, 0x37, 0x07, 0x9f, 0xfc, 0x33, 0x35, 0x60, 0xc9, 0x18, 0x63, 0x13, 0x5e, 0xe7, 0x49, 0x3f, - 0xf0, 0x49, 0x80, 0x43, 0x2f, 0xd8, 0x20, 0x21, 0xa6, 0xad, 0x18, 0x13, 0x2d, 0xc2, 0x59, 0x4f, - 0xae, 0xac, 0xdb, 0x76, 0x40, 0x98, 0x40, 0x19, 0xb6, 0x54, 0xb3, 0x81, 0xe1, 0x7c, 0x76, 0x22, - 0x49, 0x73, 0x1d, 0x86, 0x6c, 0x61, 0x92, 0x3c, 0x17, 0xf2, 0x78, 0xaa, 0x19, 0xe2, 0x38, 0xe3, - 0x1a, 0x54, 0x38, 0x84, 0x84, 0x54, 0xa8, 0xea, 0x30, 0x84, 0x53, 0x14, 0xe3, 0x9f, 0xc6, 0x47, - 0xb2, 0x46, 0x35, 0x4e, 0x32, 0xbb, 0x01, 0x83, 0x36, 0x0e, 0xb1, 0xa4, 0x35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0x61, 0xe8, 0x17, 0x0d, 0x46, + 0xd3, 0x77, 0xec, 0x72, 0x0f, 0xcb, 0x81, 0x42, 0xb3, 0xde, 0x4f, 0x8a, 0xe4, 0x78, 0x8d, 0x73, + 0x7c, 0x0b, 0xd5, 0xf2, 0x38, 0x8a, 0xa9, 0x33, 0x0f, 0x52, 0x9f, 0x9b, 0x43, 0xf4, 0x83, 0x06, + 0x63, 0xe9, 0x0d, 0x05, 0xd5, 0xfb, 0x5a, 0x67, 0x7a, 0x11, 0x43, 0xf6, 0x0a, 0x64, 0x2c, 0x70, + 0xce, 0x33, 0x68, 0xaa, 0x3b, 0x67, 0x86, 0xfe, 0xd4, 0x60, 0x22, 0xeb, 0x8b, 0x7e, 0xbd, 0xe7, + 0x2b, 0x4a, 0xa1, 0xbb, 0xd6, 0x7f, 0xa2, 0xe4, 0xfc, 0x2e, 0xe7, 0x7c, 0x1d, 0x5d, 0xcd, 0xe3, + 0x9c, 0xfc, 0xe8, 0x99, 0x07, 0xe9, 0x4b, 0xe0, 0x10, 0xfd, 0xa6, 0x41, 0x39, 0xeb, 0xea, 0x44, + 0x6b, 0x27, 0xb8, 0x6d, 0x45, 0x2f, 0x6f, 0x9f, 0xf8, 0x9e, 0x36, 0xae, 0xf0, 0x66, 0x16, 0xd0, + 0x5c, 0x2f, 0xcd, 0xb0, 0x9b, 0x6b, 0x4f, 0x8e, 0xaa, 0xda, 0xd3, 0xa3, 0xaa, 0xf6, 0xef, 0x51, + 0x55, 0xfb, 0xf6, 0xb8, 0x3a, 0xf0, 0xf4, 0xb8, 0x3a, 0xf0, 0xf7, 0x71, 0x75, 0xe0, 0xd3, 0x6a, + 0x32, 0xff, 0x71, 0xb2, 0x42, 0xb8, 0xef, 0x13, 0xb6, 0x53, 0xe4, 0xff, 0x06, 0xac, 0xfc, 0x1f, + 0x00, 0x00, 0xff, 0xff, 0x24, 0x98, 0xa0, 0xc1, 0xf7, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2006,6 +2014,13 @@ func (m *QueryIssuersDetailsResponse_MergedIssuerDetails) MarshalToSizedBuffer(d _ = i var l int _ = l + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x3a + } if len(m.LegalEntity) > 0 { i -= len(m.LegalEntity) copy(dAtA[i:], m.LegalEntity) @@ -2513,6 +2528,10 @@ func (m *QueryIssuersDetailsResponse_MergedIssuerDetails) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -4051,6 +4070,38 @@ func (m *QueryIssuersDetailsResponse_MergedIssuerDetails) Unmarshal(dAtA []byte) } m.LegalEntity = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/evm/keeper/sgxvm_connector_test.go b/x/evm/keeper/sgxvm_connector_test.go index 675a1843..4853ad39 100644 --- a/x/evm/keeper/sgxvm_connector_test.go +++ b/x/evm/keeper/sgxvm_connector_test.go @@ -325,8 +325,9 @@ func (suite *KeeperTestSuite) TestSingleVerificationDetails() { illegalIssuerAccount = tests.RandomAccAddress() // Verify issuer to add verification details which are verified by issuer - _ = suite.app.ComplianceKeeper.SetIssuerDetails(suite.ctx, issuerCreator, issuerAccount, &compliancetypes.IssuerDetails{ - Name: "test issuer", + _ = suite.app.ComplianceKeeper.SetIssuerDetails(suite.ctx, issuerAccount, &compliancetypes.IssuerDetails{ + Creator: issuerCreator.String(), + Name: "test issuer", }) _ = suite.app.ComplianceKeeper.SetAddressVerificationStatus(suite.ctx, issuerAccount, true) @@ -540,8 +541,9 @@ func (suite *KeeperTestSuite) TestMultipleVerificationDetails() { ) // Verify issuer to add verification details which are verified by issuer - _ = suite.app.ComplianceKeeper.SetIssuerDetails(suite.ctx, issuerCreator, issuerAccount, &compliancetypes.IssuerDetails{ - Name: "test issuer", + _ = suite.app.ComplianceKeeper.SetIssuerDetails(suite.ctx, issuerAccount, &compliancetypes.IssuerDetails{ + Creator: issuerCreator.String(), + Name: "test issuer", }) _ = suite.app.ComplianceKeeper.SetAddressVerificationStatus(suite.ctx, issuerAccount, true)