mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-08 04:04:12 +00:00
feature/1149 vault allocation error (#1173)
- **refactor: update devbox configuration and scripts** - **refactor: remove web documentation** - **refactor: move resolver formatter to services package** - **refactor: Rename x/vault -> x/dwn and x/service -> x/svc** - **refactor: remove unused dependencies and simplify module imports** - **refactor: remove dependency on DWN.pkl** - **refactor: Move IPFS interaction functions to common package** - **refactor: remove unused TUI components** - **feat: add gum package and update devbox configuration** - **refactor: rename Assertion to Account and update related code** - **fix: resolve rendering issue in login modal** - **refactor: migrate build system from Taskfile to Makefile** - **refactor: Deployment setup** - **refactor: Update Credential table to match WebAuthn Credential Descriptor** - **feat: add fast reflection methods for Capability and Resource** - **fix: update devbox lockfile** - **feat: add support for parent field and resources list in Capability message** - **feature/1149-vault-allocation-error** - **fix: adjust fullscreen modal close button margin**
This commit is contained in:
+11
-18
@@ -1,20 +1,13 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
|
||||
didv1 "github.com/onsonr/sonr/api/did/v1"
|
||||
)
|
||||
|
||||
func LoadFromTableEntry(ctx sdk.Context, entry *didv1.Controller) (ControllerI, error) {
|
||||
k, err := hexutil.Decode(entry.PublicKeyHex)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &controller{
|
||||
address: entry.Did,
|
||||
chainID: ctx.ChainID(),
|
||||
publicKey: k,
|
||||
}, nil
|
||||
}
|
||||
// func LoadFromTableEntry(ctx sdk.Context, entry *didv1.Controller) (ControllerI, error) {
|
||||
// k, err := hexutil.Decode(entry.PublicKeyHex)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return &controller{
|
||||
// address: entry.Did,
|
||||
// chainID: ctx.ChainID(),
|
||||
// publicKey: k,
|
||||
// }, nil
|
||||
// }
|
||||
|
||||
+12
-12
@@ -23,18 +23,18 @@ func (k Keeper) NewController(ctx sdk.Context) (controller.ControllerI, error) {
|
||||
return controller, nil
|
||||
}
|
||||
|
||||
func (k Keeper) ResolveController(ctx sdk.Context, did string) (controller.ControllerI, error) {
|
||||
ct, err := k.OrmDB.ControllerTable().GetByDid(ctx, did)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c, err := controller.LoadFromTableEntry(ctx, ct)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// func (k Keeper) ResolveController(ctx sdk.Context, did string) (controller.ControllerI, error) {
|
||||
// ct, err := k.OrmDB.ControllerTable().GetByDid(ctx, did)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// c, err := controller.LoadFromTableEntry(ctx, ct)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// return c, nil
|
||||
// }
|
||||
//
|
||||
// Logger returns the logger
|
||||
func (k Keeper) Logger() log.Logger {
|
||||
return k.logger
|
||||
|
||||
@@ -16,11 +16,6 @@ type PubKeyI interface {
|
||||
// GetJwk() *commonv1.JSONWebKey
|
||||
}
|
||||
|
||||
// PubKey defines a generic pubkey.
|
||||
type PublicKey interface {
|
||||
VerifySignature(msg, sig []byte) bool
|
||||
}
|
||||
|
||||
type PubKeyG[T any] interface {
|
||||
*T
|
||||
PublicKey
|
||||
|
||||
+109
-1092
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,18 @@
|
||||
# `x/vault`
|
||||
# `x/dwn`
|
||||
|
||||
The Vault module is responsible for the management of IPFS deployed Decentralized Web Nodes (DWNs) and their associated data.
|
||||
The DWN module is responsible for the management of IPFS deployed Decentralized Web Nodes (DWNs) and their associated data.
|
||||
|
||||
## Concepts
|
||||
|
||||
The Vault module introduces several key concepts:
|
||||
The DWN module introduces several key concepts:
|
||||
|
||||
1. Decentralized Web Node (DWN): A distributed network for storing and sharing data.
|
||||
2. Schema: A structure defining the format of various data types in the vault.
|
||||
2. Schema: A structure defining the format of various data types in the dwn.
|
||||
3. IPFS Integration: The module can interact with IPFS for decentralized data storage.
|
||||
|
||||
## State
|
||||
|
||||
The Vault module maintains the following state:
|
||||
The DWN module maintains the following state:
|
||||
|
||||
### DWN State
|
||||
|
||||
@@ -62,15 +62,15 @@ message Schema {
|
||||
|
||||
## State Transitions
|
||||
|
||||
State transitions in the Vault module are primarily triggered by:
|
||||
State transitions in the DWN module are primarily triggered by:
|
||||
|
||||
1. Updating module parameters
|
||||
2. Allocating new vaults
|
||||
2. Allocating new dwns
|
||||
3. Syncing DID documents
|
||||
|
||||
## Messages
|
||||
|
||||
The Vault module defines the following message:
|
||||
The DWN module defines the following message:
|
||||
|
||||
1. `MsgUpdateParams`: Used to update the module parameters.
|
||||
|
||||
@@ -91,19 +91,19 @@ No specific end-block operations are defined for this module.
|
||||
|
||||
## Hooks
|
||||
|
||||
The Vault module does not define any hooks.
|
||||
The DWN module does not define any hooks.
|
||||
|
||||
## Events
|
||||
|
||||
The Vault module does not explicitly define any events. However, standard Cosmos SDK events may be emitted during state transitions.
|
||||
The DWN module does not explicitly define any events. However, standard Cosmos SDK events may be emitted during state transitions.
|
||||
|
||||
## Client
|
||||
|
||||
The Vault module provides the following gRPC query endpoints:
|
||||
The DWN module provides the following gRPC query endpoints:
|
||||
|
||||
1. `Params`: Queries all parameters of the module.
|
||||
2. `Schema`: Queries the DID document schema.
|
||||
3. `Allocate`: Initializes a Target Vault available for claims.
|
||||
3. `Allocate`: Initializes a Target DWN available for claims.
|
||||
4. `Sync`: Queries the DID document by its ID and returns required information.
|
||||
|
||||
## Params
|
||||
@@ -112,7 +112,7 @@ The module parameters include:
|
||||
|
||||
- `ipfs_active` (bool): Indicates if IPFS integration is active.
|
||||
- `local_registration_enabled` (bool): Indicates if local registration is enabled.
|
||||
- `schema` (Schema): Defines the structure for various data types in the vault.
|
||||
- `schema` (Schema): Defines the structure for various data types in the dwn.
|
||||
|
||||
## Future Improvements
|
||||
|
||||
@@ -129,7 +129,7 @@ Acceptance tests should cover:
|
||||
1. Parameter updates
|
||||
2. DWN state management
|
||||
3. Schema queries
|
||||
4. Vault allocation process
|
||||
4. DWN allocation process
|
||||
5. DID document syncing
|
||||
|
||||
## Appendix
|
||||
@@ -2,7 +2,7 @@ package module
|
||||
|
||||
import (
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
modulev1 "github.com/onsonr/sonr/api/vault/v1"
|
||||
modulev1 "github.com/onsonr/sonr/api/dwn/v1"
|
||||
)
|
||||
|
||||
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
)
|
||||
|
||||
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
||||
@@ -1,15 +1,13 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/client/tx"
|
||||
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
)
|
||||
|
||||
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
||||
@@ -46,16 +44,9 @@ func MsgUpdateParams() *cobra.Command {
|
||||
|
||||
senderAddress := cliCtx.GetFromAddress()
|
||||
|
||||
someValue, err := strconv.ParseBool(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msg := &types.MsgUpdateParams{
|
||||
Authority: senderAddress.String(),
|
||||
Params: types.Params{
|
||||
IpfsActive: someValue,
|
||||
},
|
||||
Params: types.Params{},
|
||||
}
|
||||
|
||||
if err := msg.Validate(); err != nil {
|
||||
@@ -3,21 +3,21 @@ package module
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
|
||||
"cosmossdk.io/core/address"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/store"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
|
||||
modulev1 "github.com/onsonr/sonr/api/vault/module/v1"
|
||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||
"github.com/onsonr/sonr/x/vault/keeper"
|
||||
modulev1 "github.com/onsonr/sonr/api/dwn/module/v1"
|
||||
"github.com/onsonr/sonr/x/dwn/keeper"
|
||||
)
|
||||
|
||||
var _ appmodule.AppModule = AppModule{}
|
||||
@@ -42,8 +42,6 @@ type ModuleInputs struct {
|
||||
StoreService store.KVStoreService
|
||||
AddressCodec address.Codec
|
||||
|
||||
AccountKeeper authkeeper.AccountKeeper
|
||||
DidKeeper didkeeper.Keeper
|
||||
StakingKeeper stakingkeeper.Keeper
|
||||
SlashingKeeper slashingkeeper.Keeper
|
||||
}
|
||||
@@ -58,8 +56,8 @@ type ModuleOutputs struct {
|
||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||
|
||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.AccountKeeper, in.DidKeeper)
|
||||
m := NewAppModule(in.Cdc, k, in.DidKeeper)
|
||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr)
|
||||
m := NewAppModule(in.Cdc, k)
|
||||
|
||||
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package keeper_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -12,8 +12,6 @@ func TestGenesis(t *testing.T) {
|
||||
|
||||
genesisState := &types.GenesisState{
|
||||
Params: types.DefaultParams(),
|
||||
|
||||
// this line is used by starport scaffolding # genesis/test/state
|
||||
}
|
||||
|
||||
f.k.InitGenesis(f.ctx, genesisState)
|
||||
@@ -21,5 +19,4 @@ func TestGenesis(t *testing.T) {
|
||||
got := f.k.ExportGenesis(f.ctx)
|
||||
require.NotNil(t, got)
|
||||
|
||||
// this line is used by starport scaffolding # genesis/test/assert
|
||||
}
|
||||
@@ -1,20 +1,20 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
"cosmossdk.io/collections"
|
||||
storetypes "cosmossdk.io/core/store"
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/orm/model/ormdb"
|
||||
nftkeeper "cosmossdk.io/x/nft/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper"
|
||||
|
||||
apiv1 "github.com/onsonr/sonr/api/service/v1"
|
||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
|
||||
apiv1 "github.com/onsonr/sonr/api/dwn/v1"
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
)
|
||||
|
||||
type Keeper struct {
|
||||
@@ -28,11 +28,6 @@ type Keeper struct {
|
||||
OrmDB apiv1.StateStore
|
||||
|
||||
authority string
|
||||
|
||||
DidKeeper didkeeper.Keeper
|
||||
GroupKeeper groupkeeper.Keeper
|
||||
NFTKeeper nftkeeper.Keeper
|
||||
VaultKeeper vaultkeeper.Keeper
|
||||
}
|
||||
|
||||
// NewKeeper creates a new Keeper instance
|
||||
@@ -41,10 +36,6 @@ func NewKeeper(
|
||||
storeService storetypes.KVStoreService,
|
||||
logger log.Logger,
|
||||
authority string,
|
||||
didKeeper didkeeper.Keeper,
|
||||
groupKeeper groupkeeper.Keeper,
|
||||
nftKeeper nftkeeper.Keeper,
|
||||
vaultKeeper vaultkeeper.Keeper,
|
||||
) Keeper {
|
||||
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
||||
|
||||
@@ -72,10 +63,6 @@ func NewKeeper(
|
||||
OrmDB: store,
|
||||
|
||||
authority: authority,
|
||||
|
||||
DidKeeper: didKeeper,
|
||||
GroupKeeper: groupKeeper,
|
||||
NFTKeeper: nftKeeper,
|
||||
}
|
||||
|
||||
schema, err := sb.Build()
|
||||
@@ -87,3 +74,28 @@ func NewKeeper(
|
||||
|
||||
return k
|
||||
}
|
||||
|
||||
func (k Keeper) Logger() log.Logger {
|
||||
return k.logger
|
||||
}
|
||||
|
||||
// InitGenesis initializes the module's state from a genesis state.
|
||||
func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
|
||||
if err := data.Params.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return k.Params.Set(ctx, data.Params)
|
||||
}
|
||||
|
||||
// ExportGenesis exports the module's state to a genesis state.
|
||||
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
|
||||
params, err := k.Params.Get(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return &types.GenesisState{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,14 @@ package keeper_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"cosmossdk.io/core/store"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
"github.com/cosmos/cosmos-sdk/runtime"
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/integration"
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||
@@ -15,18 +18,16 @@ import (
|
||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||
module "github.com/onsonr/sonr/x/vault"
|
||||
"github.com/onsonr/sonr/x/vault/keeper"
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
module "github.com/onsonr/sonr/x/dwn"
|
||||
"github.com/onsonr/sonr/x/dwn/keeper"
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
)
|
||||
|
||||
var maccPerms = map[string][]string{
|
||||
@@ -50,7 +51,6 @@ type testFixture struct {
|
||||
bankkeeper bankkeeper.BaseKeeper
|
||||
stakingKeeper *stakingkeeper.Keeper
|
||||
mintkeeper mintkeeper.Keeper
|
||||
didk didkeeper.Keeper
|
||||
|
||||
addrs []sdk.AccAddress
|
||||
govModAddr string
|
||||
@@ -59,7 +59,6 @@ type testFixture struct {
|
||||
func SetupTest(t *testing.T) *testFixture {
|
||||
t.Helper()
|
||||
f := new(testFixture)
|
||||
require := require.New(t)
|
||||
|
||||
// Base setup
|
||||
logger := log.NewTestLogger(t)
|
||||
@@ -68,20 +67,17 @@ func SetupTest(t *testing.T) *testFixture {
|
||||
f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||
f.addrs = simtestutil.CreateIncrementalAccounts(3)
|
||||
|
||||
key := storetypes.NewKVStoreKey(types.ModuleName)
|
||||
storeService := runtime.NewKVStoreService(key)
|
||||
testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test"))
|
||||
|
||||
f.ctx = testCtx.Ctx
|
||||
keys := storetypes.NewKVStoreKeys(authtypes.ModuleName, banktypes.ModuleName, stakingtypes.ModuleName, minttypes.ModuleName, types.ModuleName)
|
||||
f.ctx = sdk.NewContext(integration.CreateMultiStore(keys, logger), cmtproto.Header{}, false, logger)
|
||||
|
||||
// Register SDK modules.
|
||||
registerBaseSDKModules(f, encCfg, storeService, logger, require)
|
||||
registerBaseSDKModules(logger, f, encCfg, keys)
|
||||
|
||||
// Setup Keeper.
|
||||
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr, f.accountkeeper, f.didk)
|
||||
f.k = keeper.NewKeeper(encCfg.Codec, runtime.NewKVStoreService(keys[types.ModuleName]), logger, f.govModAddr)
|
||||
f.msgServer = keeper.NewMsgServerImpl(f.k)
|
||||
f.queryServer = keeper.NewQuerier(f.k)
|
||||
f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.didk)
|
||||
f.appModule = module.NewAppModule(encCfg.Codec, f.k)
|
||||
|
||||
return f
|
||||
}
|
||||
@@ -89,22 +85,23 @@ func SetupTest(t *testing.T) *testFixture {
|
||||
func registerModuleInterfaces(encCfg moduletestutil.TestEncodingConfig) {
|
||||
authtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
banktypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
minttypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
|
||||
types.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
}
|
||||
|
||||
func registerBaseSDKModules(
|
||||
logger log.Logger,
|
||||
f *testFixture,
|
||||
encCfg moduletestutil.TestEncodingConfig,
|
||||
storeService store.KVStoreService,
|
||||
logger log.Logger,
|
||||
require *require.Assertions,
|
||||
keys map[string]*storetypes.KVStoreKey,
|
||||
) {
|
||||
registerModuleInterfaces(encCfg)
|
||||
|
||||
// Auth Keeper.
|
||||
f.accountkeeper = authkeeper.NewAccountKeeper(
|
||||
encCfg.Codec, storeService,
|
||||
encCfg.Codec, runtime.NewKVStoreService(keys[authtypes.StoreKey]),
|
||||
authtypes.ProtoBaseAccount,
|
||||
maccPerms,
|
||||
authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix,
|
||||
@@ -113,7 +110,7 @@ func registerBaseSDKModules(
|
||||
|
||||
// Bank Keeper.
|
||||
f.bankkeeper = bankkeeper.NewBaseKeeper(
|
||||
encCfg.Codec, storeService,
|
||||
encCfg.Codec, runtime.NewKVStoreService(keys[banktypes.StoreKey]),
|
||||
f.accountkeeper,
|
||||
nil,
|
||||
f.govModAddr, logger,
|
||||
@@ -121,21 +118,16 @@ func registerBaseSDKModules(
|
||||
|
||||
// Staking Keeper.
|
||||
f.stakingKeeper = stakingkeeper.NewKeeper(
|
||||
encCfg.Codec, storeService,
|
||||
encCfg.Codec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]),
|
||||
f.accountkeeper, f.bankkeeper, f.govModAddr,
|
||||
authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr),
|
||||
authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
|
||||
)
|
||||
require.NoError(f.stakingKeeper.SetParams(f.ctx, stakingtypes.DefaultParams()))
|
||||
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetNotBondedPool(f.ctx))
|
||||
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetBondedPool(f.ctx))
|
||||
|
||||
// Mint Keeper.
|
||||
f.mintkeeper = mintkeeper.NewKeeper(
|
||||
encCfg.Codec, storeService,
|
||||
encCfg.Codec, runtime.NewKVStoreService(keys[minttypes.StoreKey]),
|
||||
f.stakingKeeper, f.accountkeeper, f.bankkeeper,
|
||||
authtypes.FeeCollectorName, f.govModAddr,
|
||||
)
|
||||
f.accountkeeper.SetModuleAccount(f.ctx, f.accountkeeper.GetModuleAccount(f.ctx, minttypes.ModuleName))
|
||||
f.mintkeeper.InitGenesis(f.ctx, f.accountkeeper, minttypes.DefaultGenesisState())
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
"cosmossdk.io/errors"
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
)
|
||||
|
||||
type msgServer struct {
|
||||
@@ -27,3 +27,10 @@ func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams
|
||||
|
||||
return nil, ms.k.Params.Set(ctx, msg.Params)
|
||||
}
|
||||
|
||||
// Initialize implements types.MsgServer.
|
||||
func (ms msgServer) Initialize(ctx context.Context, msg *types.MsgInitialize) (*types.MsgInitializeResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
panic("Initialize is unimplemented")
|
||||
return &types.MsgInitializeResponse{}, nil
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
)
|
||||
|
||||
func TestParams(t *testing.T) {
|
||||
@@ -0,0 +1,51 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
)
|
||||
|
||||
var _ types.QueryServer = Querier{}
|
||||
|
||||
type Querier struct {
|
||||
Keeper
|
||||
}
|
||||
|
||||
func NewQuerier(keeper Keeper) Querier {
|
||||
return Querier{Keeper: keeper}
|
||||
}
|
||||
|
||||
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
|
||||
p, err := k.Keeper.Params.Get(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &types.QueryParamsResponse{Params: &p}, nil
|
||||
}
|
||||
|
||||
// Schema implements types.QueryServer.
|
||||
func (k Querier) Schema(goCtx context.Context, req *types.QuerySchemaRequest) (*types.QuerySchemaResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
panic("Schema is unimplemented")
|
||||
return &types.QuerySchemaResponse{}, nil
|
||||
}
|
||||
|
||||
// Allocate implements types.QueryServer.
|
||||
func (k Querier) Allocate(goCtx context.Context, req *types.QueryAllocateRequest) (*types.QueryAllocateResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
panic("Allocate is unimplemented")
|
||||
return &types.QueryAllocateResponse{}, nil
|
||||
}
|
||||
|
||||
// Sync implements types.QueryServer.
|
||||
func (k Querier) Sync(goCtx context.Context, req *types.QuerySyncRequest) (*types.QuerySyncResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
panic("Sync is unimplemented")
|
||||
return &types.QuerySyncResponse{}, nil
|
||||
}
|
||||
@@ -4,27 +4,27 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
|
||||
"cosmossdk.io/client/v2/autocli"
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
|
||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||
"github.com/onsonr/sonr/x/service/keeper"
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
"github.com/onsonr/sonr/x/dwn/keeper"
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
)
|
||||
|
||||
const (
|
||||
// ConsensusVersion defines the current x/service module consensus version.
|
||||
// ConsensusVersion defines the current x/dwn module consensus version.
|
||||
ConsensusVersion = 1
|
||||
|
||||
// this line is used by starport scaffolding # simapp/module/const
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -44,19 +44,16 @@ type AppModule struct {
|
||||
AppModuleBasic
|
||||
|
||||
keeper keeper.Keeper
|
||||
didk didkeeper.Keeper
|
||||
}
|
||||
|
||||
// NewAppModule constructor
|
||||
func NewAppModule(
|
||||
cdc codec.Codec,
|
||||
keeper keeper.Keeper,
|
||||
didkeeper didkeeper.Keeper,
|
||||
) *AppModule {
|
||||
return &AppModule{
|
||||
AppModuleBasic: AppModuleBasic{cdc: cdc},
|
||||
keeper: keeper,
|
||||
didk: didkeeper,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
// this line is used by starport scaffolding # 1
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -26,7 +25,6 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
}
|
||||
|
||||
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
// this line is used by starport scaffolding # 3
|
||||
|
||||
registry.RegisterImplementations(
|
||||
(*sdk.Msg)(nil),
|
||||
@@ -1,6 +1,35 @@
|
||||
package types
|
||||
|
||||
// this line is used by starport scaffolding # genesis/types/import
|
||||
// Define capability hierarchy for smart account operations
|
||||
const (
|
||||
// Root capabilities
|
||||
CAP_OWNER = "OWNER" // Full account control
|
||||
CAP_OPERATOR = "OPERATOR" // Can perform operations
|
||||
CAP_OBSERVER = "OBSERVER" // Can view account state
|
||||
|
||||
// Operation capabilities
|
||||
CAP_EXECUTE = "EXECUTE" // Can execute transactions
|
||||
CAP_PROPOSE = "PROPOSE" // Can propose transactions
|
||||
CAP_SIGN = "SIGN" // Can sign transactions
|
||||
|
||||
// Policy capabilities
|
||||
CAP_SET_POLICY = "SET_POLICY" // Can modify account policies
|
||||
CAP_SET_THRESHOLD = "SET_THRESHOLD" // Can modify signing threshold
|
||||
|
||||
// Recovery capabilities
|
||||
CAP_RECOVER = "RECOVER" // Can initiate recovery
|
||||
CAP_SOCIAL = "SOCIAL" // Can act as social recovery
|
||||
)
|
||||
|
||||
// Resource types for smart account operations
|
||||
type ResourceType string
|
||||
|
||||
const (
|
||||
RES_ACCOUNT = "account"
|
||||
RES_TRANSACTION = "tx"
|
||||
RES_POLICY = "policy"
|
||||
RES_RECOVERY = "recovery"
|
||||
)
|
||||
|
||||
// DefaultIndex is the default global index
|
||||
const DefaultIndex uint64 = 1
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: vault/v1/genesis.proto
|
||||
// source: dwn/v1/genesis.proto
|
||||
|
||||
package types
|
||||
|
||||
@@ -34,7 +34,7 @@ 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_4c971b352fb6cc17, []int{0}
|
||||
return fileDescriptor_8e7492a25d5871dc, []int{0}
|
||||
}
|
||||
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -80,7 +80,7 @@ type Params struct {
|
||||
func (m *Params) Reset() { *m = Params{} }
|
||||
func (*Params) ProtoMessage() {}
|
||||
func (*Params) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_4c971b352fb6cc17, []int{1}
|
||||
return fileDescriptor_8e7492a25d5871dc, []int{1}
|
||||
}
|
||||
func (m *Params) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -130,6 +130,129 @@ func (m *Params) GetSchema() *Schema {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Capability reprensents the available capabilities of a decentralized web node
|
||||
type Capability struct {
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"`
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Resources []string `protobuf:"bytes,4,rep,name=resources,proto3" json:"resources,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Capability) Reset() { *m = Capability{} }
|
||||
func (m *Capability) String() string { return proto.CompactTextString(m) }
|
||||
func (*Capability) ProtoMessage() {}
|
||||
func (*Capability) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8e7492a25d5871dc, []int{2}
|
||||
}
|
||||
func (m *Capability) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Capability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Capability.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 *Capability) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Capability.Merge(m, src)
|
||||
}
|
||||
func (m *Capability) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Capability) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Capability.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Capability proto.InternalMessageInfo
|
||||
|
||||
func (m *Capability) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Capability) GetParent() string {
|
||||
if m != nil {
|
||||
return m.Parent
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Capability) GetDescription() string {
|
||||
if m != nil {
|
||||
return m.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Capability) GetResources() []string {
|
||||
if m != nil {
|
||||
return m.Resources
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Resource reprensents the available resources of a decentralized web node
|
||||
type Resource struct {
|
||||
Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
|
||||
Template string `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Resource) Reset() { *m = Resource{} }
|
||||
func (m *Resource) String() string { return proto.CompactTextString(m) }
|
||||
func (*Resource) ProtoMessage() {}
|
||||
func (*Resource) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8e7492a25d5871dc, []int{3}
|
||||
}
|
||||
func (m *Resource) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Resource.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 *Resource) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Resource.Merge(m, src)
|
||||
}
|
||||
func (m *Resource) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Resource) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Resource.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Resource proto.InternalMessageInfo
|
||||
|
||||
func (m *Resource) GetKind() string {
|
||||
if m != nil {
|
||||
return m.Kind
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Resource) GetTemplate() string {
|
||||
if m != nil {
|
||||
return m.Template
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Schema is the Database Model for Decentralized Web Nodes
|
||||
type Schema struct {
|
||||
Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
|
||||
Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"`
|
||||
@@ -147,7 +270,7 @@ func (m *Schema) Reset() { *m = Schema{} }
|
||||
func (m *Schema) String() string { return proto.CompactTextString(m) }
|
||||
func (*Schema) ProtoMessage() {}
|
||||
func (*Schema) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_4c971b352fb6cc17, []int{2}
|
||||
return fileDescriptor_8e7492a25d5871dc, []int{4}
|
||||
}
|
||||
func (m *Schema) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -247,43 +370,50 @@ func (m *Schema) GetProfile() string {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*GenesisState)(nil), "vault.v1.GenesisState")
|
||||
proto.RegisterType((*Params)(nil), "vault.v1.Params")
|
||||
proto.RegisterType((*Schema)(nil), "vault.v1.Schema")
|
||||
proto.RegisterType((*GenesisState)(nil), "dwn.v1.GenesisState")
|
||||
proto.RegisterType((*Params)(nil), "dwn.v1.Params")
|
||||
proto.RegisterType((*Capability)(nil), "dwn.v1.Capability")
|
||||
proto.RegisterType((*Resource)(nil), "dwn.v1.Resource")
|
||||
proto.RegisterType((*Schema)(nil), "dwn.v1.Schema")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("vault/v1/genesis.proto", fileDescriptor_4c971b352fb6cc17) }
|
||||
func init() { proto.RegisterFile("dwn/v1/genesis.proto", fileDescriptor_8e7492a25d5871dc) }
|
||||
|
||||
var fileDescriptor_4c971b352fb6cc17 = []byte{
|
||||
// 434 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x31, 0x6f, 0xd3, 0x40,
|
||||
0x14, 0xc7, 0x6d, 0xda, 0xb8, 0xc9, 0xb5, 0x43, 0x39, 0x55, 0xe8, 0xc8, 0xe0, 0xa0, 0x8a, 0xa1,
|
||||
0x62, 0xb0, 0x55, 0xd8, 0x10, 0xaa, 0x44, 0x25, 0xc4, 0x8a, 0xdc, 0x8d, 0x25, 0x7a, 0x71, 0x5e,
|
||||
0x9d, 0x6b, 0x9c, 0x3b, 0xeb, 0xee, 0xe2, 0xd2, 0xaf, 0xc0, 0xc4, 0xc8, 0xd8, 0x0f, 0xc0, 0xc0,
|
||||
0xc7, 0xe8, 0xd8, 0x91, 0x09, 0xa1, 0x64, 0x80, 0x8f, 0xc0, 0x88, 0xee, 0x9d, 0x83, 0xa2, 0x2e,
|
||||
0xa7, 0xf7, 0xff, 0xfd, 0xff, 0x7e, 0xfa, 0xeb, 0xc9, 0xec, 0x49, 0x0b, 0xcb, 0xda, 0xe5, 0xed,
|
||||
0x69, 0x5e, 0xa1, 0x42, 0x2b, 0x6d, 0xd6, 0x18, 0xed, 0x34, 0xef, 0x13, 0xcf, 0xda, 0xd3, 0xe1,
|
||||
0x63, 0x58, 0x48, 0xa5, 0x73, 0x7a, 0x83, 0x39, 0x3c, 0xaa, 0x74, 0xa5, 0x69, 0xcc, 0xfd, 0x14,
|
||||
0xe8, 0xf1, 0x19, 0x3b, 0x78, 0x1f, 0x76, 0x5c, 0x38, 0x70, 0xc8, 0x33, 0x96, 0x34, 0x60, 0x60,
|
||||
0x61, 0x45, 0xfc, 0x2c, 0x3e, 0xd9, 0x7f, 0x79, 0x98, 0x6d, 0x76, 0x66, 0x1f, 0x88, 0x9f, 0xef,
|
||||
0xde, 0xfd, 0x1c, 0x45, 0x45, 0x97, 0x3a, 0xfe, 0x16, 0xb3, 0x24, 0x18, 0x7c, 0xc4, 0xf6, 0x65,
|
||||
0x73, 0x69, 0xc7, 0x50, 0x3a, 0xd9, 0x22, 0x7d, 0xdf, 0x2f, 0x98, 0x47, 0x6f, 0x89, 0xf0, 0x37,
|
||||
0x6c, 0x58, 0xeb, 0x12, 0xea, 0xb1, 0xc1, 0x4a, 0x5a, 0x67, 0xc0, 0x49, 0xad, 0xc6, 0xa8, 0x60,
|
||||
0x52, 0xe3, 0x54, 0x3c, 0xa2, 0xbc, 0xa0, 0x44, 0xb1, 0x15, 0x78, 0x17, 0x7c, 0x7e, 0xc2, 0x12,
|
||||
0x5b, 0xce, 0x70, 0x01, 0x62, 0xf7, 0x61, 0xb3, 0x0b, 0xe2, 0x45, 0xe7, 0xbf, 0x7e, 0xfa, 0xf5,
|
||||
0x76, 0x14, 0xfd, 0xb9, 0x1d, 0xc5, 0x9f, 0x7f, 0x7f, 0x7f, 0x71, 0x10, 0x6e, 0xd5, 0xd5, 0xfd,
|
||||
0x1b, 0xb3, 0x24, 0xa4, 0xb9, 0x60, 0x7b, 0x2d, 0x1a, 0x2b, 0xb5, 0xa2, 0xaa, 0xbd, 0x62, 0x23,
|
||||
0xbd, 0x03, 0x65, 0xa9, 0x97, 0xca, 0x51, 0xa9, 0x41, 0xb1, 0x91, 0xfc, 0x88, 0xf5, 0xc0, 0x5a,
|
||||
0x74, 0x62, 0x87, 0x78, 0x10, 0x9e, 0x96, 0x33, 0x90, 0x8a, 0x8a, 0x0d, 0x8a, 0x20, 0x78, 0xca,
|
||||
0x58, 0x69, 0x70, 0x8a, 0xca, 0x49, 0xa8, 0x45, 0x8f, 0xac, 0x2d, 0xc2, 0x0f, 0xd9, 0xce, 0x54,
|
||||
0x4e, 0x45, 0x42, 0x86, 0x1f, 0x3d, 0xb9, 0xba, 0x9e, 0x8b, 0xbd, 0x40, 0xae, 0xae, 0xe7, 0x7e,
|
||||
0x73, 0x65, 0x40, 0x39, 0xd1, 0x0f, 0x9b, 0x49, 0xf0, 0x21, 0xeb, 0xcf, 0xf1, 0xc6, 0xce, 0xc0,
|
||||
0xa0, 0x18, 0x90, 0xf1, 0x5f, 0xfb, 0xee, 0x8d, 0xd1, 0x97, 0xb2, 0x46, 0xc1, 0x42, 0xf7, 0x4e,
|
||||
0x9e, 0x9f, 0xdd, 0xad, 0xd2, 0xf8, 0x7e, 0x95, 0xc6, 0xbf, 0x56, 0x69, 0xfc, 0x65, 0x9d, 0x46,
|
||||
0xf7, 0xeb, 0x34, 0xfa, 0xb1, 0x4e, 0xa3, 0x8f, 0xcf, 0x2b, 0xe9, 0x66, 0xcb, 0x49, 0x56, 0xea,
|
||||
0x45, 0xae, 0x95, 0xd5, 0xca, 0xe4, 0xf4, 0x7c, 0xca, 0xc3, 0xed, 0xdc, 0x4d, 0x83, 0x76, 0x92,
|
||||
0xd0, 0x0f, 0xf3, 0xea, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x54, 0x04, 0x35, 0x7d, 0x02,
|
||||
0x00, 0x00,
|
||||
var fileDescriptor_8e7492a25d5871dc = []byte{
|
||||
// 519 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x93, 0x31, 0x6f, 0x13, 0x31,
|
||||
0x14, 0xc7, 0x73, 0x34, 0xbd, 0xe6, 0x5e, 0x2b, 0x04, 0x56, 0x85, 0x4c, 0x84, 0x2e, 0x51, 0x06,
|
||||
0x54, 0x21, 0x94, 0x53, 0x61, 0xab, 0xb2, 0x50, 0x84, 0x58, 0xd1, 0x75, 0x63, 0x89, 0x9c, 0xbb,
|
||||
0xd7, 0x8b, 0x9b, 0x3b, 0xfb, 0x64, 0x3b, 0x49, 0xf3, 0x15, 0x98, 0x18, 0x19, 0x3b, 0x33, 0xf1,
|
||||
0x31, 0x3a, 0x76, 0x64, 0x42, 0x28, 0x19, 0xe0, 0x23, 0x30, 0x22, 0xdb, 0x97, 0x12, 0x16, 0xeb,
|
||||
0xfd, 0x7f, 0xff, 0xe7, 0xe7, 0xff, 0x8b, 0x72, 0x70, 0x9c, 0x2f, 0x45, 0xb2, 0x38, 0x4d, 0x0a,
|
||||
0x14, 0xa8, 0xb9, 0x1e, 0xd6, 0x4a, 0x1a, 0x49, 0xc2, 0x7c, 0x29, 0x86, 0x8b, 0xd3, 0xee, 0x71,
|
||||
0x21, 0x0b, 0xe9, 0x50, 0x62, 0x2b, 0xef, 0x76, 0x1f, 0xb3, 0x8a, 0x0b, 0x99, 0xb8, 0xd3, 0xa3,
|
||||
0xc1, 0x08, 0x8e, 0xde, 0xfb, 0x09, 0x17, 0x86, 0x19, 0x24, 0x2f, 0x21, 0xac, 0x99, 0x62, 0x95,
|
||||
0xa6, 0x41, 0x3f, 0x38, 0x39, 0x7c, 0xf5, 0x70, 0xe8, 0x27, 0x0e, 0x3f, 0x38, 0x7a, 0xde, 0xbe,
|
||||
0xfd, 0xd1, 0x6b, 0xa5, 0x4d, 0xcf, 0xe0, 0x6b, 0x00, 0xa1, 0x37, 0x48, 0x0f, 0x0e, 0x79, 0x7d,
|
||||
0xa9, 0xc7, 0x2c, 0x33, 0x7c, 0x81, 0xee, 0x76, 0x27, 0x05, 0x8b, 0xde, 0x38, 0x42, 0x46, 0xd0,
|
||||
0x2d, 0x65, 0xc6, 0xca, 0xb1, 0xc2, 0x82, 0x6b, 0xa3, 0x98, 0xe1, 0x52, 0x8c, 0x51, 0xb0, 0x49,
|
||||
0x89, 0x39, 0x7d, 0xe0, 0xfa, 0xa9, 0xeb, 0x48, 0x77, 0x1a, 0xde, 0x79, 0x9f, 0x3c, 0x87, 0x50,
|
||||
0x67, 0x53, 0xac, 0x18, 0x6d, 0xff, 0x9f, 0xeb, 0xc2, 0xd1, 0xb4, 0x71, 0xcf, 0x9e, 0x7e, 0xb9,
|
||||
0xe9, 0xb5, 0x7e, 0xdf, 0xf4, 0x82, 0x4f, 0xbf, 0xbe, 0xbd, 0x38, 0x5a, 0xb0, 0x79, 0x69, 0x92,
|
||||
0x26, 0xec, 0x35, 0xc0, 0x5b, 0x56, 0xb3, 0x09, 0x2f, 0xb9, 0x59, 0x11, 0x02, 0x6d, 0xc1, 0x2a,
|
||||
0x1f, 0x34, 0x4a, 0x5d, 0x4d, 0x9e, 0xb8, 0xe5, 0x51, 0x18, 0x17, 0x27, 0x4a, 0x1b, 0x45, 0xfa,
|
||||
0x70, 0x98, 0xa3, 0xce, 0x14, 0xaf, 0x6d, 0x24, 0xba, 0xe7, 0xcc, 0x5d, 0x44, 0x9e, 0x41, 0xa4,
|
||||
0x50, 0xcb, 0xb9, 0xca, 0x50, 0xd3, 0x76, 0x7f, 0xef, 0x24, 0x4a, 0xff, 0x81, 0xc1, 0x19, 0x74,
|
||||
0xd2, 0x46, 0xd8, 0x77, 0x67, 0x5c, 0xe4, 0xdb, 0x77, 0x6d, 0x4d, 0xba, 0xd0, 0x31, 0x58, 0xd5,
|
||||
0x25, 0x33, 0xd8, 0xbc, 0x7c, 0xaf, 0x07, 0x7f, 0x02, 0x08, 0xfd, 0x8e, 0x84, 0xc2, 0xc1, 0x02,
|
||||
0x95, 0xb6, 0x11, 0xec, 0xed, 0xfd, 0x74, 0x2b, 0xad, 0xc3, 0xb2, 0x4c, 0xce, 0xef, 0x93, 0x6f,
|
||||
0x25, 0x39, 0x86, 0x7d, 0xa6, 0x35, 0x9a, 0x26, 0xb4, 0x17, 0x96, 0x66, 0x53, 0xc6, 0x85, 0xfb,
|
||||
0x31, 0xa3, 0xd4, 0x0b, 0x12, 0x03, 0x64, 0x0a, 0x73, 0x14, 0x86, 0xb3, 0x92, 0xee, 0x3b, 0x6b,
|
||||
0x87, 0x90, 0x47, 0xb0, 0x97, 0xf3, 0x9c, 0x86, 0xce, 0xb0, 0xa5, 0x25, 0x57, 0xcb, 0x19, 0x3d,
|
||||
0xf0, 0xe4, 0x6a, 0x39, 0xb3, 0x93, 0x0b, 0xc5, 0x84, 0xa1, 0x1d, 0x3f, 0xd9, 0x09, 0xbb, 0xe0,
|
||||
0x0c, 0x57, 0x7a, 0xca, 0x14, 0xd2, 0xc8, 0x2f, 0xb8, 0xd5, 0x36, 0x7b, 0xad, 0xe4, 0x25, 0x2f,
|
||||
0x91, 0x82, 0xcf, 0xde, 0xc8, 0xf3, 0xd1, 0xed, 0x3a, 0x0e, 0xee, 0xd6, 0x71, 0xf0, 0x73, 0x1d,
|
||||
0x07, 0x9f, 0x37, 0x71, 0xeb, 0x6e, 0x13, 0xb7, 0xbe, 0x6f, 0xe2, 0xd6, 0xc7, 0x41, 0xc1, 0xcd,
|
||||
0x74, 0x3e, 0x19, 0x66, 0xb2, 0x4a, 0xa4, 0xd0, 0x52, 0xa8, 0xc4, 0x1d, 0xd7, 0x89, 0xfd, 0x2a,
|
||||
0xcc, 0xaa, 0x46, 0x3d, 0x09, 0xdd, 0x1f, 0xfc, 0xf5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9d,
|
||||
0x36, 0x1c, 0x5c, 0x29, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *Params) Equal(that interface{}) bool {
|
||||
@@ -404,6 +534,96 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Capability) 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 *Capability) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Capability) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Resources) > 0 {
|
||||
for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.Resources[iNdEx])
|
||||
copy(dAtA[i:], m.Resources[iNdEx])
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Resources[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
}
|
||||
if len(m.Description) > 0 {
|
||||
i -= len(m.Description)
|
||||
copy(dAtA[i:], m.Description)
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Description)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Parent) > 0 {
|
||||
i -= len(m.Parent)
|
||||
copy(dAtA[i:], m.Parent)
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Parent)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Name) > 0 {
|
||||
i -= len(m.Name)
|
||||
copy(dAtA[i:], m.Name)
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Name)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Resource) 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 *Resource) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Template) > 0 {
|
||||
i -= len(m.Template)
|
||||
copy(dAtA[i:], m.Template)
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Template)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Kind) > 0 {
|
||||
i -= len(m.Kind)
|
||||
copy(dAtA[i:], m.Kind)
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Kind)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Schema) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
@@ -536,6 +756,50 @@ func (m *Params) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Capability) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Name)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
l = len(m.Parent)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
l = len(m.Description)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
if len(m.Resources) > 0 {
|
||||
for _, s := range m.Resources {
|
||||
l = len(s)
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Resource) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Kind)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
l = len(m.Template)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Schema) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
@@ -799,6 +1063,298 @@ func (m *Params) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Capability) 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: Capability: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Capability: 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 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.Name = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Parent", 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.Parent = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
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 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.Description = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Resources", 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.Resources = append(m.Resources, string(dAtA[iNdEx:postIndex]))
|
||||
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 *Resource) 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: Resource: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Kind", 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.Kind = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Template", 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.Template = string(dAtA[iNdEx:postIndex])
|
||||
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 *Schema) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@@ -3,7 +3,7 @@ package types_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -21,13 +21,9 @@ func TestGenesisState_Validate(t *testing.T) {
|
||||
},
|
||||
{
|
||||
desc: "valid genesis state",
|
||||
genState: &types.GenesisState{
|
||||
|
||||
// this line is used by starport scaffolding # types/genesis/validField
|
||||
},
|
||||
valid: true,
|
||||
genState: &types.GenesisState{},
|
||||
valid: true,
|
||||
},
|
||||
// this line is used by starport scaffolding # types/genesis/testcase
|
||||
}
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.desc, func(t *testing.T) {
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
)
|
||||
|
||||
const (
|
||||
ModuleName = "vault"
|
||||
ModuleName = "dwn"
|
||||
|
||||
StoreKey = ModuleName
|
||||
|
||||
@@ -21,7 +21,7 @@ const (
|
||||
|
||||
var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{
|
||||
SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{
|
||||
{Id: 1, ProtoFileName: "vault/v1/state.proto"},
|
||||
{Id: 1, ProtoFileName: "dwn/v1/state.proto"},
|
||||
},
|
||||
Prefix: []byte{0},
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: vault/v1/query.proto
|
||||
// source: dwn/v1/query.proto
|
||||
|
||||
package types
|
||||
|
||||
@@ -36,7 +36,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
|
||||
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryParamsRequest) ProtoMessage() {}
|
||||
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e6d49a2800ab3e4b, []int{0}
|
||||
return fileDescriptor_9a31dfed63924cb3, []int{0}
|
||||
}
|
||||
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -75,7 +75,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
|
||||
func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryParamsResponse) ProtoMessage() {}
|
||||
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e6d49a2800ab3e4b, []int{1}
|
||||
return fileDescriptor_9a31dfed63924cb3, []int{1}
|
||||
}
|
||||
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -119,7 +119,7 @@ func (m *QuerySchemaRequest) Reset() { *m = QuerySchemaRequest{} }
|
||||
func (m *QuerySchemaRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QuerySchemaRequest) ProtoMessage() {}
|
||||
func (*QuerySchemaRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e6d49a2800ab3e4b, []int{2}
|
||||
return fileDescriptor_9a31dfed63924cb3, []int{2}
|
||||
}
|
||||
func (m *QuerySchemaRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -158,7 +158,7 @@ func (m *QuerySchemaResponse) Reset() { *m = QuerySchemaResponse{} }
|
||||
func (m *QuerySchemaResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QuerySchemaResponse) ProtoMessage() {}
|
||||
func (*QuerySchemaResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e6d49a2800ab3e4b, []int{3}
|
||||
return fileDescriptor_9a31dfed63924cb3, []int{3}
|
||||
}
|
||||
func (m *QuerySchemaResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -202,7 +202,7 @@ func (m *QueryAllocateRequest) Reset() { *m = QueryAllocateRequest{} }
|
||||
func (m *QueryAllocateRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryAllocateRequest) ProtoMessage() {}
|
||||
func (*QueryAllocateRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e6d49a2800ab3e4b, []int{4}
|
||||
return fileDescriptor_9a31dfed63924cb3, []int{4}
|
||||
}
|
||||
func (m *QueryAllocateRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -244,7 +244,7 @@ func (m *QueryAllocateResponse) Reset() { *m = QueryAllocateResponse{} }
|
||||
func (m *QueryAllocateResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryAllocateResponse) ProtoMessage() {}
|
||||
func (*QueryAllocateResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e6d49a2800ab3e4b, []int{5}
|
||||
return fileDescriptor_9a31dfed63924cb3, []int{5}
|
||||
}
|
||||
func (m *QueryAllocateResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -317,7 +317,7 @@ func (m *QuerySyncRequest) Reset() { *m = QuerySyncRequest{} }
|
||||
func (m *QuerySyncRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QuerySyncRequest) ProtoMessage() {}
|
||||
func (*QuerySyncRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e6d49a2800ab3e4b, []int{6}
|
||||
return fileDescriptor_9a31dfed63924cb3, []int{6}
|
||||
}
|
||||
func (m *QuerySyncRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -368,7 +368,7 @@ func (m *QuerySyncResponse) Reset() { *m = QuerySyncResponse{} }
|
||||
func (m *QuerySyncResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QuerySyncResponse) ProtoMessage() {}
|
||||
func (*QuerySyncResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_e6d49a2800ab3e4b, []int{7}
|
||||
return fileDescriptor_9a31dfed63924cb3, []int{7}
|
||||
}
|
||||
func (m *QuerySyncResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -426,53 +426,53 @@ func (m *QuerySyncResponse) GetChainID() string {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*QueryParamsRequest)(nil), "vault.v1.QueryParamsRequest")
|
||||
proto.RegisterType((*QueryParamsResponse)(nil), "vault.v1.QueryParamsResponse")
|
||||
proto.RegisterType((*QuerySchemaRequest)(nil), "vault.v1.QuerySchemaRequest")
|
||||
proto.RegisterType((*QuerySchemaResponse)(nil), "vault.v1.QuerySchemaResponse")
|
||||
proto.RegisterType((*QueryAllocateRequest)(nil), "vault.v1.QueryAllocateRequest")
|
||||
proto.RegisterType((*QueryAllocateResponse)(nil), "vault.v1.QueryAllocateResponse")
|
||||
proto.RegisterType((*QuerySyncRequest)(nil), "vault.v1.QuerySyncRequest")
|
||||
proto.RegisterType((*QuerySyncResponse)(nil), "vault.v1.QuerySyncResponse")
|
||||
proto.RegisterType((*QueryParamsRequest)(nil), "dwn.v1.QueryParamsRequest")
|
||||
proto.RegisterType((*QueryParamsResponse)(nil), "dwn.v1.QueryParamsResponse")
|
||||
proto.RegisterType((*QuerySchemaRequest)(nil), "dwn.v1.QuerySchemaRequest")
|
||||
proto.RegisterType((*QuerySchemaResponse)(nil), "dwn.v1.QuerySchemaResponse")
|
||||
proto.RegisterType((*QueryAllocateRequest)(nil), "dwn.v1.QueryAllocateRequest")
|
||||
proto.RegisterType((*QueryAllocateResponse)(nil), "dwn.v1.QueryAllocateResponse")
|
||||
proto.RegisterType((*QuerySyncRequest)(nil), "dwn.v1.QuerySyncRequest")
|
||||
proto.RegisterType((*QuerySyncResponse)(nil), "dwn.v1.QuerySyncResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("vault/v1/query.proto", fileDescriptor_e6d49a2800ab3e4b) }
|
||||
func init() { proto.RegisterFile("dwn/v1/query.proto", fileDescriptor_9a31dfed63924cb3) }
|
||||
|
||||
var fileDescriptor_e6d49a2800ab3e4b = []byte{
|
||||
// 515 bytes of a gzipped FileDescriptorProto
|
||||
var fileDescriptor_9a31dfed63924cb3 = []byte{
|
||||
// 520 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0x3f, 0x6f, 0xd3, 0x40,
|
||||
0x18, 0xc6, 0xeb, 0xa4, 0x0d, 0xc9, 0x15, 0x21, 0x73, 0x84, 0xc8, 0x32, 0xad, 0x09, 0x56, 0x87,
|
||||
0x4c, 0xb6, 0x5a, 0x76, 0x10, 0x15, 0x0b, 0x1b, 0x18, 0x21, 0x24, 0x96, 0xe8, 0x72, 0x3e, 0x39,
|
||||
0x27, 0x9c, 0x3b, 0xd7, 0x67, 0x47, 0xf5, 0xca, 0xda, 0x05, 0x89, 0x4f, 0xc0, 0xb7, 0x61, 0xac,
|
||||
0xc4, 0xc2, 0x88, 0x12, 0x3e, 0x08, 0xba, 0x3f, 0x8e, 0x1b, 0xa7, 0x85, 0x25, 0xf2, 0x3d, 0xcf,
|
||||
0x9b, 0xdf, 0xf3, 0xbe, 0xbe, 0xd7, 0x60, 0xb8, 0x44, 0x65, 0x5a, 0x84, 0xcb, 0xd3, 0xf0, 0xa2,
|
||||
0x24, 0x79, 0x15, 0x64, 0x39, 0x2f, 0x38, 0xec, 0x2b, 0x35, 0x58, 0x9e, 0xba, 0x47, 0x09, 0xe7,
|
||||
0x49, 0x4a, 0x42, 0x94, 0xd1, 0x10, 0x31, 0xc6, 0x0b, 0x54, 0x50, 0xce, 0x84, 0xae, 0x73, 0x47,
|
||||
0x9b, 0x7f, 0x27, 0x84, 0x11, 0x41, 0x8d, 0xee, 0x0f, 0x01, 0x7c, 0x27, 0x71, 0x6f, 0x51, 0x8e,
|
||||
0x16, 0x22, 0x22, 0x17, 0x25, 0x11, 0x85, 0xff, 0x12, 0x3c, 0xda, 0x52, 0x45, 0xc6, 0x99, 0x20,
|
||||
0x70, 0x02, 0x7a, 0x99, 0x52, 0x1c, 0x6b, 0x6c, 0x4d, 0x0e, 0xcf, 0xec, 0xa0, 0x4e, 0x0f, 0x4c,
|
||||
0xa5, 0xf1, 0x37, 0xd8, 0xf7, 0x78, 0x4e, 0x16, 0xa8, 0x8d, 0xad, 0xd5, 0x06, 0x2b, 0x94, 0xb2,
|
||||
0x8b, 0x35, 0x95, 0xc6, 0xf7, 0x47, 0x60, 0xa8, 0x00, 0xaf, 0xd2, 0x94, 0x63, 0x54, 0x90, 0x1a,
|
||||
0xfc, 0xdd, 0x02, 0x8f, 0x5b, 0x86, 0x61, 0x3b, 0xe0, 0x9e, 0x28, 0x31, 0x26, 0x42, 0xf7, 0xdc,
|
||||
0x8f, 0xea, 0x23, 0xb4, 0x41, 0x17, 0xd3, 0xd8, 0xe9, 0x8c, 0xad, 0xc9, 0x20, 0x92, 0x8f, 0xd0,
|
||||
0x05, 0xfd, 0x05, 0xc2, 0x28, 0xe7, 0x9c, 0x39, 0x5d, 0x25, 0x6f, 0xce, 0xf0, 0x18, 0x80, 0xac,
|
||||
0x9c, 0xa5, 0x14, 0x4f, 0xcb, 0x9c, 0x3a, 0xfb, 0xca, 0x1d, 0x68, 0xe5, 0x43, 0x4e, 0xe1, 0x33,
|
||||
0x70, 0x9f, 0x5c, 0x66, 0x34, 0xaf, 0xa6, 0xb3, 0x94, 0xe3, 0xcf, 0xce, 0xc1, 0xd8, 0x9a, 0x74,
|
||||
0xa3, 0x43, 0xad, 0x9d, 0x4b, 0xc9, 0x3f, 0x01, 0xb6, 0x1e, 0xbe, 0x62, 0xd8, 0xf4, 0x2d, 0x7b,
|
||||
0x88, 0x69, 0xac, 0x3a, 0x1b, 0x44, 0xf2, 0xd1, 0xbf, 0xb2, 0xc0, 0xc3, 0x1b, 0x65, 0xff, 0x9d,
|
||||
0xa2, 0x79, 0x77, 0x9d, 0x7f, 0xbf, 0x3b, 0xc9, 0x40, 0x71, 0x9c, 0x4b, 0x86, 0x1e, 0xae, 0x3e,
|
||||
0x4a, 0x07, 0xcf, 0x11, 0x65, 0x6f, 0x5e, 0x9b, 0xc1, 0xea, 0xe3, 0xd9, 0x55, 0x17, 0x1c, 0xa8,
|
||||
0x6e, 0xe0, 0x14, 0xf4, 0xf4, 0x15, 0xc3, 0xa3, 0x26, 0x61, 0x77, 0x73, 0xdc, 0xe3, 0x3b, 0x5c,
|
||||
0x3d, 0x88, 0xef, 0x7c, 0xf9, 0xf9, 0xe7, 0x5b, 0x07, 0x42, 0x3b, 0xdc, 0xec, 0xa3, 0xde, 0x18,
|
||||
0x19, 0xa0, 0x1b, 0xde, 0x09, 0xd8, 0xda, 0xa1, 0x9d, 0x80, 0xed, 0x5d, 0xba, 0x2d, 0xc0, 0xcc,
|
||||
0x9f, 0x80, 0x7e, 0xbd, 0x1d, 0xd0, 0x6b, 0x41, 0x5a, 0xfb, 0xe4, 0x3e, 0xbd, 0xd3, 0x37, 0x31,
|
||||
0xae, 0x8a, 0x19, 0x42, 0xd8, 0xc4, 0xa0, 0x1a, 0xfe, 0x11, 0xec, 0xcb, 0xcb, 0x83, 0x6e, 0xbb,
|
||||
0xd3, 0xe6, 0xe2, 0xdd, 0x27, 0xb7, 0x7a, 0x06, 0x3e, 0x52, 0x70, 0x1b, 0x3e, 0xb8, 0x31, 0x43,
|
||||
0xc5, 0xf0, 0xf9, 0x8b, 0x1f, 0x2b, 0xcf, 0xba, 0x5e, 0x79, 0xd6, 0xef, 0x95, 0x67, 0x7d, 0x5d,
|
||||
0x7b, 0x7b, 0xd7, 0x6b, 0x6f, 0xef, 0xd7, 0xda, 0xdb, 0xfb, 0x74, 0x92, 0xd0, 0x62, 0x5e, 0xce,
|
||||
0x02, 0xcc, 0x17, 0x21, 0x67, 0x82, 0xb3, 0x3c, 0x54, 0x3f, 0x97, 0x86, 0x50, 0x54, 0x19, 0x11,
|
||||
0xb3, 0x9e, 0xfa, 0xe4, 0x9f, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x89, 0x02, 0x8d, 0x5a, 0x4a,
|
||||
0x04, 0x00, 0x00,
|
||||
0x18, 0xc6, 0xe3, 0xa4, 0x0d, 0xc9, 0x15, 0x55, 0xe1, 0x08, 0x95, 0x31, 0xad, 0x15, 0x2c, 0x84,
|
||||
0x32, 0xd9, 0x6a, 0x59, 0x61, 0xa0, 0x62, 0x61, 0x03, 0x57, 0x2c, 0x30, 0x54, 0x97, 0xf3, 0x29,
|
||||
0x39, 0xe1, 0xdc, 0xb9, 0x77, 0x76, 0x5a, 0xaf, 0x6c, 0x6c, 0x48, 0x7c, 0x02, 0xbe, 0x0d, 0x63,
|
||||
0x25, 0x16, 0x46, 0x94, 0xf0, 0x2d, 0x58, 0xd0, 0xfd, 0x71, 0x13, 0x9b, 0x00, 0x8b, 0xe5, 0x7b,
|
||||
0x9e, 0xf3, 0xef, 0x7d, 0x5e, 0xdf, 0x7b, 0x00, 0x26, 0x97, 0x2c, 0x5a, 0x1c, 0x47, 0x17, 0x05,
|
||||
0x11, 0x65, 0x98, 0x09, 0x9e, 0x73, 0xd8, 0x4d, 0x2e, 0x59, 0xb8, 0x38, 0xf6, 0x0e, 0xa7, 0x9c,
|
||||
0x4f, 0x53, 0x12, 0xa1, 0x8c, 0x46, 0x88, 0x31, 0x9e, 0xa3, 0x9c, 0x72, 0x26, 0xcd, 0x2e, 0x6f,
|
||||
0x68, 0xbf, 0x9c, 0x12, 0x46, 0x24, 0xb5, 0x6a, 0x30, 0x04, 0xf0, 0xb5, 0x42, 0xbd, 0x42, 0x02,
|
||||
0xcd, 0x65, 0x4c, 0x2e, 0x0a, 0x22, 0xf3, 0xe0, 0x19, 0xb8, 0x5b, 0x53, 0x65, 0xc6, 0x99, 0x24,
|
||||
0xf0, 0x31, 0xe8, 0x66, 0x5a, 0x71, 0x9d, 0x91, 0x33, 0xde, 0x3b, 0xd9, 0x0f, 0x4d, 0xe5, 0xd0,
|
||||
0xee, 0xb3, 0xee, 0x0d, 0xf4, 0x0c, 0xcf, 0xc8, 0x1c, 0x35, 0xa1, 0x95, 0xba, 0x86, 0x4a, 0xad,
|
||||
0x34, 0xa1, 0x76, 0x9f, 0x75, 0x83, 0x03, 0x30, 0xd4, 0x9f, 0x3f, 0x4f, 0x53, 0x8e, 0x51, 0x4e,
|
||||
0x2a, 0xec, 0x17, 0x07, 0xdc, 0x6b, 0x18, 0x96, 0xec, 0x82, 0x5b, 0xb2, 0xc0, 0x98, 0x48, 0x93,
|
||||
0xb7, 0x17, 0x57, 0x4b, 0x38, 0x00, 0x1d, 0x4c, 0x13, 0xb7, 0x3d, 0x72, 0xc6, 0xfd, 0x58, 0xbd,
|
||||
0x42, 0x0f, 0xf4, 0xe6, 0x08, 0x23, 0xc1, 0x39, 0x73, 0x3b, 0x5a, 0xbe, 0x59, 0xc3, 0x23, 0x00,
|
||||
0xb2, 0x62, 0x92, 0x52, 0x7c, 0x5e, 0x08, 0xea, 0xee, 0x68, 0xb7, 0x6f, 0x94, 0x37, 0x82, 0xc2,
|
||||
0x87, 0xe0, 0x36, 0xb9, 0xca, 0xa8, 0x28, 0xcf, 0x27, 0x29, 0xc7, 0xef, 0xdd, 0xdd, 0x91, 0x33,
|
||||
0xee, 0xc4, 0x7b, 0x46, 0x3b, 0x55, 0x52, 0xf0, 0x08, 0x0c, 0x4c, 0xeb, 0x25, 0xc3, 0x36, 0xb7,
|
||||
0xca, 0x90, 0xd0, 0x44, 0x27, 0xeb, 0xc7, 0xea, 0x35, 0xf8, 0xe8, 0x80, 0x3b, 0x1b, 0xdb, 0xfe,
|
||||
0xdb, 0xc5, 0xfa, 0xcf, 0xb5, 0xff, 0xf5, 0xe7, 0x14, 0x01, 0x25, 0x89, 0x50, 0x04, 0xd3, 0x5a,
|
||||
0xb5, 0x54, 0x0e, 0x9e, 0x21, 0xca, 0x5e, 0xbe, 0xb0, 0x6d, 0x55, 0xcb, 0x93, 0x5f, 0x6d, 0xb0,
|
||||
0xab, 0xb3, 0xc0, 0x77, 0xa0, 0x6b, 0x8e, 0x17, 0x7a, 0x15, 0xff, 0xcf, 0x89, 0xf1, 0x1e, 0x6c,
|
||||
0xf5, 0x4c, 0x0b, 0x81, 0xfb, 0xe1, 0xdb, 0xcf, 0xcf, 0x6d, 0x08, 0x07, 0xd1, 0x02, 0x15, 0x69,
|
||||
0xae, 0xa6, 0xd0, 0x4c, 0x8a, 0x82, 0x9b, 0xb0, 0x0d, 0x78, 0x6d, 0x72, 0x1a, 0xf0, 0xfa, 0xfc,
|
||||
0x6c, 0x83, 0xdb, 0xbe, 0x31, 0xe8, 0x55, 0x33, 0x01, 0x0f, 0x6b, 0x88, 0xc6, 0x0c, 0x79, 0x47,
|
||||
0x7f, 0x71, 0x6d, 0x09, 0x4f, 0x97, 0x18, 0x42, 0xb8, 0x2e, 0x81, 0x2a, 0xf0, 0x19, 0xd8, 0x51,
|
||||
0xc7, 0x05, 0xdd, 0x7a, 0xc6, 0xf5, 0x41, 0x7b, 0xf7, 0xb7, 0x38, 0x16, 0x7c, 0xa0, 0xc1, 0x03,
|
||||
0xb8, 0xbf, 0x91, 0xbd, 0x64, 0xf8, 0xf4, 0xe9, 0xd7, 0xa5, 0xef, 0x5c, 0x2f, 0x7d, 0xe7, 0xc7,
|
||||
0xd2, 0x77, 0x3e, 0xad, 0xfc, 0xd6, 0xf5, 0xca, 0x6f, 0x7d, 0x5f, 0xf9, 0xad, 0xb7, 0xc1, 0x94,
|
||||
0xe6, 0xb3, 0x62, 0x12, 0x62, 0x3e, 0x8f, 0x38, 0x93, 0x9c, 0x89, 0x48, 0x3f, 0xae, 0x22, 0x75,
|
||||
0xbd, 0xf3, 0x32, 0x23, 0x72, 0xd2, 0xd5, 0x57, 0xfb, 0xc9, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0x73, 0xa2, 0xa3, 0xc2, 0x2c, 0x04, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -510,7 +510,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient {
|
||||
|
||||
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||
out := new(QueryParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/vault.v1.Query/Params", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/dwn.v1.Query/Params", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -519,7 +519,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
|
||||
|
||||
func (c *queryClient) Schema(ctx context.Context, in *QuerySchemaRequest, opts ...grpc.CallOption) (*QuerySchemaResponse, error) {
|
||||
out := new(QuerySchemaResponse)
|
||||
err := c.cc.Invoke(ctx, "/vault.v1.Query/Schema", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/dwn.v1.Query/Schema", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -528,7 +528,7 @@ func (c *queryClient) Schema(ctx context.Context, in *QuerySchemaRequest, opts .
|
||||
|
||||
func (c *queryClient) Allocate(ctx context.Context, in *QueryAllocateRequest, opts ...grpc.CallOption) (*QueryAllocateResponse, error) {
|
||||
out := new(QueryAllocateResponse)
|
||||
err := c.cc.Invoke(ctx, "/vault.v1.Query/Allocate", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/dwn.v1.Query/Allocate", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -537,7 +537,7 @@ func (c *queryClient) Allocate(ctx context.Context, in *QueryAllocateRequest, op
|
||||
|
||||
func (c *queryClient) Sync(ctx context.Context, in *QuerySyncRequest, opts ...grpc.CallOption) (*QuerySyncResponse, error) {
|
||||
out := new(QuerySyncResponse)
|
||||
err := c.cc.Invoke(ctx, "/vault.v1.Query/Sync", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/dwn.v1.Query/Sync", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -590,7 +590,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/vault.v1.Query/Params",
|
||||
FullMethod: "/dwn.v1.Query/Params",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||
@@ -608,7 +608,7 @@ func _Query_Schema_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/vault.v1.Query/Schema",
|
||||
FullMethod: "/dwn.v1.Query/Schema",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Schema(ctx, req.(*QuerySchemaRequest))
|
||||
@@ -626,7 +626,7 @@ func _Query_Allocate_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/vault.v1.Query/Allocate",
|
||||
FullMethod: "/dwn.v1.Query/Allocate",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Allocate(ctx, req.(*QueryAllocateRequest))
|
||||
@@ -644,7 +644,7 @@ func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/vault.v1.Query/Sync",
|
||||
FullMethod: "/dwn.v1.Query/Sync",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Sync(ctx, req.(*QuerySyncRequest))
|
||||
@@ -654,7 +654,7 @@ func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
|
||||
var Query_serviceDesc = _Query_serviceDesc
|
||||
var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "vault.v1.Query",
|
||||
ServiceName: "dwn.v1.Query",
|
||||
HandlerType: (*QueryServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
@@ -675,7 +675,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "vault/v1/query.proto",
|
||||
Metadata: "dwn/v1/query.proto",
|
||||
}
|
||||
|
||||
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) {
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: vault/v1/query.proto
|
||||
// source: dwn/v1/query.proto
|
||||
|
||||
/*
|
||||
Package types is a reverse proxy.
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"github.com/ipfs/boxo/files"
|
||||
|
||||
"github.com/onsonr/sonr/pkg/core/dwn"
|
||||
"github.com/onsonr/sonr/x/vault/types/static"
|
||||
"github.com/onsonr/sonr/x/dwn/types/static"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -0,0 +1,781 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: dwn/v1/state.proto
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
_ "cosmossdk.io/orm"
|
||||
fmt "fmt"
|
||||
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 Credential struct {
|
||||
Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`
|
||||
Transports []string `protobuf:"bytes,3,rep,name=transports,proto3" json:"transports,omitempty"`
|
||||
PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
||||
AttestationType string `protobuf:"bytes,5,opt,name=attestation_type,json=attestationType,proto3" json:"attestation_type,omitempty"`
|
||||
CreatedAt uint64 `protobuf:"varint,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Credential) Reset() { *m = Credential{} }
|
||||
func (m *Credential) String() string { return proto.CompactTextString(m) }
|
||||
func (*Credential) ProtoMessage() {}
|
||||
func (*Credential) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_040a9b061177db90, []int{0}
|
||||
}
|
||||
func (m *Credential) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Credential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Credential.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 *Credential) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Credential.Merge(m, src)
|
||||
}
|
||||
func (m *Credential) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Credential) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Credential.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Credential proto.InternalMessageInfo
|
||||
|
||||
func (m *Credential) GetId() []byte {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Credential) GetKind() string {
|
||||
if m != nil {
|
||||
return m.Kind
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Credential) GetTransports() []string {
|
||||
if m != nil {
|
||||
return m.Transports
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Credential) GetPublicKey() []byte {
|
||||
if m != nil {
|
||||
return m.PublicKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Credential) GetAttestationType() string {
|
||||
if m != nil {
|
||||
return m.AttestationType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Credential) GetCreatedAt() uint64 {
|
||||
if m != nil {
|
||||
return m.CreatedAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Profile struct {
|
||||
Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
|
||||
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Profile) Reset() { *m = Profile{} }
|
||||
func (m *Profile) String() string { return proto.CompactTextString(m) }
|
||||
func (*Profile) ProtoMessage() {}
|
||||
func (*Profile) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_040a9b061177db90, []int{1}
|
||||
}
|
||||
func (m *Profile) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Profile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Profile.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 *Profile) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Profile.Merge(m, src)
|
||||
}
|
||||
func (m *Profile) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Profile) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Profile.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Profile proto.InternalMessageInfo
|
||||
|
||||
func (m *Profile) GetAccount() []byte {
|
||||
if m != nil {
|
||||
return m.Account
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Profile) GetAmount() uint64 {
|
||||
if m != nil {
|
||||
return m.Amount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Credential)(nil), "dwn.v1.Credential")
|
||||
proto.RegisterType((*Profile)(nil), "dwn.v1.Profile")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("dwn/v1/state.proto", fileDescriptor_040a9b061177db90) }
|
||||
|
||||
var fileDescriptor_040a9b061177db90 = []byte{
|
||||
// 339 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x91, 0xb1, 0x4e, 0xeb, 0x30,
|
||||
0x14, 0x86, 0xeb, 0x34, 0x37, 0xbd, 0x39, 0xba, 0xea, 0xad, 0x3c, 0x80, 0x41, 0x22, 0x44, 0x9d,
|
||||
0xc2, 0xd2, 0xa8, 0x62, 0xab, 0x58, 0x80, 0x91, 0x05, 0x45, 0x4c, 0x08, 0xa9, 0x72, 0x13, 0x03,
|
||||
0x56, 0x1b, 0x3b, 0x72, 0x4e, 0x5b, 0xf2, 0x12, 0x88, 0x27, 0xe0, 0x79, 0x60, 0xab, 0xc4, 0xc2,
|
||||
0x88, 0xda, 0x37, 0xe0, 0x09, 0x50, 0xdc, 0x16, 0x75, 0xb1, 0x7c, 0x3e, 0xff, 0xfe, 0x74, 0x8e,
|
||||
0x0d, 0x34, 0x9b, 0xab, 0x78, 0xd6, 0x8f, 0x4b, 0xe4, 0x28, 0x7a, 0x85, 0xd1, 0xa8, 0xa9, 0x97,
|
||||
0xcd, 0x55, 0x6f, 0xd6, 0x3f, 0xdc, 0x4f, 0x75, 0x99, 0xeb, 0x32, 0xd6, 0x26, 0xaf, 0x23, 0xda,
|
||||
0xe4, 0xeb, 0x40, 0xf7, 0x9d, 0x00, 0x5c, 0x1a, 0x91, 0x09, 0x85, 0x92, 0x4f, 0x68, 0x1b, 0x1c,
|
||||
0x99, 0x31, 0x12, 0x92, 0xe8, 0x5f, 0xe2, 0xc8, 0x8c, 0x52, 0x70, 0xc7, 0x52, 0x65, 0xcc, 0x09,
|
||||
0x49, 0xe4, 0x27, 0x76, 0x4f, 0x03, 0x00, 0x34, 0x5c, 0x95, 0x85, 0x36, 0x58, 0xb2, 0x66, 0xd8,
|
||||
0x8c, 0xfc, 0x64, 0x87, 0xd0, 0x23, 0x80, 0x62, 0x3a, 0x9a, 0xc8, 0x74, 0x38, 0x16, 0x15, 0x73,
|
||||
0xad, 0xcb, 0x5f, 0x93, 0x2b, 0x51, 0xd1, 0x13, 0xe8, 0x70, 0x44, 0x51, 0x77, 0x29, 0xb5, 0x1a,
|
||||
0x62, 0x55, 0x08, 0xf6, 0xc7, 0xea, 0xff, 0xef, 0xf0, 0x9b, 0xaa, 0x10, 0xb5, 0x29, 0x35, 0x82,
|
||||
0xa3, 0xc8, 0x86, 0x1c, 0x99, 0x17, 0x92, 0xc8, 0x4d, 0xfc, 0x0d, 0x39, 0xc7, 0x41, 0xfb, 0xfb,
|
||||
0xf5, 0xe3, 0xb9, 0xf9, 0x17, 0xdc, 0x75, 0xd3, 0xdd, 0x3b, 0x68, 0x5d, 0x1b, 0x7d, 0x2f, 0x27,
|
||||
0x82, 0x32, 0x68, 0xf1, 0x34, 0xd5, 0x53, 0x85, 0x9b, 0x61, 0xb6, 0x25, 0xdd, 0x03, 0x8f, 0xe7,
|
||||
0xf6, 0xc0, 0xb1, 0xbe, 0x4d, 0x35, 0x38, 0xb6, 0xb2, 0x03, 0xf0, 0x7f, 0x6f, 0x52, 0xd8, 0x46,
|
||||
0x3b, 0x84, 0x39, 0x17, 0x67, 0x6f, 0xcb, 0x80, 0x2c, 0x96, 0x01, 0xf9, 0x5a, 0x06, 0xe4, 0x65,
|
||||
0x15, 0x34, 0x16, 0xab, 0xa0, 0xf1, 0xb9, 0x0a, 0x1a, 0xb7, 0xdd, 0x07, 0x89, 0x8f, 0xd3, 0x51,
|
||||
0x2f, 0xd5, 0x79, 0xac, 0x55, 0xa9, 0x95, 0x89, 0xed, 0xf2, 0x14, 0xd7, 0x3f, 0x52, 0x0f, 0x58,
|
||||
0x8e, 0x3c, 0xfb, 0xdc, 0xa7, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x45, 0xf1, 0xed, 0xf9, 0xa5,
|
||||
0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Credential) 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 *Credential) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Credential) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.CreatedAt != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.CreatedAt))
|
||||
i--
|
||||
dAtA[i] = 0x30
|
||||
}
|
||||
if len(m.AttestationType) > 0 {
|
||||
i -= len(m.AttestationType)
|
||||
copy(dAtA[i:], m.AttestationType)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.AttestationType)))
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if len(m.PublicKey) > 0 {
|
||||
i -= len(m.PublicKey)
|
||||
copy(dAtA[i:], m.PublicKey)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.PublicKey)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Transports) > 0 {
|
||||
for iNdEx := len(m.Transports) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.Transports[iNdEx])
|
||||
copy(dAtA[i:], m.Transports[iNdEx])
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Transports[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
}
|
||||
if len(m.Kind) > 0 {
|
||||
i -= len(m.Kind)
|
||||
copy(dAtA[i:], m.Kind)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Kind)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Id) > 0 {
|
||||
i -= len(m.Id)
|
||||
copy(dAtA[i:], m.Id)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Id)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Profile) 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 *Profile) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Amount != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.Amount))
|
||||
i--
|
||||
dAtA[i] = 0x10
|
||||
}
|
||||
if len(m.Account) > 0 {
|
||||
i -= len(m.Account)
|
||||
copy(dAtA[i:], m.Account)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Account)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintState(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovState(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
func (m *Credential) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Id)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Kind)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if len(m.Transports) > 0 {
|
||||
for _, s := range m.Transports {
|
||||
l = len(s)
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
}
|
||||
l = len(m.PublicKey)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.AttestationType)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if m.CreatedAt != 0 {
|
||||
n += 1 + sovState(uint64(m.CreatedAt))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Profile) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Account)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if m.Amount != 0 {
|
||||
n += 1 + sovState(uint64(m.Amount))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovState(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozState(x uint64) (n int) {
|
||||
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *Credential) 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 ErrIntOverflowState
|
||||
}
|
||||
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: Credential: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Credential: 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 ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
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 Kind", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
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 ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Kind = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Transports", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
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 ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Transports = append(m.Transports, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...)
|
||||
if m.PublicKey == nil {
|
||||
m.PublicKey = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AttestationType", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
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 ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.AttestationType = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
|
||||
}
|
||||
m.CreatedAt = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.CreatedAt |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipState(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Profile) 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 ErrIntOverflowState
|
||||
}
|
||||
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: Profile: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Profile: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
|
||||
}
|
||||
var byteLen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
byteLen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if byteLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + byteLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Account = append(m.Account[:0], dAtA[iNdEx:postIndex]...)
|
||||
if m.Account == nil {
|
||||
m.Account = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
||||
}
|
||||
m.Amount = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Amount |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipState(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipState(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, ErrIntOverflowState
|
||||
}
|
||||
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, ErrIntOverflowState
|
||||
}
|
||||
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, ErrIntOverflowState
|
||||
}
|
||||
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, ErrInvalidLengthState
|
||||
}
|
||||
iNdEx += length
|
||||
case 3:
|
||||
depth++
|
||||
case 4:
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupState
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthState
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowState = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: vault/v1/tx.proto
|
||||
// source: dwn/v1/tx.proto
|
||||
|
||||
package types
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
_ "github.com/cosmos/gogoproto/gogoproto"
|
||||
grpc1 "github.com/cosmos/gogoproto/grpc"
|
||||
proto "github.com/cosmos/gogoproto/proto"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
@@ -47,7 +46,7 @@ func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} }
|
||||
func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParams) ProtoMessage() {}
|
||||
func (*MsgUpdateParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_311d0123a4881c5c, []int{0}
|
||||
return fileDescriptor_32d2464465560de7, []int{0}
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -101,7 +100,7 @@ func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse
|
||||
func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParamsResponse) ProtoMessage() {}
|
||||
func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_311d0123a4881c5c, []int{1}
|
||||
return fileDescriptor_32d2464465560de7, []int{1}
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -130,37 +129,140 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "vault.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "vault.v1.MsgUpdateParamsResponse")
|
||||
// MsgInitialize spawns a New Vault with Unclaimed State. This is a one-time
|
||||
// operation that must be performed interacting with the Vault.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
type MsgInitialize struct {
|
||||
// authority is the address of the governance account.
|
||||
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
// params defines the parameters to update.
|
||||
//
|
||||
// NOTE: All parameters must be supplied.
|
||||
Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("vault/v1/tx.proto", fileDescriptor_311d0123a4881c5c) }
|
||||
func (m *MsgInitialize) Reset() { *m = MsgInitialize{} }
|
||||
func (m *MsgInitialize) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgInitialize) ProtoMessage() {}
|
||||
func (*MsgInitialize) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_32d2464465560de7, []int{2}
|
||||
}
|
||||
func (m *MsgInitialize) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgInitialize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgInitialize.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 *MsgInitialize) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgInitialize.Merge(m, src)
|
||||
}
|
||||
func (m *MsgInitialize) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgInitialize) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgInitialize.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var fileDescriptor_311d0123a4881c5c = []byte{
|
||||
// 338 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x50, 0x4d, 0x4b, 0x02, 0x41,
|
||||
0x18, 0xde, 0xe9, 0x43, 0x72, 0x8a, 0x3e, 0x16, 0x49, 0x5d, 0x62, 0x33, 0xe9, 0x20, 0x42, 0x3b,
|
||||
0x68, 0xd0, 0xa1, 0x43, 0x90, 0xe7, 0x84, 0x30, 0xba, 0x78, 0x89, 0x51, 0x87, 0x71, 0xc1, 0x9d,
|
||||
0x77, 0xd9, 0x77, 0x14, 0xbd, 0x45, 0xb7, 0x6e, 0xfd, 0x14, 0x0f, 0xfd, 0x08, 0x8f, 0xd2, 0xa9,
|
||||
0x53, 0x84, 0x1e, 0xfc, 0x1b, 0xe1, 0xee, 0xda, 0x92, 0xd0, 0x65, 0x98, 0xf7, 0xf9, 0x9a, 0x67,
|
||||
0x5e, 0x7a, 0x34, 0xe0, 0xfd, 0x9e, 0x66, 0x83, 0x0a, 0xd3, 0x43, 0xc7, 0x0f, 0x40, 0x83, 0xb9,
|
||||
0x13, 0x42, 0xce, 0xa0, 0x62, 0x65, 0xdb, 0x80, 0x1e, 0x20, 0xf3, 0x50, 0x2e, 0x15, 0x1e, 0xca,
|
||||
0x48, 0x62, 0xe5, 0x23, 0xe2, 0x29, 0x9c, 0x58, 0x34, 0xc4, 0x54, 0x46, 0x82, 0x84, 0x08, 0x5f,
|
||||
0xde, 0x62, 0xf4, 0x44, 0x02, 0xc8, 0x9e, 0x60, 0xdc, 0x77, 0x19, 0x57, 0x0a, 0x34, 0xd7, 0x2e,
|
||||
0xa8, 0x95, 0xe7, 0xf8, 0xb7, 0x84, 0x14, 0x4a, 0xa0, 0x1b, 0xe3, 0xc5, 0x57, 0x42, 0x0f, 0xea,
|
||||
0x28, 0x1f, 0xfd, 0x0e, 0xd7, 0xe2, 0x9e, 0x07, 0xdc, 0x43, 0xf3, 0x8a, 0xa6, 0x79, 0x5f, 0x77,
|
||||
0x21, 0x70, 0xf5, 0x28, 0x47, 0x0a, 0xa4, 0x94, 0xae, 0xe5, 0x3e, 0xde, 0x2f, 0x32, 0x71, 0x89,
|
||||
0xdb, 0x4e, 0x27, 0x10, 0x88, 0x0f, 0x3a, 0x70, 0x95, 0x6c, 0x24, 0x52, 0xd3, 0xa1, 0x29, 0x3f,
|
||||
0x4c, 0xc8, 0x6d, 0x14, 0x48, 0x69, 0xb7, 0x7a, 0xe8, 0xac, 0xbe, 0xe9, 0x44, 0xc9, 0xb5, 0xad,
|
||||
0xc9, 0xd7, 0xa9, 0xd1, 0x88, 0x55, 0xd7, 0xfb, 0x2f, 0x8b, 0x71, 0x39, 0xf1, 0x17, 0xf3, 0x34,
|
||||
0xbb, 0x56, 0xa5, 0x21, 0xd0, 0x07, 0x85, 0xa2, 0xda, 0xa4, 0x9b, 0x75, 0x94, 0xe6, 0x1d, 0xdd,
|
||||
0xfb, 0xd3, 0x34, 0x9f, 0xbc, 0xb0, 0xe6, 0xb4, 0xce, 0xfe, 0xa5, 0x56, 0xa1, 0xd6, 0xf6, 0xf3,
|
||||
0x62, 0x5c, 0x26, 0xb5, 0x9b, 0xc9, 0xcc, 0x26, 0xd3, 0x99, 0x4d, 0xbe, 0x67, 0x36, 0x79, 0x9b,
|
||||
0xdb, 0xc6, 0x74, 0x6e, 0x1b, 0x9f, 0x73, 0xdb, 0x68, 0x9e, 0x4b, 0x57, 0x77, 0xfb, 0x2d, 0xa7,
|
||||
0x0d, 0x1e, 0x03, 0x85, 0xa0, 0x02, 0x16, 0x1e, 0x43, 0x16, 0x6d, 0x53, 0x8f, 0x7c, 0x81, 0xad,
|
||||
0x54, 0xb8, 0xc9, 0xcb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9a, 0xa7, 0x73, 0x6d, 0xe8, 0x01,
|
||||
0x00, 0x00,
|
||||
var xxx_messageInfo_MsgInitialize proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgInitialize) GetAuthority() string {
|
||||
if m != nil {
|
||||
return m.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgInitialize) GetParams() Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return Params{}
|
||||
}
|
||||
|
||||
// MsgInitializeResponse defines the response structure for executing a
|
||||
// MsgInitialize message.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
type MsgInitializeResponse struct {
|
||||
}
|
||||
|
||||
func (m *MsgInitializeResponse) Reset() { *m = MsgInitializeResponse{} }
|
||||
func (m *MsgInitializeResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgInitializeResponse) ProtoMessage() {}
|
||||
func (*MsgInitializeResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_32d2464465560de7, []int{3}
|
||||
}
|
||||
func (m *MsgInitializeResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgInitializeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgInitializeResponse.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 *MsgInitializeResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgInitializeResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgInitializeResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgInitializeResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgInitializeResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgInitializeResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "dwn.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "dwn.v1.MsgUpdateParamsResponse")
|
||||
proto.RegisterType((*MsgInitialize)(nil), "dwn.v1.MsgInitialize")
|
||||
proto.RegisterType((*MsgInitializeResponse)(nil), "dwn.v1.MsgInitializeResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("dwn/v1/tx.proto", fileDescriptor_32d2464465560de7) }
|
||||
|
||||
var fileDescriptor_32d2464465560de7 = []byte{
|
||||
// 361 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x29, 0xcf, 0xd3,
|
||||
0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4b, 0x29, 0xcf,
|
||||
0xd3, 0x2b, 0x33, 0x94, 0x12, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0xcf, 0x2d, 0x4e, 0x07,
|
||||
0xc9, 0xe7, 0x16, 0xa7, 0x43, 0x14, 0x48, 0x89, 0x40, 0x75, 0xa4, 0xa7, 0xe6, 0xa5, 0x16, 0x67,
|
||||
0x16, 0xc3, 0x44, 0xd3, 0xf3, 0xd3, 0xf3, 0xc1, 0x4c, 0x7d, 0x10, 0x0b, 0x2a, 0x2a, 0x09, 0x31,
|
||||
0x24, 0x1e, 0x22, 0x01, 0xe1, 0x40, 0xa4, 0x94, 0xda, 0x19, 0xb9, 0xf8, 0x7d, 0x8b, 0xd3, 0x43,
|
||||
0x0b, 0x52, 0x12, 0x4b, 0x52, 0x03, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x85, 0xcc, 0xb8, 0x38, 0x13,
|
||||
0x4b, 0x4b, 0x32, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24,
|
||||
0x2e, 0x6d, 0xd1, 0x15, 0x81, 0x6a, 0x74, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x0e, 0x2e, 0x29,
|
||||
0xca, 0xcc, 0x4b, 0x0f, 0x42, 0x28, 0x15, 0xd2, 0xe1, 0x62, 0x2b, 0x00, 0x9b, 0x20, 0xc1, 0xa4,
|
||||
0xc0, 0xa8, 0xc1, 0x6d, 0xc4, 0xa7, 0x07, 0xf1, 0x84, 0x1e, 0xc4, 0x5c, 0x27, 0x96, 0x13, 0xf7,
|
||||
0xe4, 0x19, 0x82, 0xa0, 0x6a, 0xac, 0xf8, 0x9a, 0x9e, 0x6f, 0xd0, 0x42, 0xe8, 0x56, 0x92, 0xe4,
|
||||
0x12, 0x47, 0x73, 0x48, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x52, 0x2b, 0x23, 0x17,
|
||||
0xaf, 0x6f, 0x71, 0xba, 0x67, 0x5e, 0x66, 0x49, 0x66, 0x62, 0x4e, 0x66, 0x55, 0xea, 0x00, 0x39,
|
||||
0x51, 0x9c, 0x4b, 0x14, 0xc5, 0x19, 0x30, 0x07, 0x1a, 0xcd, 0x62, 0xe4, 0x62, 0xf6, 0x2d, 0x4e,
|
||||
0x17, 0xf2, 0xe0, 0xe2, 0x41, 0x09, 0x49, 0x71, 0x98, 0xf1, 0x68, 0x3e, 0x93, 0x92, 0xc7, 0x21,
|
||||
0x01, 0x33, 0x51, 0xc8, 0x89, 0x8b, 0x0b, 0xc9, 0xbb, 0xa2, 0x48, 0xca, 0x11, 0xc2, 0x52, 0xb2,
|
||||
0x58, 0x85, 0x61, 0x66, 0x48, 0xb1, 0x36, 0x3c, 0xdf, 0xa0, 0xc5, 0xe8, 0x64, 0x73, 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, 0x4a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a,
|
||||
0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x79, 0xc5, 0xf9, 0x79, 0x45, 0xfa, 0x60, 0xa2, 0x42, 0x1f, 0x94,
|
||||
0xb8, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xe9, 0xc4, 0x18, 0x10, 0x00, 0x00, 0xff,
|
||||
0xff, 0xbb, 0x62, 0x4e, 0x8b, 0xa2, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -179,6 +281,8 @@ type MsgClient interface {
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
// Initialize spawns a new Vault
|
||||
Initialize(ctx context.Context, in *MsgInitialize, opts ...grpc.CallOption) (*MsgInitializeResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@@ -191,7 +295,16 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient {
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/vault.v1.Msg/UpdateParams", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/dwn.v1.Msg/UpdateParams", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) Initialize(ctx context.Context, in *MsgInitialize, opts ...grpc.CallOption) (*MsgInitializeResponse, error) {
|
||||
out := new(MsgInitializeResponse)
|
||||
err := c.cc.Invoke(ctx, "/dwn.v1.Msg/Initialize", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -204,6 +317,8 @@ type MsgServer interface {
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
// Initialize spawns a new Vault
|
||||
Initialize(context.Context, *MsgInitialize) (*MsgInitializeResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||
@@ -213,6 +328,9 @@ type UnimplementedMsgServer struct {
|
||||
func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) Initialize(ctx context.Context, req *MsgInitialize) (*MsgInitializeResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Initialize not implemented")
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||
@@ -228,7 +346,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/vault.v1.Msg/UpdateParams",
|
||||
FullMethod: "/dwn.v1.Msg/UpdateParams",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
@@ -236,18 +354,40 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_Initialize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgInitialize)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).Initialize(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/dwn.v1.Msg/Initialize",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).Initialize(ctx, req.(*MsgInitialize))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var Msg_serviceDesc = _Msg_serviceDesc
|
||||
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "vault.v1.Msg",
|
||||
ServiceName: "dwn.v1.Msg",
|
||||
HandlerType: (*MsgServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Initialize",
|
||||
Handler: _Msg_Initialize_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "vault/v1/tx.proto",
|
||||
Metadata: "dwn/v1/tx.proto",
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) {
|
||||
@@ -313,6 +453,69 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgInitialize) 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 *MsgInitialize) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgInitialize) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
{
|
||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
if len(m.Authority) > 0 {
|
||||
i -= len(m.Authority)
|
||||
copy(dAtA[i:], m.Authority)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgInitializeResponse) 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 *MsgInitializeResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgInitializeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTx(v)
|
||||
base := offset
|
||||
@@ -348,6 +551,30 @@ func (m *MsgUpdateParamsResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgInitialize) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Authority)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
l = m.Params.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgInitializeResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTx(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -519,6 +746,171 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgInitialize) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgInitialize: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgInitialize: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Authority = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
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 ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgInitializeResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgInitializeResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgInitializeResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTx(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@@ -1,37 +0,0 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
)
|
||||
|
||||
func (k Keeper) Logger() log.Logger {
|
||||
return k.logger
|
||||
}
|
||||
|
||||
// InitGenesis initializes the module's state from a genesis state.
|
||||
func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
|
||||
// this line is used by starport scaffolding # genesis/module/init
|
||||
if err := data.Params.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return k.Params.Set(ctx, data.Params)
|
||||
}
|
||||
|
||||
// ExportGenesis exports the module's state to a genesis state.
|
||||
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
|
||||
params, err := k.Params.Get(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// this line is used by starport scaffolding # genesis/module/export
|
||||
|
||||
return &types.GenesisState{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package keeper_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestORM(t *testing.T) {
|
||||
f := SetupTest(t)
|
||||
if f == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// dt := f.k.OrmDB.ExampleDataTable()
|
||||
// acc := []byte("test_acc")
|
||||
// amt := uint64(7)
|
||||
//
|
||||
// err := dt.Insert(f.ctx, &apiv1.ExampleData{
|
||||
// Account: acc,
|
||||
// Amount: amt,
|
||||
// })
|
||||
// require.NoError(t, err)
|
||||
//
|
||||
// d, err := dt.Has(f.ctx, []byte("test_acc"))
|
||||
// require.NoError(t, err)
|
||||
// require.True(t, d)
|
||||
//
|
||||
// res, err := dt.Get(f.ctx, []byte("test_acc"))
|
||||
// require.NoError(t, err)
|
||||
// require.NotNil(t, res)
|
||||
// require.EqualValues(t, amt, res.Amount)
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package types
|
||||
|
||||
import sdkerrors "cosmossdk.io/errors"
|
||||
|
||||
var (
|
||||
ErrInvalidGenesisState = sdkerrors.Register(ModuleName, 100, "invalid genesis state")
|
||||
ErrInvalidServiceOrigin = sdkerrors.Register(ModuleName, 200, "invalid service origin")
|
||||
ErrUnrecognizedService = sdkerrors.Register(ModuleName, 201, "unrecognized service")
|
||||
ErrInvalidServiceGroup = sdkerrors.Register(ModuleName, 202, "invalid group")
|
||||
)
|
||||
@@ -1,12 +1,12 @@
|
||||
# `x/service`
|
||||
# `x/svc`
|
||||
|
||||
The Service module is responsible for managing the registration and authorization of services within the Sonr ecosystem. It provides a secure and verifiable mechanism for registering and authorizing services using Decentralized Identifiers (DIDs).
|
||||
The svc module is responsible for managing the registration and authorization of services within the Sonr ecosystem. It provides a secure and verifiable mechanism for registering and authorizing services using Decentralized Identifiers (DIDs).
|
||||
|
||||
## Concepts
|
||||
|
||||
- **Service**: A decentralized service on the Sonr Blockchain with properties such as ID, authority, origin, name, description, category, tags, and expiry height.
|
||||
- **Service**: A decentralized svc on the Sonr Blockchain with properties such as ID, authority, origin, name, description, category, tags, and expiry height.
|
||||
- **Profile**: Represents a DID alias with properties like ID, subject, origin, and controller.
|
||||
- **Metadata**: Contains information about a service, including name, description, category, icon, and tags.
|
||||
- **Metadata**: Contains information about a svc, including name, description, category, icon, and tags.
|
||||
|
||||
### Dependencies
|
||||
|
||||
@@ -42,14 +42,14 @@ Updates the module parameters. Can only be executed by the governance account.
|
||||
|
||||
### MsgRegisterService
|
||||
|
||||
Registers a new service on the blockchain. Requires a valid TXT record in DNS for the origin.
|
||||
Registers a new svc on the blockchain. Requires a valid TXT record in DNS for the origin.
|
||||
|
||||
## Params
|
||||
|
||||
The module has the following parameters:
|
||||
|
||||
- `categories`: List of allowed service categories
|
||||
- `types`: List of allowed service types
|
||||
- `categories`: List of allowed svc categories
|
||||
- `types`: List of allowed svc types
|
||||
|
||||
## Query
|
||||
|
||||
@@ -63,7 +63,7 @@ Retrieves all parameters of the module.
|
||||
|
||||
### gRPC
|
||||
|
||||
The module provides a gRPC Query service with the following RPC:
|
||||
The module provides a gRPC Query svc with the following RPC:
|
||||
|
||||
- `Params`: Get all parameters of the module
|
||||
|
||||
@@ -77,10 +77,10 @@ The module provides a gRPC Query service with the following RPC:
|
||||
|
||||
## Future Improvements
|
||||
|
||||
- Implement service discovery mechanisms
|
||||
- Add support for service reputation and rating systems
|
||||
- Enhance service metadata with more detailed information
|
||||
- Implement service update and deactivation functionality
|
||||
- Implement svc discovery mechanisms
|
||||
- Add support for svc reputation and rating systems
|
||||
- Enhance svc metadata with more detailed information
|
||||
- Implement svc update and deactivation functionality
|
||||
|
||||
## Tests
|
||||
|
||||
@@ -88,4 +88,4 @@ The module provides a gRPC Query service with the following RPC:
|
||||
|
||||
## Appendix
|
||||
|
||||
This module is part of the Sonr blockchain project and interacts with other modules such as DID and NFT modules to provide a comprehensive decentralized service ecosystem.
|
||||
This module is part of the Sonr blockchain project and interacts with other modules such as DID and NFT modules to provide a comprehensive decentralized svc ecosystem.
|
||||
@@ -2,7 +2,7 @@ package module
|
||||
|
||||
import (
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
modulev1 "github.com/onsonr/sonr/api/service/v1"
|
||||
modulev1 "github.com/onsonr/sonr/api/svc/v1"
|
||||
)
|
||||
|
||||
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
)
|
||||
|
||||
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/client/tx"
|
||||
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
)
|
||||
|
||||
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
||||
@@ -44,16 +44,9 @@ func MsgUpdateParams() *cobra.Command {
|
||||
|
||||
senderAddress := cliCtx.GetFromAddress()
|
||||
|
||||
// someValue, err := strconv.ParseBool(args[0])
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
//
|
||||
msg := &types.MsgUpdateParams{
|
||||
Authority: senderAddress.String(),
|
||||
Params: types.Params{
|
||||
// SomeValue: someValue,
|
||||
},
|
||||
Params: types.Params{},
|
||||
}
|
||||
|
||||
if err := msg.Validate(); err != nil {
|
||||
@@ -3,23 +3,21 @@ package module
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
|
||||
"cosmossdk.io/core/address"
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/store"
|
||||
"cosmossdk.io/depinject"
|
||||
"cosmossdk.io/log"
|
||||
nftkeeper "cosmossdk.io/x/nft/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
|
||||
modulev1 "github.com/onsonr/sonr/api/service/module/v1"
|
||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||
"github.com/onsonr/sonr/x/service/keeper"
|
||||
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
|
||||
modulev1 "github.com/onsonr/sonr/api/svc/module/v1"
|
||||
"github.com/onsonr/sonr/x/svc/keeper"
|
||||
)
|
||||
|
||||
var _ appmodule.AppModule = AppModule{}
|
||||
@@ -44,12 +42,8 @@ type ModuleInputs struct {
|
||||
StoreService store.KVStoreService
|
||||
AddressCodec address.Codec
|
||||
|
||||
DidKeeper didkeeper.Keeper
|
||||
GroupKeeper groupkeeper.Keeper
|
||||
NFTKeeper nftkeeper.Keeper
|
||||
StakingKeeper stakingkeeper.Keeper
|
||||
SlashingKeeper slashingkeeper.Keeper
|
||||
VaultKeeper vaultkeeper.Keeper
|
||||
}
|
||||
|
||||
type ModuleOutputs struct {
|
||||
@@ -62,8 +56,8 @@ type ModuleOutputs struct {
|
||||
func ProvideModule(in ModuleInputs) ModuleOutputs {
|
||||
govAddr := authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||
|
||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr, in.DidKeeper, in.GroupKeeper, in.NFTKeeper, in.VaultKeeper)
|
||||
m := NewAppModule(in.Cdc, k, in.DidKeeper)
|
||||
k := keeper.NewKeeper(in.Cdc, in.StoreService, log.NewLogger(os.Stderr), govAddr)
|
||||
m := NewAppModule(in.Cdc, k)
|
||||
|
||||
return ModuleOutputs{Module: m, Keeper: k, Out: depinject.Out{}}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package keeper_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -12,8 +12,6 @@ func TestGenesis(t *testing.T) {
|
||||
|
||||
genesisState := &types.GenesisState{
|
||||
Params: types.DefaultParams(),
|
||||
|
||||
// this line is used by starport scaffolding # genesis/test/state
|
||||
}
|
||||
|
||||
f.k.InitGenesis(f.ctx, genesisState)
|
||||
@@ -21,5 +19,4 @@ func TestGenesis(t *testing.T) {
|
||||
got := f.k.ExportGenesis(f.ctx)
|
||||
require.NotNil(t, got)
|
||||
|
||||
// this line is used by starport scaffolding # genesis/test/assert
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
"cosmossdk.io/collections"
|
||||
storetypes "cosmossdk.io/core/store"
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/orm/model/ormdb"
|
||||
|
||||
apiv1 "github.com/onsonr/sonr/api/svc/v1"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
)
|
||||
|
||||
type Keeper struct {
|
||||
cdc codec.BinaryCodec
|
||||
|
||||
logger log.Logger
|
||||
|
||||
// state management
|
||||
Schema collections.Schema
|
||||
Params collections.Item[types.Params]
|
||||
OrmDB apiv1.StateStore
|
||||
|
||||
authority string
|
||||
}
|
||||
|
||||
// NewKeeper creates a new Keeper instance
|
||||
func NewKeeper(
|
||||
cdc codec.BinaryCodec,
|
||||
storeService storetypes.KVStoreService,
|
||||
logger log.Logger,
|
||||
authority string,
|
||||
) Keeper {
|
||||
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
||||
|
||||
sb := collections.NewSchemaBuilder(storeService)
|
||||
|
||||
if authority == "" {
|
||||
authority = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||
}
|
||||
|
||||
db, err := ormdb.NewModuleDB(&types.ORMModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
store, err := apiv1.NewStateStore(db)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
k := Keeper{
|
||||
cdc: cdc,
|
||||
logger: logger,
|
||||
|
||||
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
|
||||
OrmDB: store,
|
||||
|
||||
authority: authority,
|
||||
}
|
||||
|
||||
schema, err := sb.Build()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
k.Schema = schema
|
||||
|
||||
return k
|
||||
}
|
||||
|
||||
func (k Keeper) Logger() log.Logger {
|
||||
return k.logger
|
||||
}
|
||||
|
||||
// InitGenesis initializes the module's state from a genesis state.
|
||||
func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
|
||||
|
||||
if err := data.Params.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return k.Params.Set(ctx, data.Params)
|
||||
}
|
||||
|
||||
// ExportGenesis exports the module's state to a genesis state.
|
||||
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
|
||||
params, err := k.Params.Get(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return &types.GenesisState{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,14 @@ package keeper_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"cosmossdk.io/core/store"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
storetypes "cosmossdk.io/store/types"
|
||||
nftkeeper "cosmossdk.io/x/nft/keeper"
|
||||
|
||||
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
||||
"github.com/cosmos/cosmos-sdk/runtime"
|
||||
"github.com/cosmos/cosmos-sdk/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/testutil/integration"
|
||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
|
||||
@@ -16,20 +18,16 @@ import (
|
||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper"
|
||||
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||
module "github.com/onsonr/sonr/x/service"
|
||||
"github.com/onsonr/sonr/x/service/keeper"
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
|
||||
module "github.com/onsonr/sonr/x/svc"
|
||||
"github.com/onsonr/sonr/x/svc/keeper"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
)
|
||||
|
||||
var maccPerms = map[string][]string{
|
||||
@@ -51,12 +49,8 @@ type testFixture struct {
|
||||
|
||||
accountkeeper authkeeper.AccountKeeper
|
||||
bankkeeper bankkeeper.BaseKeeper
|
||||
didkeeper didkeeper.Keeper
|
||||
groupkeeper groupkeeper.Keeper
|
||||
stakingKeeper *stakingkeeper.Keeper
|
||||
mintkeeper mintkeeper.Keeper
|
||||
nftkeeper nftkeeper.Keeper
|
||||
vaultkeeper vaultkeeper.Keeper
|
||||
|
||||
addrs []sdk.AccAddress
|
||||
govModAddr string
|
||||
@@ -65,7 +59,6 @@ type testFixture struct {
|
||||
func SetupTest(t *testing.T) *testFixture {
|
||||
t.Helper()
|
||||
f := new(testFixture)
|
||||
require := require.New(t)
|
||||
|
||||
// Base setup
|
||||
logger := log.NewTestLogger(t)
|
||||
@@ -74,20 +67,17 @@ func SetupTest(t *testing.T) *testFixture {
|
||||
f.govModAddr = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||
f.addrs = simtestutil.CreateIncrementalAccounts(3)
|
||||
|
||||
key := storetypes.NewKVStoreKey(types.ModuleName)
|
||||
storeService := runtime.NewKVStoreService(key)
|
||||
testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test"))
|
||||
|
||||
f.ctx = testCtx.Ctx
|
||||
keys := storetypes.NewKVStoreKeys(authtypes.ModuleName, banktypes.ModuleName, stakingtypes.ModuleName, minttypes.ModuleName, types.ModuleName)
|
||||
f.ctx = sdk.NewContext(integration.CreateMultiStore(keys, logger), cmtproto.Header{}, false, logger)
|
||||
|
||||
// Register SDK modules.
|
||||
registerBaseSDKModules(f, encCfg, storeService, logger, require)
|
||||
registerBaseSDKModules(logger, f, encCfg, keys)
|
||||
|
||||
// Setup Keeper.
|
||||
f.k = keeper.NewKeeper(encCfg.Codec, storeService, logger, f.govModAddr, f.didkeeper, f.groupkeeper, f.nftkeeper, f.vaultkeeper)
|
||||
f.k = keeper.NewKeeper(encCfg.Codec, runtime.NewKVStoreService(keys[types.ModuleName]), logger, f.govModAddr)
|
||||
f.msgServer = keeper.NewMsgServerImpl(f.k)
|
||||
f.queryServer = keeper.NewQuerier(f.k)
|
||||
f.appModule = module.NewAppModule(encCfg.Codec, f.k, f.didkeeper)
|
||||
f.appModule = module.NewAppModule(encCfg.Codec, f.k)
|
||||
|
||||
return f
|
||||
}
|
||||
@@ -95,22 +85,23 @@ func SetupTest(t *testing.T) *testFixture {
|
||||
func registerModuleInterfaces(encCfg moduletestutil.TestEncodingConfig) {
|
||||
authtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
banktypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
minttypes.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
|
||||
types.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
}
|
||||
|
||||
func registerBaseSDKModules(
|
||||
logger log.Logger,
|
||||
f *testFixture,
|
||||
encCfg moduletestutil.TestEncodingConfig,
|
||||
storeService store.KVStoreService,
|
||||
logger log.Logger,
|
||||
require *require.Assertions,
|
||||
keys map[string]*storetypes.KVStoreKey,
|
||||
) {
|
||||
registerModuleInterfaces(encCfg)
|
||||
|
||||
// Auth Keeper.
|
||||
f.accountkeeper = authkeeper.NewAccountKeeper(
|
||||
encCfg.Codec, storeService,
|
||||
encCfg.Codec, runtime.NewKVStoreService(keys[authtypes.StoreKey]),
|
||||
authtypes.ProtoBaseAccount,
|
||||
maccPerms,
|
||||
authcodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix,
|
||||
@@ -119,7 +110,7 @@ func registerBaseSDKModules(
|
||||
|
||||
// Bank Keeper.
|
||||
f.bankkeeper = bankkeeper.NewBaseKeeper(
|
||||
encCfg.Codec, storeService,
|
||||
encCfg.Codec, runtime.NewKVStoreService(keys[banktypes.StoreKey]),
|
||||
f.accountkeeper,
|
||||
nil,
|
||||
f.govModAddr, logger,
|
||||
@@ -127,21 +118,16 @@ func registerBaseSDKModules(
|
||||
|
||||
// Staking Keeper.
|
||||
f.stakingKeeper = stakingkeeper.NewKeeper(
|
||||
encCfg.Codec, storeService,
|
||||
encCfg.Codec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]),
|
||||
f.accountkeeper, f.bankkeeper, f.govModAddr,
|
||||
authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr),
|
||||
authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
|
||||
)
|
||||
require.NoError(f.stakingKeeper.SetParams(f.ctx, stakingtypes.DefaultParams()))
|
||||
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetNotBondedPool(f.ctx))
|
||||
f.accountkeeper.SetModuleAccount(f.ctx, f.stakingKeeper.GetBondedPool(f.ctx))
|
||||
|
||||
// Mint Keeper.
|
||||
f.mintkeeper = mintkeeper.NewKeeper(
|
||||
encCfg.Codec, storeService,
|
||||
encCfg.Codec, runtime.NewKVStoreService(keys[minttypes.StoreKey]),
|
||||
f.stakingKeeper, f.accountkeeper, f.bankkeeper,
|
||||
authtypes.FeeCollectorName, f.govModAddr,
|
||||
)
|
||||
f.accountkeeper.SetModuleAccount(f.ctx, f.accountkeeper.GetModuleAccount(f.ctx, minttypes.ModuleName))
|
||||
f.mintkeeper.InitGenesis(f.ctx, f.accountkeeper, minttypes.DefaultGenesisState())
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
"cosmossdk.io/errors"
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
)
|
||||
|
||||
type msgServer struct {
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
)
|
||||
|
||||
func TestParams(t *testing.T) {
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
)
|
||||
|
||||
var _ types.QueryServer = Querier{}
|
||||
@@ -4,27 +4,27 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
|
||||
"cosmossdk.io/client/v2/autocli"
|
||||
errorsmod "cosmossdk.io/errors"
|
||||
abci "github.com/cometbft/cometbft/abci/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
|
||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||
"github.com/onsonr/sonr/x/vault/keeper"
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
"github.com/onsonr/sonr/x/svc/keeper"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
)
|
||||
|
||||
const (
|
||||
// ConsensusVersion defines the current x/vault module consensus version.
|
||||
// ConsensusVersion defines the current x/svc module consensus version.
|
||||
ConsensusVersion = 1
|
||||
|
||||
// this line is used by starport scaffolding # simapp/module/const
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -44,19 +44,16 @@ type AppModule struct {
|
||||
AppModuleBasic
|
||||
|
||||
keeper keeper.Keeper
|
||||
didk didkeeper.Keeper
|
||||
}
|
||||
|
||||
// NewAppModule constructor
|
||||
func NewAppModule(
|
||||
cdc codec.Codec,
|
||||
keeper keeper.Keeper,
|
||||
didkeeper didkeeper.Keeper,
|
||||
) *AppModule {
|
||||
return &AppModule{
|
||||
AppModuleBasic: AppModuleBasic{cdc: cdc},
|
||||
keeper: keeper,
|
||||
didk: didkeeper,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +90,17 @@ func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux
|
||||
}
|
||||
}
|
||||
|
||||
// Disable in favor of autocli.go. If you wish to use these, it will override AutoCLI methods.
|
||||
/*
|
||||
func (a AppModuleBasic) GetTxCmd() *cobra.Command {
|
||||
return cli.NewTxCmd()
|
||||
}
|
||||
|
||||
func (a AppModuleBasic) GetQueryCmd() *cobra.Command {
|
||||
return cli.GetQueryCmd()
|
||||
}
|
||||
*/
|
||||
|
||||
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
types.RegisterLegacyAminoCodec(cdc)
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
// this line is used by starport scaffolding # 1
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -26,7 +25,6 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
}
|
||||
|
||||
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
// this line is used by starport scaffolding # 3
|
||||
|
||||
registry.RegisterImplementations(
|
||||
(*sdk.Msg)(nil),
|
||||
@@ -1,14 +1,12 @@
|
||||
package types
|
||||
|
||||
// this line is used by starport scaffolding # genesis/types/import
|
||||
|
||||
// DefaultIndex is the default global index
|
||||
const DefaultIndex uint64 = 1
|
||||
|
||||
// DefaultGenesis returns the default genesis state
|
||||
func DefaultGenesis() *GenesisState {
|
||||
return &GenesisState{
|
||||
// this line is used by starport scaffolding # genesis/types/default
|
||||
|
||||
Params: DefaultParams(),
|
||||
}
|
||||
}
|
||||
@@ -16,6 +14,6 @@ func DefaultGenesis() *GenesisState {
|
||||
// Validate performs basic genesis state validation returning an error upon any
|
||||
// failure.
|
||||
func (gs GenesisState) Validate() error {
|
||||
// this line is used by starport scaffolding # genesis/types/validate
|
||||
|
||||
return gs.Params.Validate()
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: service/v1/genesis.proto
|
||||
// source: svc/v1/genesis.proto
|
||||
|
||||
package types
|
||||
|
||||
@@ -34,7 +34,7 @@ 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_0ce55e499988823a, []int{0}
|
||||
return fileDescriptor_86658d95daaa12a9, []int{0}
|
||||
}
|
||||
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -79,7 +79,7 @@ type Params struct {
|
||||
func (m *Params) Reset() { *m = Params{} }
|
||||
func (*Params) ProtoMessage() {}
|
||||
func (*Params) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_0ce55e499988823a, []int{1}
|
||||
return fileDescriptor_86658d95daaa12a9, []int{1}
|
||||
}
|
||||
func (m *Params) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -130,7 +130,7 @@ func (m *ServiceCategories) Reset() { *m = ServiceCategories{} }
|
||||
func (m *ServiceCategories) String() string { return proto.CompactTextString(m) }
|
||||
func (*ServiceCategories) ProtoMessage() {}
|
||||
func (*ServiceCategories) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_0ce55e499988823a, []int{2}
|
||||
return fileDescriptor_86658d95daaa12a9, []int{2}
|
||||
}
|
||||
func (m *ServiceCategories) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -174,7 +174,7 @@ func (m *ServiceTypes) Reset() { *m = ServiceTypes{} }
|
||||
func (m *ServiceTypes) String() string { return proto.CompactTextString(m) }
|
||||
func (*ServiceTypes) ProtoMessage() {}
|
||||
func (*ServiceTypes) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_0ce55e499988823a, []int{3}
|
||||
return fileDescriptor_86658d95daaa12a9, []int{3}
|
||||
}
|
||||
func (m *ServiceTypes) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -226,7 +226,7 @@ func (m *Service) Reset() { *m = Service{} }
|
||||
func (m *Service) String() string { return proto.CompactTextString(m) }
|
||||
func (*Service) ProtoMessage() {}
|
||||
func (*Service) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_0ce55e499988823a, []int{4}
|
||||
return fileDescriptor_86658d95daaa12a9, []int{4}
|
||||
}
|
||||
func (m *Service) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -312,45 +312,45 @@ func (m *Service) GetExpiryHeight() int64 {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*GenesisState)(nil), "service.v1.GenesisState")
|
||||
proto.RegisterType((*Params)(nil), "service.v1.Params")
|
||||
proto.RegisterType((*ServiceCategories)(nil), "service.v1.ServiceCategories")
|
||||
proto.RegisterType((*ServiceTypes)(nil), "service.v1.ServiceTypes")
|
||||
proto.RegisterType((*Service)(nil), "service.v1.Service")
|
||||
proto.RegisterType((*GenesisState)(nil), "svc.v1.GenesisState")
|
||||
proto.RegisterType((*Params)(nil), "svc.v1.Params")
|
||||
proto.RegisterType((*ServiceCategories)(nil), "svc.v1.ServiceCategories")
|
||||
proto.RegisterType((*ServiceTypes)(nil), "svc.v1.ServiceTypes")
|
||||
proto.RegisterType((*Service)(nil), "svc.v1.Service")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("service/v1/genesis.proto", fileDescriptor_0ce55e499988823a) }
|
||||
func init() { proto.RegisterFile("svc/v1/genesis.proto", fileDescriptor_86658d95daaa12a9) }
|
||||
|
||||
var fileDescriptor_0ce55e499988823a = []byte{
|
||||
// 442 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xbf, 0x6e, 0x13, 0x41,
|
||||
0x10, 0xc6, 0x6f, 0x6d, 0xe7, 0x12, 0x4f, 0x9c, 0x48, 0x19, 0x45, 0xd1, 0xca, 0x81, 0xb3, 0x65,
|
||||
0x24, 0x64, 0x51, 0xdc, 0x11, 0xe8, 0x22, 0x90, 0xa2, 0x50, 0x40, 0x19, 0x5d, 0xa8, 0x68, 0xd0,
|
||||
0xc5, 0x5e, 0xad, 0xb7, 0xf0, 0xed, 0x69, 0x77, 0x63, 0xc5, 0xaf, 0x40, 0x45, 0x41, 0x41, 0x99,
|
||||
0x47, 0xe0, 0x31, 0x52, 0xa6, 0x44, 0x14, 0x08, 0xd9, 0x05, 0x3c, 0x06, 0xf2, 0xec, 0x9d, 0x7d,
|
||||
0xfc, 0x69, 0x56, 0xb3, 0xdf, 0xb7, 0xf3, 0xbb, 0x6f, 0x46, 0x07, 0xdc, 0x0a, 0x33, 0x53, 0x23,
|
||||
0x91, 0xcc, 0x4e, 0x12, 0x29, 0x72, 0x61, 0x95, 0x8d, 0x0b, 0xa3, 0x9d, 0x46, 0x28, 0x9d, 0x78,
|
||||
0x76, 0xd2, 0x3d, 0xc8, 0xa6, 0x2a, 0xd7, 0x09, 0x9d, 0xde, 0xee, 0x1e, 0x4a, 0x2d, 0x35, 0x95,
|
||||
0xc9, 0xaa, 0xf2, 0xea, 0xe0, 0x0c, 0x3a, 0xaf, 0x3d, 0xe5, 0xd2, 0x65, 0x4e, 0xe0, 0x53, 0x08,
|
||||
0x8b, 0xcc, 0x64, 0x53, 0xcb, 0x59, 0x9f, 0x0d, 0x77, 0x9f, 0x61, 0xbc, 0xa1, 0xc6, 0x17, 0xe4,
|
||||
0x9c, 0xb7, 0xee, 0xbe, 0xf7, 0x82, 0xb4, 0x7c, 0x37, 0xf8, 0xc4, 0x20, 0xf4, 0x06, 0xbe, 0x04,
|
||||
0x18, 0x65, 0x4e, 0x48, 0x6d, 0x94, 0xa8, 0x00, 0x0f, 0xeb, 0x80, 0x4b, 0x5f, 0xbe, 0x5a, 0x3f,
|
||||
0x4a, 0x6b, 0x0d, 0x18, 0xc3, 0x96, 0x9b, 0x17, 0xc2, 0xf2, 0x06, 0x75, 0xf2, 0xff, 0x74, 0xbe,
|
||||
0x5d, 0xf9, 0xa9, 0x7f, 0x76, 0x7a, 0xfc, 0xf9, 0xb6, 0x17, 0xfc, 0xba, 0xed, 0xb1, 0x0f, 0x3f,
|
||||
0xbf, 0x3c, 0xd9, 0xaf, 0xf6, 0x52, 0xc6, 0xba, 0x80, 0x83, 0x7f, 0xbe, 0x86, 0xd1, 0x5f, 0x01,
|
||||
0x9b, 0xc3, 0x76, 0x3d, 0xc1, 0xe9, 0x71, 0x45, 0xc3, 0x8a, 0xb6, 0x31, 0x07, 0x2f, 0xa0, 0x53,
|
||||
0x4f, 0x81, 0x87, 0x55, 0x5c, 0xcf, 0x29, 0x43, 0x1d, 0x55, 0x88, 0xbd, 0x0a, 0x41, 0xfa, 0xe0,
|
||||
0x1b, 0x83, 0xed, 0xb2, 0x1d, 0xf7, 0xa1, 0xa1, 0xc6, 0xb4, 0x9f, 0x76, 0xda, 0x50, 0x63, 0x7c,
|
||||
0x00, 0xed, 0xec, 0xda, 0x4d, 0xb4, 0x51, 0x6e, 0x4e, 0xc3, 0xb7, 0xd3, 0x8d, 0x80, 0x47, 0x10,
|
||||
0x6a, 0xa3, 0xa4, 0xca, 0x79, 0x93, 0xac, 0xf2, 0x86, 0x08, 0xad, 0x3c, 0x9b, 0x0a, 0xde, 0x22,
|
||||
0x95, 0x6a, 0xec, 0xc3, 0xee, 0x58, 0xd8, 0x91, 0x51, 0x85, 0x53, 0x3a, 0xe7, 0x5b, 0x64, 0xd5,
|
||||
0x25, 0xec, 0xc2, 0x4e, 0x39, 0xd3, 0x9c, 0x87, 0x64, 0xaf, 0xef, 0x2b, 0xa2, 0xcb, 0xa4, 0xe5,
|
||||
0xdb, 0x34, 0x10, 0xd5, 0xf8, 0x08, 0xf6, 0xc4, 0x4d, 0xa1, 0xcc, 0xfc, 0xfd, 0x44, 0x28, 0x39,
|
||||
0x71, 0x7c, 0xa7, 0xcf, 0x86, 0xcd, 0xb4, 0xe3, 0xc5, 0x37, 0xa4, 0x9d, 0x9f, 0xdd, 0x2d, 0x22,
|
||||
0x76, 0xbf, 0x88, 0xd8, 0x8f, 0x45, 0xc4, 0x3e, 0x2e, 0xa3, 0xe0, 0x7e, 0x19, 0x05, 0x5f, 0x97,
|
||||
0x51, 0xf0, 0xee, 0xb1, 0x54, 0x6e, 0x72, 0x7d, 0x15, 0x8f, 0xf4, 0x34, 0xd1, 0xb9, 0xd5, 0xb9,
|
||||
0x49, 0xe8, 0xb8, 0x49, 0xfe, 0x58, 0xcf, 0x55, 0x48, 0xbf, 0xe3, 0xf3, 0xdf, 0x01, 0x00, 0x00,
|
||||
0xff, 0xff, 0xe6, 0x6d, 0xb2, 0xb0, 0xdf, 0x02, 0x00, 0x00,
|
||||
var fileDescriptor_86658d95daaa12a9 = []byte{
|
||||
// 441 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x52, 0xb1, 0x6e, 0xdb, 0x30,
|
||||
0x10, 0x15, 0x6d, 0x47, 0x89, 0x2f, 0x89, 0x81, 0x10, 0x46, 0xa0, 0x3a, 0x85, 0x6c, 0xb8, 0x8b,
|
||||
0x11, 0x14, 0x22, 0xd2, 0x4e, 0x0d, 0x32, 0xa5, 0x43, 0x3b, 0x06, 0x4a, 0xa7, 0x2e, 0x05, 0x23,
|
||||
0x13, 0x34, 0x07, 0x8b, 0x02, 0xc9, 0x08, 0xf1, 0x2f, 0x14, 0x1d, 0x3a, 0x76, 0xcc, 0x27, 0xf4,
|
||||
0x33, 0x32, 0x66, 0x2c, 0x3a, 0x14, 0x85, 0x3d, 0xb4, 0x9f, 0x51, 0xe8, 0x28, 0x25, 0x42, 0xba,
|
||||
0x10, 0xc7, 0xf7, 0xee, 0x3d, 0xbe, 0x3b, 0x10, 0x86, 0xb6, 0xcc, 0x58, 0x79, 0xc2, 0xa4, 0xc8,
|
||||
0x85, 0x55, 0x36, 0x29, 0x8c, 0x76, 0x9a, 0x86, 0xb6, 0xcc, 0x92, 0xf2, 0x64, 0x34, 0x94, 0x5a,
|
||||
0x6a, 0x84, 0x58, 0x55, 0x79, 0x76, 0x74, 0xc0, 0x97, 0x2a, 0xd7, 0x0c, 0x4f, 0x0f, 0x4d, 0xcf,
|
||||
0x60, 0xef, 0x9d, 0x77, 0xb8, 0x74, 0xdc, 0x09, 0xfa, 0x12, 0xc2, 0x82, 0x1b, 0xbe, 0xb4, 0x11,
|
||||
0x99, 0x90, 0xd9, 0xee, 0xab, 0x41, 0xe2, 0x1d, 0x93, 0x0b, 0x44, 0xcf, 0x7b, 0x77, 0xbf, 0xc6,
|
||||
0x41, 0x5a, 0xf7, 0x4c, 0xbf, 0x10, 0x08, 0x3d, 0x41, 0xdf, 0x00, 0x64, 0xdc, 0x09, 0xa9, 0x8d,
|
||||
0x12, 0x8d, 0xf8, 0x59, 0x23, 0xbe, 0x14, 0xa6, 0x54, 0x99, 0x78, 0xfb, 0xd0, 0x90, 0xb6, 0x9a,
|
||||
0xe9, 0x31, 0x6c, 0xb9, 0x55, 0x21, 0x6c, 0xd4, 0x41, 0xd5, 0xf0, 0x89, 0xea, 0x43, 0xc5, 0xa5,
|
||||
0xbe, 0xe5, 0xf4, 0xe8, 0xdb, 0xed, 0x38, 0xf8, 0x7b, 0x3b, 0x26, 0x9f, 0xff, 0x7c, 0x3f, 0x1e,
|
||||
0x58, 0xdf, 0xc1, 0xea, 0x38, 0x17, 0x70, 0xf0, 0xdf, 0x4b, 0x34, 0x7e, 0x12, 0xac, 0x3b, 0xeb,
|
||||
0xb7, 0x5f, 0x3f, 0x3d, 0x6a, 0xdc, 0x68, 0xe3, 0xf6, 0x48, 0x56, 0xeb, 0x69, 0xa7, 0xa0, 0xc3,
|
||||
0x26, 0xaa, 0xf7, 0xa9, 0x43, 0x1d, 0x36, 0x16, 0xfb, 0x8d, 0x05, 0xe2, 0xd3, 0x9f, 0x04, 0xb6,
|
||||
0x6b, 0x39, 0x1d, 0x40, 0x47, 0xcd, 0x71, 0x2f, 0xfd, 0xb4, 0xa3, 0xe6, 0xf4, 0x39, 0xf4, 0xf9,
|
||||
0xb5, 0x5b, 0x68, 0xa3, 0xdc, 0x0a, 0x07, 0xef, 0xa7, 0x8f, 0x00, 0x3d, 0x84, 0x50, 0x1b, 0x25,
|
||||
0x55, 0x1e, 0x75, 0x91, 0xaa, 0x6f, 0x94, 0x42, 0x2f, 0xe7, 0x4b, 0x11, 0xf5, 0x10, 0xc5, 0x9a,
|
||||
0x4e, 0x60, 0x77, 0x2e, 0x6c, 0x66, 0x54, 0xe1, 0x94, 0xce, 0xa3, 0x2d, 0xa4, 0xda, 0x10, 0x1d,
|
||||
0xc1, 0x4e, 0x3d, 0xd3, 0x2a, 0x0a, 0x91, 0x7e, 0xb8, 0x57, 0x8e, 0x8e, 0x4b, 0x1b, 0x6d, 0xe3,
|
||||
0x40, 0x58, 0xd3, 0x17, 0xb0, 0x2f, 0x6e, 0x0a, 0x65, 0x56, 0x9f, 0x16, 0x42, 0xc9, 0x85, 0x8b,
|
||||
0x76, 0x26, 0x64, 0xd6, 0x4d, 0xf7, 0x3c, 0xf8, 0x1e, 0xb1, 0xf3, 0xb3, 0xbb, 0x75, 0x4c, 0xee,
|
||||
0xd7, 0x31, 0xf9, 0xbd, 0x8e, 0xc9, 0xd7, 0x4d, 0x1c, 0xdc, 0x6f, 0xe2, 0xe0, 0xc7, 0x26, 0x0e,
|
||||
0x3e, 0x4e, 0xa5, 0x72, 0x8b, 0xeb, 0xab, 0x24, 0xd3, 0x4b, 0xa6, 0x73, 0xab, 0x73, 0xc3, 0xf0,
|
||||
0xb8, 0x61, 0xd5, 0x9f, 0xc5, 0xd5, 0x5c, 0x85, 0xf8, 0xfd, 0x5e, 0xff, 0x0b, 0x00, 0x00, 0xff,
|
||||
0xff, 0x50, 0x14, 0xc4, 0xe2, 0xc7, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *Params) Equal(that interface{}) bool {
|
||||
@@ -3,7 +3,7 @@ package types_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/onsonr/sonr/x/service/types"
|
||||
"github.com/onsonr/sonr/x/svc/types"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -21,13 +21,9 @@ func TestGenesisState_Validate(t *testing.T) {
|
||||
},
|
||||
{
|
||||
desc: "valid genesis state",
|
||||
genState: &types.GenesisState{
|
||||
|
||||
// this line is used by starport scaffolding # types/genesis/validField
|
||||
},
|
||||
valid: true,
|
||||
genState: &types.GenesisState{},
|
||||
valid: true,
|
||||
},
|
||||
// this line is used by starport scaffolding # types/genesis/testcase
|
||||
}
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.desc, func(t *testing.T) {
|
||||
@@ -12,7 +12,7 @@ var (
|
||||
)
|
||||
|
||||
const (
|
||||
ModuleName = "service"
|
||||
ModuleName = "svc"
|
||||
|
||||
StoreKey = ModuleName
|
||||
|
||||
@@ -21,7 +21,7 @@ const (
|
||||
|
||||
var ORMModuleSchema = ormv1alpha1.ModuleSchemaDescriptor{
|
||||
SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{
|
||||
{Id: 1, ProtoFileName: "service/v1/state.proto"},
|
||||
{Id: 1, ProtoFileName: "svc/v1/state.proto"},
|
||||
},
|
||||
Prefix: []byte{0},
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: service/v1/query.proto
|
||||
// source: svc/v1/query.proto
|
||||
|
||||
package types
|
||||
|
||||
@@ -36,7 +36,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
|
||||
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryParamsRequest) ProtoMessage() {}
|
||||
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_d0ed234bfe4ffc68, []int{0}
|
||||
return fileDescriptor_81a1010cdbf4bc9c, []int{0}
|
||||
}
|
||||
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -75,7 +75,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} }
|
||||
func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryParamsResponse) ProtoMessage() {}
|
||||
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_d0ed234bfe4ffc68, []int{1}
|
||||
return fileDescriptor_81a1010cdbf4bc9c, []int{1}
|
||||
}
|
||||
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -112,30 +112,30 @@ func (m *QueryParamsResponse) GetParams() *Params {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*QueryParamsRequest)(nil), "service.v1.QueryParamsRequest")
|
||||
proto.RegisterType((*QueryParamsResponse)(nil), "service.v1.QueryParamsResponse")
|
||||
proto.RegisterType((*QueryParamsRequest)(nil), "svc.v1.QueryParamsRequest")
|
||||
proto.RegisterType((*QueryParamsResponse)(nil), "svc.v1.QueryParamsResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("service/v1/query.proto", fileDescriptor_d0ed234bfe4ffc68) }
|
||||
func init() { proto.RegisterFile("svc/v1/query.proto", fileDescriptor_81a1010cdbf4bc9c) }
|
||||
|
||||
var fileDescriptor_d0ed234bfe4ffc68 = []byte{
|
||||
// 251 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2b, 0x4e, 0x2d, 0x2a,
|
||||
0xcb, 0x4c, 0x4e, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca,
|
||||
0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x8a, 0xeb, 0x95, 0x19, 0x4a, 0xc9, 0xa4, 0xe7, 0xe7, 0xa7, 0xe7,
|
||||
0xa4, 0xea, 0x27, 0x16, 0x64, 0xea, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7,
|
||||
0x15, 0x43, 0x54, 0x4a, 0x49, 0x20, 0x99, 0x90, 0x9e, 0x9a, 0x97, 0x5a, 0x9c, 0x09, 0x95, 0x51,
|
||||
0x12, 0xe1, 0x12, 0x0a, 0x04, 0x19, 0x19, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x1c, 0x94, 0x5a, 0x58,
|
||||
0x9a, 0x5a, 0x5c, 0xa2, 0xe4, 0xc8, 0x25, 0x8c, 0x22, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a,
|
||||
0xa4, 0xc5, 0xc5, 0x56, 0x00, 0x16, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd2, 0x43,
|
||||
0xb8, 0x40, 0x0f, 0xaa, 0x16, 0xaa, 0xc2, 0x28, 0x8f, 0x8b, 0x15, 0x6c, 0x84, 0x50, 0x2a, 0x17,
|
||||
0x1b, 0x44, 0x4a, 0x48, 0x0e, 0x59, 0x39, 0xa6, 0xad, 0x52, 0xf2, 0x38, 0xe5, 0x21, 0xf6, 0x2b,
|
||||
0x49, 0x35, 0x5d, 0x7e, 0x32, 0x99, 0x49, 0x44, 0x48, 0x48, 0x1f, 0xc9, 0x3f, 0x10, 0xfb, 0x9c,
|
||||
0x1c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f,
|
||||
0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x2d, 0x3d, 0xb3, 0x24,
|
||||
0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x3f, 0xaf, 0x38, 0x3f, 0xaf, 0x48, 0x1f, 0x4c,
|
||||
0x54, 0xc0, 0x4d, 0x29, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x87, 0x88, 0x31, 0x20, 0x00,
|
||||
0x00, 0xff, 0xff, 0x3e, 0xda, 0x0a, 0xaf, 0x6f, 0x01, 0x00, 0x00,
|
||||
var fileDescriptor_81a1010cdbf4bc9c = []byte{
|
||||
// 248 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2a, 0x2e, 0x4b, 0xd6,
|
||||
0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62,
|
||||
0x2b, 0x2e, 0x4b, 0xd6, 0x2b, 0x33, 0x94, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f,
|
||||
0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0xa8,
|
||||
0x92, 0x12, 0x81, 0xea, 0x4c, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x84, 0x8a, 0x2a, 0x89, 0x70, 0x09,
|
||||
0x05, 0x82, 0x8c, 0x0a, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0x0e, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e,
|
||||
0x51, 0xb2, 0xe5, 0x12, 0x46, 0x11, 0x2d, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x15, 0x52, 0xe3, 0x62,
|
||||
0x2b, 0x00, 0x8b, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0xf1, 0xe9, 0x41, 0x6c, 0xd6, 0x83,
|
||||
0xaa, 0x83, 0xca, 0x1a, 0x25, 0x71, 0xb1, 0x82, 0xb5, 0x0b, 0x45, 0x72, 0xb1, 0x41, 0xa4, 0x84,
|
||||
0xa4, 0x60, 0x4a, 0x31, 0x6d, 0x93, 0x92, 0xc6, 0x2a, 0x07, 0xb1, 0x53, 0x49, 0xac, 0xe9, 0xf2,
|
||||
0x93, 0xc9, 0x4c, 0x02, 0x42, 0x7c, 0xfa, 0x50, 0xf7, 0x43, 0xec, 0x70, 0xb2, 0x39, 0xf1, 0x48,
|
||||
0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0,
|
||||
0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd,
|
||||
0xe4, 0xfc, 0x5c, 0xfd, 0xfc, 0xbc, 0xe2, 0xfc, 0xbc, 0x22, 0x7d, 0x30, 0x51, 0x01, 0x36, 0xa1,
|
||||
0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x7b, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0x32, 0x0f, 0x6c, 0xb9, 0x4f, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -164,7 +164,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient {
|
||||
|
||||
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
|
||||
out := new(QueryParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/service.v1.Query/Params", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/svc.v1.Query/Params", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +199,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.v1.Query/Params",
|
||||
FullMethod: "/svc.v1.Query/Params",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
|
||||
@@ -209,7 +209,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
|
||||
var Query_serviceDesc = _Query_serviceDesc
|
||||
var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "service.v1.Query",
|
||||
ServiceName: "svc.v1.Query",
|
||||
HandlerType: (*QueryServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
@@ -218,7 +218,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "service/v1/query.proto",
|
||||
Metadata: "svc/v1/query.proto",
|
||||
}
|
||||
|
||||
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) {
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: service/v1/query.proto
|
||||
// source: svc/v1/query.proto
|
||||
|
||||
/*
|
||||
Package types is a reverse proxy.
|
||||
@@ -145,7 +145,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"service", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"svc", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: service/v1/state.proto
|
||||
// source: svc/v1/state.proto
|
||||
|
||||
package types
|
||||
|
||||
@@ -23,7 +23,7 @@ var _ = math.Inf
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type Metadata struct {
|
||||
type Domain struct {
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
@@ -33,11 +33,105 @@ type Metadata struct {
|
||||
Tags []string `protobuf:"bytes,7,rep,name=tags,proto3" json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Domain) Reset() { *m = Domain{} }
|
||||
func (m *Domain) String() string { return proto.CompactTextString(m) }
|
||||
func (*Domain) ProtoMessage() {}
|
||||
func (*Domain) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2859adb306f7c51f, []int{0}
|
||||
}
|
||||
func (m *Domain) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Domain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Domain.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 *Domain) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Domain.Merge(m, src)
|
||||
}
|
||||
func (m *Domain) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Domain) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Domain.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Domain proto.InternalMessageInfo
|
||||
|
||||
func (m *Domain) GetId() uint64 {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Domain) GetOrigin() string {
|
||||
if m != nil {
|
||||
return m.Origin
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Domain) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Domain) GetDescription() string {
|
||||
if m != nil {
|
||||
return m.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Domain) GetCategory() string {
|
||||
if m != nil {
|
||||
return m.Category
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Domain) GetIcon() string {
|
||||
if m != nil {
|
||||
return m.Icon
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Domain) GetTags() []string {
|
||||
if m != nil {
|
||||
return m.Tags
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Metadata represents a DID alias
|
||||
type Metadata struct {
|
||||
// The unique identifier of the alias
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// The alias of the DID
|
||||
Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||
// Origin of the alias
|
||||
Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
// Controller of the alias
|
||||
Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Metadata) Reset() { *m = Metadata{} }
|
||||
func (m *Metadata) String() string { return proto.CompactTextString(m) }
|
||||
func (*Metadata) ProtoMessage() {}
|
||||
func (*Metadata) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ab6e3654a2974847, []int{0}
|
||||
return fileDescriptor_2859adb306f7c51f, []int{1}
|
||||
}
|
||||
func (m *Metadata) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -66,11 +160,18 @@ func (m *Metadata) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_Metadata proto.InternalMessageInfo
|
||||
|
||||
func (m *Metadata) GetId() uint64 {
|
||||
func (m *Metadata) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return 0
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Metadata) GetSubject() string {
|
||||
if m != nil {
|
||||
return m.Subject
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Metadata) GetOrigin() string {
|
||||
@@ -80,108 +181,7 @@ func (m *Metadata) GetOrigin() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Metadata) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Metadata) GetDescription() string {
|
||||
if m != nil {
|
||||
return m.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Metadata) GetCategory() string {
|
||||
if m != nil {
|
||||
return m.Category
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Metadata) GetIcon() string {
|
||||
if m != nil {
|
||||
return m.Icon
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Metadata) GetTags() []string {
|
||||
if m != nil {
|
||||
return m.Tags
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Profile represents a DID alias
|
||||
type Profile struct {
|
||||
// The unique identifier of the alias
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// The alias of the DID
|
||||
Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||
// Origin of the alias
|
||||
Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"`
|
||||
// Controller of the alias
|
||||
Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Profile) Reset() { *m = Profile{} }
|
||||
func (m *Profile) String() string { return proto.CompactTextString(m) }
|
||||
func (*Profile) ProtoMessage() {}
|
||||
func (*Profile) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ab6e3654a2974847, []int{1}
|
||||
}
|
||||
func (m *Profile) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Profile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Profile.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 *Profile) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Profile.Merge(m, src)
|
||||
}
|
||||
func (m *Profile) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Profile) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Profile.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Profile proto.InternalMessageInfo
|
||||
|
||||
func (m *Profile) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Profile) GetSubject() string {
|
||||
if m != nil {
|
||||
return m.Subject
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Profile) GetOrigin() string {
|
||||
if m != nil {
|
||||
return m.Origin
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Profile) GetController() string {
|
||||
func (m *Metadata) GetController() string {
|
||||
if m != nil {
|
||||
return m.Controller
|
||||
}
|
||||
@@ -189,39 +189,39 @@ func (m *Profile) GetController() string {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Metadata)(nil), "service.v1.Metadata")
|
||||
proto.RegisterType((*Profile)(nil), "service.v1.Profile")
|
||||
proto.RegisterType((*Domain)(nil), "svc.v1.Domain")
|
||||
proto.RegisterType((*Metadata)(nil), "svc.v1.Metadata")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("service/v1/state.proto", fileDescriptor_ab6e3654a2974847) }
|
||||
func init() { proto.RegisterFile("svc/v1/state.proto", fileDescriptor_2859adb306f7c51f) }
|
||||
|
||||
var fileDescriptor_ab6e3654a2974847 = []byte{
|
||||
// 348 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x6a, 0xe3, 0x30,
|
||||
0x10, 0x86, 0x23, 0xdb, 0xeb, 0x24, 0xb3, 0x4b, 0x08, 0x62, 0xc9, 0x8a, 0x1c, 0x84, 0x09, 0xcb,
|
||||
0x92, 0xc3, 0x12, 0x13, 0xf6, 0x96, 0xd3, 0xd2, 0x7b, 0xa1, 0xe4, 0xd8, 0x9b, 0x23, 0xab, 0xae,
|
||||
0x4a, 0xec, 0x09, 0x92, 0x12, 0x9a, 0x97, 0x28, 0xed, 0x0b, 0xf4, 0x79, 0x7a, 0xe8, 0x21, 0xd0,
|
||||
0x4b, 0x8f, 0x25, 0x79, 0x83, 0x3e, 0x41, 0x91, 0xe2, 0x14, 0xf7, 0x22, 0x66, 0xfe, 0x19, 0x7e,
|
||||
0xfd, 0x1f, 0x03, 0x03, 0x23, 0xf5, 0x46, 0x09, 0x99, 0x6e, 0xa6, 0xa9, 0xb1, 0x99, 0x95, 0x93,
|
||||
0x95, 0x46, 0x8b, 0x14, 0x6a, 0x7d, 0xb2, 0x99, 0x0e, 0x7f, 0x09, 0x34, 0x25, 0x9a, 0x14, 0x75,
|
||||
0xe9, 0xd6, 0x50, 0x97, 0xc7, 0xa5, 0xd1, 0x33, 0x81, 0xce, 0xb9, 0xb4, 0x59, 0x9e, 0xd9, 0x8c,
|
||||
0xf6, 0x20, 0x50, 0x39, 0x23, 0x09, 0x19, 0x47, 0xf3, 0x40, 0xe5, 0x74, 0x00, 0x31, 0x6a, 0x55,
|
||||
0xa8, 0x8a, 0x05, 0x09, 0x19, 0x77, 0xe7, 0x75, 0x47, 0x29, 0x44, 0x55, 0x56, 0x4a, 0x16, 0x7a,
|
||||
0xd5, 0xd7, 0x34, 0x81, 0xef, 0xb9, 0x34, 0x42, 0xab, 0x95, 0x55, 0x58, 0xb1, 0xc8, 0x8f, 0x9a,
|
||||
0x12, 0x1d, 0x42, 0x47, 0x64, 0x56, 0x16, 0xa8, 0xb7, 0xec, 0x9b, 0x1f, 0x7f, 0xf6, 0xce, 0x51,
|
||||
0x09, 0xac, 0x58, 0x7c, 0x74, 0x74, 0xb5, 0xd3, 0x6c, 0x56, 0x18, 0xd6, 0x4e, 0x42, 0xa7, 0xb9,
|
||||
0x7a, 0xc6, 0xdf, 0x1f, 0x5f, 0xee, 0x42, 0x06, 0xb1, 0x4b, 0xda, 0x27, 0xf4, 0xc7, 0x29, 0x61,
|
||||
0x9f, 0x30, 0xc2, 0xc8, 0xe8, 0x81, 0x40, 0xfb, 0x42, 0xe3, 0x95, 0x5a, 0xca, 0x06, 0x4d, 0xd7,
|
||||
0xd3, 0x30, 0x68, 0x9b, 0xf5, 0xe2, 0x46, 0x0a, 0x5b, 0xe3, 0x9c, 0xda, 0x06, 0x67, 0xf8, 0x85,
|
||||
0x93, 0x03, 0x08, 0xac, 0xac, 0xc6, 0xe5, 0x52, 0xea, 0x1a, 0xa9, 0xa1, 0xcc, 0x7e, 0xfb, 0x34,
|
||||
0x1c, 0x22, 0xf7, 0x13, 0xfd, 0x09, 0xbd, 0xda, 0xf0, 0x6f, 0x23, 0x53, 0x70, 0xf6, 0xff, 0x69,
|
||||
0xcf, 0xc9, 0x6e, 0xcf, 0xc9, 0xdb, 0x9e, 0x93, 0xfb, 0x03, 0x6f, 0xed, 0x0e, 0xbc, 0xf5, 0x7a,
|
||||
0xe0, 0xad, 0xcb, 0x3f, 0x85, 0xb2, 0xd7, 0xeb, 0xc5, 0x44, 0x60, 0x99, 0x62, 0x65, 0xb0, 0xd2,
|
||||
0xa9, 0x7f, 0x6e, 0xd3, 0xd3, 0x49, 0xed, 0x76, 0x25, 0xcd, 0x22, 0xf6, 0xb7, 0xfa, 0xf7, 0x11,
|
||||
0x00, 0x00, 0xff, 0xff, 0x81, 0xa0, 0xdf, 0xce, 0xea, 0x01, 0x00, 0x00,
|
||||
var fileDescriptor_2859adb306f7c51f = []byte{
|
||||
// 344 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xb1, 0x6a, 0x23, 0x31,
|
||||
0x10, 0x86, 0xad, 0xdd, 0xbd, 0xb5, 0xad, 0x3b, 0x8c, 0x11, 0xc7, 0x9d, 0x70, 0x21, 0x16, 0x73,
|
||||
0x85, 0x8b, 0xc3, 0x8b, 0x49, 0x67, 0x52, 0x85, 0xb4, 0x69, 0x5c, 0xa6, 0x93, 0xb5, 0x62, 0xa3,
|
||||
0xe0, 0xd5, 0x18, 0x49, 0x5e, 0xe2, 0x97, 0x08, 0x21, 0x0f, 0x90, 0xe7, 0x09, 0xa9, 0x0c, 0x69,
|
||||
0x52, 0x06, 0xfb, 0x0d, 0xf2, 0x04, 0x41, 0xf2, 0x3a, 0x6c, 0x1a, 0x31, 0xf3, 0xcf, 0xf0, 0xeb,
|
||||
0xff, 0x18, 0x4c, 0x6c, 0x2d, 0xf2, 0x7a, 0x96, 0x5b, 0xc7, 0x9d, 0x9c, 0xae, 0x0d, 0x38, 0x20,
|
||||
0xa9, 0xad, 0xc5, 0xb4, 0x9e, 0x8d, 0xfe, 0x0a, 0xb0, 0x15, 0xd8, 0x1c, 0x4c, 0xe5, 0x57, 0xc0,
|
||||
0x54, 0xc7, 0x85, 0xf1, 0x0b, 0xc2, 0xe9, 0x25, 0x54, 0x5c, 0x69, 0x32, 0xc0, 0x91, 0x2a, 0x28,
|
||||
0xca, 0xd0, 0x24, 0x59, 0x44, 0xaa, 0x20, 0x7f, 0x70, 0x0a, 0x46, 0x95, 0x4a, 0xd3, 0x28, 0x43,
|
||||
0x93, 0xfe, 0xa2, 0xe9, 0x08, 0xc1, 0x89, 0xe6, 0x95, 0xa4, 0x71, 0x50, 0x43, 0x4d, 0x32, 0xfc,
|
||||
0xb3, 0x90, 0x56, 0x18, 0xb5, 0x76, 0x0a, 0x34, 0x4d, 0xc2, 0xa8, 0x2d, 0x91, 0x11, 0xee, 0x09,
|
||||
0xee, 0x64, 0x09, 0x66, 0x4b, 0x7f, 0x84, 0xf1, 0x57, 0xef, 0x1d, 0x95, 0x00, 0x4d, 0xd3, 0xa3,
|
||||
0xa3, 0xaf, 0xbd, 0xe6, 0x78, 0x69, 0x69, 0x37, 0x8b, 0xbd, 0xe6, 0xeb, 0x39, 0xfb, 0x78, 0x7a,
|
||||
0xbd, 0x8f, 0x29, 0x4e, 0x7d, 0xd2, 0x21, 0x22, 0xbf, 0x4e, 0x09, 0x87, 0x88, 0x22, 0x8a, 0xc6,
|
||||
0x8f, 0x08, 0xf7, 0xae, 0xa4, 0xe3, 0x05, 0x77, 0xbc, 0x85, 0xd3, 0x0f, 0x38, 0x14, 0x77, 0xed,
|
||||
0x66, 0x79, 0x2b, 0x85, 0x6b, 0x78, 0x4e, 0x6d, 0x0b, 0x34, 0xfe, 0x06, 0xca, 0x30, 0x16, 0xa0,
|
||||
0x9d, 0x81, 0xd5, 0x4a, 0x9a, 0x86, 0xa9, 0xa5, 0xcc, 0xff, 0x85, 0x38, 0x0c, 0x27, 0xfe, 0x27,
|
||||
0xf2, 0x1b, 0x0f, 0x1a, 0xc3, 0xff, 0xad, 0x50, 0xd1, 0xc5, 0xf9, 0xf3, 0x9e, 0xa1, 0xdd, 0x9e,
|
||||
0xa1, 0xf7, 0x3d, 0x43, 0x0f, 0x07, 0xd6, 0xd9, 0x1d, 0x58, 0xe7, 0xed, 0xc0, 0x3a, 0xd7, 0xe3,
|
||||
0x52, 0xb9, 0x9b, 0xcd, 0x72, 0x2a, 0xa0, 0xca, 0x41, 0x5b, 0xd0, 0x26, 0x0f, 0xcf, 0x5d, 0xee,
|
||||
0x2f, 0xe9, 0xb6, 0x6b, 0x69, 0x97, 0x69, 0x38, 0xd3, 0xd9, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0x13, 0x81, 0x47, 0xf4, 0xdd, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Metadata) Marshal() (dAtA []byte, err error) {
|
||||
func (m *Domain) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
@@ -231,12 +231,12 @@ func (m *Metadata) Marshal() (dAtA []byte, err error) {
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Metadata) MarshalTo(dAtA []byte) (int, error) {
|
||||
func (m *Domain) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
func (m *Domain) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
@@ -293,7 +293,7 @@ func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Profile) Marshal() (dAtA []byte, err error) {
|
||||
func (m *Metadata) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
@@ -303,12 +303,12 @@ func (m *Profile) Marshal() (dAtA []byte, err error) {
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Profile) MarshalTo(dAtA []byte) (int, error) {
|
||||
func (m *Metadata) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
@@ -355,7 +355,7 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int {
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
func (m *Metadata) Size() (n int) {
|
||||
func (m *Domain) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
@@ -393,7 +393,7 @@ func (m *Metadata) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Profile) Size() (n int) {
|
||||
func (m *Metadata) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
@@ -424,7 +424,7 @@ func sovState(x uint64) (n int) {
|
||||
func sozState(x uint64) (n int) {
|
||||
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *Metadata) Unmarshal(dAtA []byte) error {
|
||||
func (m *Domain) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
@@ -447,10 +447,10 @@ func (m *Metadata) Unmarshal(dAtA []byte) error {
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Metadata: wiretype end group for non-group")
|
||||
return fmt.Errorf("proto: Domain: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return fmt.Errorf("proto: Domain: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
@@ -685,7 +685,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Profile) Unmarshal(dAtA []byte) error {
|
||||
func (m *Metadata) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
@@ -708,10 +708,10 @@ func (m *Profile) Unmarshal(dAtA []byte) error {
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Profile: wiretype end group for non-group")
|
||||
return fmt.Errorf("proto: Metadata: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Profile: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: service/v1/tx.proto
|
||||
// source: svc/v1/tx.proto
|
||||
|
||||
package types
|
||||
|
||||
@@ -46,7 +46,7 @@ func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} }
|
||||
func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParams) ProtoMessage() {}
|
||||
func (*MsgUpdateParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_361c6b19b8fa4769, []int{0}
|
||||
return fileDescriptor_084252b8c07dd202, []int{0}
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -100,7 +100,7 @@ func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse
|
||||
func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParamsResponse) ProtoMessage() {}
|
||||
func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_361c6b19b8fa4769, []int{1}
|
||||
return fileDescriptor_084252b8c07dd202, []int{1}
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -142,7 +142,7 @@ func (m *MsgRegisterService) Reset() { *m = MsgRegisterService{} }
|
||||
func (m *MsgRegisterService) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgRegisterService) ProtoMessage() {}
|
||||
func (*MsgRegisterService) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_361c6b19b8fa4769, []int{2}
|
||||
return fileDescriptor_084252b8c07dd202, []int{2}
|
||||
}
|
||||
func (m *MsgRegisterService) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -195,7 +195,7 @@ func (m *MsgRegisterServiceResponse) Reset() { *m = MsgRegisterServiceRe
|
||||
func (m *MsgRegisterServiceResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgRegisterServiceResponse) ProtoMessage() {}
|
||||
func (*MsgRegisterServiceResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_361c6b19b8fa4769, []int{3}
|
||||
return fileDescriptor_084252b8c07dd202, []int{3}
|
||||
}
|
||||
func (m *MsgRegisterServiceResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -239,43 +239,43 @@ func (m *MsgRegisterServiceResponse) GetDid() string {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "service.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "service.v1.MsgUpdateParamsResponse")
|
||||
proto.RegisterType((*MsgRegisterService)(nil), "service.v1.MsgRegisterService")
|
||||
proto.RegisterType((*MsgRegisterServiceResponse)(nil), "service.v1.MsgRegisterServiceResponse")
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "svc.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "svc.v1.MsgUpdateParamsResponse")
|
||||
proto.RegisterType((*MsgRegisterService)(nil), "svc.v1.MsgRegisterService")
|
||||
proto.RegisterType((*MsgRegisterServiceResponse)(nil), "svc.v1.MsgRegisterServiceResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("service/v1/tx.proto", fileDescriptor_361c6b19b8fa4769) }
|
||||
func init() { proto.RegisterFile("svc/v1/tx.proto", fileDescriptor_084252b8c07dd202) }
|
||||
|
||||
var fileDescriptor_361c6b19b8fa4769 = []byte{
|
||||
// 430 bytes of a gzipped FileDescriptorProto
|
||||
var fileDescriptor_084252b8c07dd202 = []byte{
|
||||
// 428 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0x8b, 0xd3, 0x40,
|
||||
0x14, 0xc7, 0x33, 0xae, 0xee, 0xda, 0xa7, 0x58, 0x99, 0x5d, 0xd8, 0x6c, 0x84, 0xb8, 0x44, 0x58,
|
||||
0x96, 0x85, 0x4d, 0xdc, 0x15, 0x44, 0xf6, 0xa4, 0x3d, 0x79, 0x29, 0x94, 0x14, 0x0f, 0x7a, 0x91,
|
||||
0x34, 0x19, 0xa6, 0x81, 0x26, 0x13, 0xe6, 0x4d, 0x4b, 0x7b, 0x13, 0xaf, 0x82, 0xf8, 0x51, 0x7a,
|
||||
0xf0, 0xe2, 0x37, 0xe8, 0xb1, 0x78, 0xf2, 0x24, 0xd2, 0x1e, 0xfa, 0x35, 0x24, 0xc9, 0xc4, 0xc6,
|
||||
0x08, 0xf5, 0x12, 0xe6, 0xbd, 0xff, 0x7f, 0xfe, 0xef, 0x97, 0x99, 0x81, 0x43, 0x64, 0x72, 0x12,
|
||||
0x87, 0xcc, 0x9b, 0x5c, 0x79, 0x6a, 0xea, 0x66, 0x52, 0x28, 0x41, 0x41, 0x37, 0xdd, 0xc9, 0x95,
|
||||
0x75, 0x1c, 0x0a, 0x4c, 0x04, 0x7a, 0x09, 0xf2, 0xdc, 0x93, 0x20, 0x2f, 0x4d, 0xd6, 0x49, 0x29,
|
||||
0xbc, 0x2f, 0x2a, 0xaf, 0x2c, 0xb4, 0x74, 0xc4, 0x05, 0x17, 0x65, 0x3f, 0x5f, 0xe9, 0xae, 0x59,
|
||||
0x1b, 0xc5, 0x59, 0xca, 0x30, 0xd6, 0x7e, 0xe7, 0x13, 0x81, 0x76, 0x17, 0xf9, 0x9b, 0x2c, 0x0a,
|
||||
0x14, 0xeb, 0x05, 0x32, 0x48, 0x90, 0x3e, 0x87, 0x56, 0x30, 0x56, 0x43, 0x21, 0x63, 0x35, 0x33,
|
||||
0xc9, 0x29, 0x39, 0x6f, 0x75, 0xcc, 0xef, 0x5f, 0x2f, 0x8f, 0xf4, 0xa0, 0x57, 0x51, 0x24, 0x19,
|
||||
0x62, 0x5f, 0xc9, 0x38, 0xe5, 0xfe, 0xd6, 0x4a, 0x9f, 0xc2, 0x7e, 0x56, 0x24, 0x98, 0xb7, 0x4e,
|
||||
0xc9, 0xf9, 0xbd, 0x6b, 0xea, 0x6e, 0x7f, 0xc6, 0x2d, 0xb3, 0x3b, 0xb7, 0x17, 0x3f, 0x1f, 0x1b,
|
||||
0xbe, 0xf6, 0xdd, 0x3c, 0xf8, 0xb8, 0x99, 0x5f, 0x6c, 0x13, 0x9c, 0x13, 0x38, 0x6e, 0xc0, 0xf8,
|
||||
0x0c, 0x33, 0x91, 0x22, 0x73, 0x3e, 0x13, 0xa0, 0x5d, 0xe4, 0x3e, 0xe3, 0x31, 0x2a, 0x26, 0xfb,
|
||||
0x65, 0x32, 0x7d, 0x01, 0x10, 0x8a, 0x54, 0x49, 0x31, 0x1a, 0x31, 0xf9, 0x5f, 0xd8, 0x9a, 0x97,
|
||||
0x5e, 0xc2, 0x81, 0xc6, 0xd3, 0xb8, 0x87, 0x75, 0x5c, 0x9d, 0xef, 0x57, 0x9e, 0x9b, 0x76, 0x8e,
|
||||
0x5a, 0xdb, 0xef, 0xbc, 0x06, 0xeb, 0x5f, 0x9e, 0x0a, 0x97, 0x9a, 0x70, 0x80, 0xe3, 0x30, 0x64,
|
||||
0x88, 0x05, 0xd4, 0x5d, 0xbf, 0x2a, 0xe9, 0x43, 0xd8, 0x8b, 0xe2, 0xa8, 0x98, 0xd9, 0xf2, 0xf3,
|
||||
0xe5, 0xf5, 0x37, 0x02, 0x7b, 0x5d, 0xe4, 0xb4, 0x07, 0xf7, 0xff, 0xba, 0x87, 0x47, 0x75, 0xa0,
|
||||
0xc6, 0xb9, 0x58, 0x4f, 0x76, 0x88, 0x7f, 0x28, 0xde, 0x42, 0xbb, 0x79, 0x60, 0x76, 0x63, 0x5f,
|
||||
0x43, 0xb7, 0xce, 0x76, 0xeb, 0x55, 0xb4, 0x75, 0xe7, 0xc3, 0x66, 0x7e, 0x41, 0x3a, 0x2f, 0x17,
|
||||
0x2b, 0x9b, 0x2c, 0x57, 0x36, 0xf9, 0xb5, 0xb2, 0xc9, 0x97, 0xb5, 0x6d, 0x2c, 0xd7, 0xb6, 0xf1,
|
||||
0x63, 0x6d, 0x1b, 0xef, 0xce, 0x78, 0xac, 0x86, 0xe3, 0x81, 0x1b, 0x8a, 0xc4, 0x13, 0x29, 0x8a,
|
||||
0x54, 0x7a, 0xc5, 0x67, 0xea, 0x55, 0x8f, 0x51, 0xcd, 0x32, 0x86, 0x83, 0xfd, 0xe2, 0x21, 0x3e,
|
||||
0xfb, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x80, 0x50, 0xdb, 0x0f, 0x03, 0x00, 0x00,
|
||||
0x14, 0xc7, 0x33, 0xae, 0x76, 0xed, 0x28, 0x1b, 0x19, 0x16, 0x9a, 0xcd, 0x21, 0xbb, 0xe4, 0xb4,
|
||||
0x2e, 0x9a, 0xb0, 0x15, 0x44, 0x8a, 0x17, 0x7b, 0xea, 0xa5, 0xa0, 0x29, 0x5e, 0xbc, 0x48, 0x3a,
|
||||
0x19, 0xa6, 0x81, 0x26, 0x13, 0xe6, 0x4d, 0x43, 0x7b, 0x13, 0x2f, 0x82, 0x27, 0xbf, 0x86, 0xb7,
|
||||
0x1e, 0xfc, 0x10, 0x3d, 0x16, 0x4f, 0x9e, 0x44, 0xda, 0x43, 0xbf, 0x86, 0x24, 0x93, 0xd8, 0x1a,
|
||||
0x29, 0x5e, 0xc2, 0x9b, 0xf9, 0xbf, 0xff, 0x7f, 0x7e, 0x79, 0x3c, 0x6c, 0x42, 0x4e, 0xfd, 0xfc,
|
||||
0xd6, 0x57, 0x73, 0x2f, 0x93, 0x42, 0x09, 0xd2, 0x82, 0x9c, 0x7a, 0xf9, 0xad, 0xdd, 0xa1, 0x02,
|
||||
0x12, 0x01, 0x7e, 0x02, 0xbc, 0xd0, 0x13, 0xe0, 0xba, 0xc1, 0x3e, 0xaf, 0x1c, 0x9c, 0xa5, 0x0c,
|
||||
0x62, 0xa8, 0x6f, 0xb9, 0xe0, 0xa2, 0x2c, 0xfd, 0xa2, 0xaa, 0x6e, 0x2f, 0x74, 0xc8, 0x7b, 0x2d,
|
||||
0xe8, 0x83, 0x96, 0xdc, 0x4f, 0x08, 0x9b, 0x43, 0xe0, 0x6f, 0xb3, 0x28, 0x54, 0xec, 0x75, 0x28,
|
||||
0xc3, 0x04, 0xc8, 0x73, 0xdc, 0x0e, 0x67, 0x6a, 0x22, 0x64, 0xac, 0x16, 0x16, 0xba, 0x42, 0xd7,
|
||||
0xed, 0xbe, 0xf5, 0xfd, 0xdb, 0xd3, 0xf3, 0xca, 0xf8, 0x2a, 0x8a, 0x24, 0x03, 0x18, 0x29, 0x19,
|
||||
0xa7, 0x3c, 0xd8, 0xb7, 0x92, 0x27, 0xb8, 0x95, 0x95, 0x09, 0xd6, 0x9d, 0x2b, 0x74, 0xfd, 0xa0,
|
||||
0x7b, 0xe6, 0xe9, 0x9f, 0xf0, 0x74, 0x6e, 0xff, 0xee, 0xea, 0xe7, 0xa5, 0x11, 0x54, 0x3d, 0xbd,
|
||||
0xb3, 0x8f, 0xbb, 0xe5, 0xcd, 0xde, 0xed, 0x5e, 0xe0, 0x4e, 0x03, 0x24, 0x60, 0x90, 0x89, 0x14,
|
||||
0x98, 0xfb, 0x19, 0x61, 0x32, 0x04, 0x1e, 0x30, 0x1e, 0x83, 0x62, 0x72, 0xc4, 0x64, 0x1e, 0x53,
|
||||
0x46, 0x5e, 0x60, 0x4c, 0x45, 0xaa, 0xa4, 0x98, 0x4e, 0x99, 0xfc, 0x2f, 0xe8, 0x41, 0x2f, 0x79,
|
||||
0x8c, 0x4f, 0x41, 0x87, 0x54, 0xa8, 0x66, 0x8d, 0x5a, 0x65, 0x07, 0xb5, 0xde, 0x33, 0x0b, 0xcc,
|
||||
0x03, 0xaf, 0x3b, 0xc0, 0xf6, 0xbf, 0x2c, 0x35, 0x2a, 0xb1, 0xf0, 0x29, 0xcc, 0x28, 0x65, 0x00,
|
||||
0x25, 0xd0, 0xfd, 0xa0, 0x3e, 0x92, 0x47, 0xf8, 0x24, 0x8a, 0xa3, 0xf2, 0xbd, 0x76, 0x50, 0x94,
|
||||
0xdd, 0xaf, 0x08, 0x9f, 0x0c, 0x81, 0x93, 0x01, 0x7e, 0xf8, 0xd7, 0xfc, 0x3b, 0x35, 0x4c, 0x63,
|
||||
0x1e, 0xf6, 0xe5, 0x11, 0xe1, 0xcf, 0xeb, 0x6f, 0xb0, 0xd9, 0x1c, 0x92, 0x7d, 0xe0, 0x69, 0x68,
|
||||
0xb6, 0x7b, 0x5c, 0xab, 0x23, 0xed, 0x7b, 0x1f, 0x76, 0xcb, 0x1b, 0xd4, 0x7f, 0xb9, 0xda, 0x38,
|
||||
0x68, 0xbd, 0x71, 0xd0, 0xaf, 0x8d, 0x83, 0xbe, 0x6c, 0x1d, 0x63, 0xbd, 0x75, 0x8c, 0x1f, 0x5b,
|
||||
0xc7, 0x78, 0xe7, 0xf2, 0x58, 0x4d, 0x66, 0x63, 0x8f, 0x8a, 0xc4, 0x17, 0x29, 0x88, 0x54, 0xfa,
|
||||
0xe5, 0x67, 0xee, 0x17, 0x1b, 0xaa, 0x16, 0x19, 0x83, 0x71, 0xab, 0x5c, 0xb6, 0x67, 0xbf, 0x03,
|
||||
0x00, 0x00, 0xff, 0xff, 0x98, 0xbc, 0xa7, 0xbe, 0xe7, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -309,7 +309,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient {
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/service.v1.Msg/UpdateParams", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/svc.v1.Msg/UpdateParams", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -318,7 +318,7 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
|
||||
|
||||
func (c *msgClient) RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error) {
|
||||
out := new(MsgRegisterServiceResponse)
|
||||
err := c.cc.Invoke(ctx, "/service.v1.Msg/RegisterService", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/svc.v1.Msg/RegisterService", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -361,7 +361,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.v1.Msg/UpdateParams",
|
||||
FullMethod: "/svc.v1.Msg/UpdateParams",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
@@ -379,7 +379,7 @@ func _Msg_RegisterService_Handler(srv interface{}, ctx context.Context, dec func
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.v1.Msg/RegisterService",
|
||||
FullMethod: "/svc.v1.Msg/RegisterService",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).RegisterService(ctx, req.(*MsgRegisterService))
|
||||
@@ -389,7 +389,7 @@ func _Msg_RegisterService_Handler(srv interface{}, ctx context.Context, dec func
|
||||
|
||||
var Msg_serviceDesc = _Msg_serviceDesc
|
||||
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "service.v1.Msg",
|
||||
ServiceName: "svc.v1.Msg",
|
||||
HandlerType: (*MsgServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
@@ -402,7 +402,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "service/v1/tx.proto",
|
||||
Metadata: "svc/v1/tx.proto",
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) {
|
||||
@@ -1,61 +0,0 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/ipfs/boxo/path"
|
||||
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
)
|
||||
|
||||
func (k Keeper) Logger() log.Logger {
|
||||
return k.logger
|
||||
}
|
||||
|
||||
// InitGenesis initializes the module's state from a genesis state.
|
||||
func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
|
||||
// this line is used by starport scaffolding # genesis/module/init
|
||||
if err := data.Params.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return k.Params.Set(ctx, data.Params)
|
||||
}
|
||||
|
||||
// ExportGenesis exports the module's state to a genesis state.
|
||||
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState {
|
||||
params, err := k.Params.Get(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// this line is used by starport scaffolding # genesis/module/export
|
||||
|
||||
return &types.GenesisState{
|
||||
Params: params,
|
||||
}
|
||||
}
|
||||
|
||||
// IPFSConnected returns true if the IPFS client is initialized
|
||||
func (c Keeper) IPFSConnected() bool {
|
||||
return c.hasIpfsConn
|
||||
}
|
||||
|
||||
// HasPathInIPFS checks if a file is in the local IPFS node
|
||||
func (k Keeper) HasPathInIPFS(ctx sdk.Context, cid string) (bool, error) {
|
||||
path, err := path.NewPath(cid)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
v, err := k.ipfsClient.Unixfs().Get(ctx, path)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if v == nil {
|
||||
return false, nil
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/collections"
|
||||
storetypes "cosmossdk.io/core/store"
|
||||
"cosmossdk.io/log"
|
||||
"cosmossdk.io/orm/model/ormdb"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
"github.com/ipfs/kubo/client/rpc"
|
||||
|
||||
apiv1 "github.com/onsonr/sonr/api/vault/v1"
|
||||
"github.com/onsonr/sonr/pkg/core/dwn"
|
||||
didkeeper "github.com/onsonr/sonr/x/did/keeper"
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
)
|
||||
|
||||
type Keeper struct {
|
||||
cdc codec.BinaryCodec
|
||||
|
||||
logger log.Logger
|
||||
|
||||
// state management
|
||||
Schema collections.Schema
|
||||
Params collections.Item[types.Params]
|
||||
OrmDB apiv1.StateStore
|
||||
|
||||
authority string
|
||||
|
||||
ipfsClient *rpc.HttpApi
|
||||
hasIpfsConn bool
|
||||
|
||||
AccountKeeper authkeeper.AccountKeeper
|
||||
DIDKeeper didkeeper.Keeper
|
||||
}
|
||||
|
||||
// NewKeeper creates a new Keeper instance
|
||||
func NewKeeper(
|
||||
cdc codec.BinaryCodec,
|
||||
storeService storetypes.KVStoreService,
|
||||
logger log.Logger,
|
||||
authority string,
|
||||
authKeeper authkeeper.AccountKeeper,
|
||||
didKeeper didkeeper.Keeper,
|
||||
) Keeper {
|
||||
var hasIpfs bool
|
||||
logger = logger.With(log.ModuleKey, "x/"+types.ModuleName)
|
||||
|
||||
sb := collections.NewSchemaBuilder(storeService)
|
||||
|
||||
if authority == "" {
|
||||
authority = authtypes.NewModuleAddress(govtypes.ModuleName).String()
|
||||
}
|
||||
|
||||
db, err := ormdb.NewModuleDB(&types.ORMModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
store, err := apiv1.NewStateStore(db)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
ipfsClient, err := rpc.NewLocalApi()
|
||||
if err != nil {
|
||||
hasIpfs = false
|
||||
}
|
||||
|
||||
if ipfsClient != nil {
|
||||
hasIpfs = true
|
||||
}
|
||||
|
||||
k := Keeper{
|
||||
cdc: cdc,
|
||||
logger: logger,
|
||||
DIDKeeper: didKeeper,
|
||||
AccountKeeper: authKeeper,
|
||||
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
|
||||
OrmDB: store,
|
||||
|
||||
ipfsClient: ipfsClient,
|
||||
hasIpfsConn: hasIpfs,
|
||||
authority: authority,
|
||||
}
|
||||
|
||||
schema, err := sb.Build()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
k.Schema = schema
|
||||
|
||||
return k
|
||||
}
|
||||
|
||||
// currentSchema returns the current schema
|
||||
func (k Keeper) currentSchema(ctx sdk.Context) (*dwn.Schema, error) {
|
||||
p, err := k.Params.Get(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
schema := p.Schema
|
||||
return &dwn.Schema{
|
||||
Version: int(schema.Version),
|
||||
Account: schema.Account,
|
||||
Asset: schema.Asset,
|
||||
Chain: schema.Chain,
|
||||
Credential: schema.Credential,
|
||||
Jwk: schema.Jwk,
|
||||
Grant: schema.Grant,
|
||||
Keyshare: schema.Keyshare,
|
||||
Profile: schema.Profile,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func calculateBlockExpiry(sdkctx sdk.Context, duration time.Duration) int64 {
|
||||
blockTime := sdkctx.BlockTime()
|
||||
avgBlockTime := float64(blockTime.Sub(blockTime).Seconds())
|
||||
return int64(duration.Seconds() / avgBlockTime)
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package keeper_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestORM(t *testing.T) {
|
||||
f := SetupTest(t)
|
||||
|
||||
dt := f.k.OrmDB.DWNTable()
|
||||
require.NotNil(t, dt)
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/onsonr/sonr/pkg/crypto/mpc"
|
||||
"github.com/onsonr/sonr/x/did/controller"
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
)
|
||||
|
||||
var _ types.QueryServer = Querier{}
|
||||
|
||||
type Querier struct{ Keeper }
|
||||
|
||||
func NewQuerier(keeper Keeper) Querier {
|
||||
return Querier{Keeper: keeper}
|
||||
}
|
||||
|
||||
// ╭───────────────────────────────────────────────────────────╮
|
||||
// │ Fixed Query Methods │
|
||||
// ╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
// Params implements types.QueryServer.
|
||||
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(c)
|
||||
|
||||
p, err := k.Keeper.Params.Get(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &types.QueryParamsResponse{Params: &p}, nil
|
||||
}
|
||||
|
||||
// Schema implements types.QueryServer.
|
||||
func (k Querier) Schema(goCtx context.Context, req *types.QuerySchemaRequest) (*types.QuerySchemaResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
|
||||
p, err := k.Keeper.Params.Get(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &types.QuerySchemaResponse{
|
||||
Schema: p.Schema,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ╭───────────────────────────────────────────────────────────╮
|
||||
// │ Pre-Authenticated Queries │
|
||||
// ╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
// Allocate implements types.QueryServer.
|
||||
func (k Querier) Allocate(goCtx context.Context, req *types.QueryAllocateRequest) (*types.QueryAllocateResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
|
||||
// 1. Get current schema
|
||||
sch, err := k.currentSchema(ctx)
|
||||
if err != nil {
|
||||
ctx.Logger().Error(fmt.Sprintf("Error getting current schema: %s", err.Error()))
|
||||
return nil, types.ErrInvalidSchema.Wrap(err.Error())
|
||||
}
|
||||
|
||||
// 2. Generate MPC Keyshares for new Account
|
||||
shares, err := mpc.NewKeyshareSource()
|
||||
if err != nil {
|
||||
ctx.Logger().Error(fmt.Sprintf("Error generating keyshares: %s", err.Error()))
|
||||
return nil, types.ErrInvalidSchema.Wrap(err.Error())
|
||||
}
|
||||
|
||||
// 3. Create Controller from Keyshares
|
||||
con, err := controller.New(shares)
|
||||
if err != nil {
|
||||
ctx.Logger().Error(fmt.Sprintf("Error creating controller: %s", err.Error()))
|
||||
return nil, types.ErrControllerCreation.Wrap(err.Error())
|
||||
}
|
||||
|
||||
// 4. Create a new vault PWA for service-worker
|
||||
v, err := types.SpawnVault("", con.SonrAddress(), con.ChainID(), sch)
|
||||
if err != nil {
|
||||
ctx.Logger().Error(fmt.Sprintf("Error creating vault: %s", err.Error()))
|
||||
return nil, types.ErrInvalidSchema.Wrap(err.Error())
|
||||
}
|
||||
|
||||
// 5. Add to IPFS and Return CID for User Claims in Gateway
|
||||
cid, err := k.ipfsClient.Unixfs().Add(context.Background(), v)
|
||||
if err != nil {
|
||||
ctx.Logger().Error(fmt.Sprintf("Error adding to IPFS: %s", err.Error()))
|
||||
return nil, types.ErrVaultAssembly.Wrap(err.Error())
|
||||
}
|
||||
|
||||
// 6. Return final response
|
||||
return &types.QueryAllocateResponse{
|
||||
Success: true,
|
||||
Cid: cid.String(),
|
||||
ExpiryBlock: calculateBlockExpiry(ctx, time.Second*30),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ╭───────────────────────────────────────────────────────────╮
|
||||
// │ Authenticated Endpoints │
|
||||
// ╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
// Sync implements types.QueryServer.
|
||||
func (k Querier) Sync(goCtx context.Context, req *types.QuerySyncRequest) (*types.QuerySyncResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
p, err := k.Keeper.Params.Get(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c, _ := k.DIDKeeper.ResolveController(ctx, req.Did)
|
||||
if c == nil {
|
||||
return &types.QuerySyncResponse{
|
||||
Success: false,
|
||||
Schema: p.Schema,
|
||||
ChainID: ctx.ChainID(),
|
||||
}, nil
|
||||
}
|
||||
return &types.QuerySyncResponse{
|
||||
Success: true,
|
||||
Schema: p.Schema,
|
||||
ChainID: ctx.ChainID(),
|
||||
Address: c.SonrAddress(),
|
||||
}, nil
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package types
|
||||
|
||||
import sdkerrors "cosmossdk.io/errors"
|
||||
|
||||
var (
|
||||
ErrInvalidGenesisState = sdkerrors.Register(ModuleName, 100, "invalid genesis state")
|
||||
ErrInvalidSchema = sdkerrors.Register(ModuleName, 200, "invalid schema")
|
||||
ErrVaultAssembly = sdkerrors.Register(ModuleName, 201, "vault assembly")
|
||||
ErrControllerCreation = sdkerrors.Register(ModuleName, 202, "failed to create controller")
|
||||
ErrUnsupportedKeyEncoding = sdkerrors.Register(ModuleName, 300, "unsupported key encoding")
|
||||
ErrUnsopportedChainCode = sdkerrors.Register(ModuleName, 301, "unsupported chain code")
|
||||
ErrUnsupportedKeyCurve = sdkerrors.Register(ModuleName, 302, "unsupported key curve")
|
||||
)
|
||||
@@ -1 +0,0 @@
|
||||
package types
|
||||
@@ -1,457 +0,0 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: vault/v1/state.proto
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
_ "cosmossdk.io/orm"
|
||||
fmt "fmt"
|
||||
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 DWN struct {
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Alias string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"`
|
||||
Cid string `protobuf:"bytes,3,opt,name=cid,proto3" json:"cid,omitempty"`
|
||||
Resolver string `protobuf:"bytes,4,opt,name=resolver,proto3" json:"resolver,omitempty"`
|
||||
}
|
||||
|
||||
func (m *DWN) Reset() { *m = DWN{} }
|
||||
func (m *DWN) String() string { return proto.CompactTextString(m) }
|
||||
func (*DWN) ProtoMessage() {}
|
||||
func (*DWN) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2ad3e71ba384142e, []int{0}
|
||||
}
|
||||
func (m *DWN) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *DWN) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_DWN.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 *DWN) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_DWN.Merge(m, src)
|
||||
}
|
||||
func (m *DWN) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *DWN) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_DWN.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_DWN proto.InternalMessageInfo
|
||||
|
||||
func (m *DWN) GetId() uint64 {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *DWN) GetAlias() string {
|
||||
if m != nil {
|
||||
return m.Alias
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *DWN) GetCid() string {
|
||||
if m != nil {
|
||||
return m.Cid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *DWN) GetResolver() string {
|
||||
if m != nil {
|
||||
return m.Resolver
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*DWN)(nil), "vault.v1.DWN")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("vault/v1/state.proto", fileDescriptor_2ad3e71ba384142e) }
|
||||
|
||||
var fileDescriptor_2ad3e71ba384142e = []byte{
|
||||
// 240 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x29, 0x4b, 0x2c, 0xcd,
|
||||
0x29, 0xd1, 0x2f, 0x33, 0xd4, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9,
|
||||
0x17, 0xe2, 0x00, 0x8b, 0xea, 0x95, 0x19, 0x4a, 0x89, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb,
|
||||
0xe7, 0x17, 0xe5, 0x82, 0x14, 0xe5, 0x17, 0xe5, 0x42, 0x94, 0x28, 0x35, 0x33, 0x72, 0x31, 0xbb,
|
||||
0x84, 0xfb, 0x09, 0xf1, 0x71, 0x31, 0x65, 0xa6, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x04, 0x31,
|
||||
0x65, 0xa6, 0x08, 0x89, 0x70, 0xb1, 0x26, 0xe6, 0x64, 0x26, 0x16, 0x4b, 0x30, 0x29, 0x30, 0x6a,
|
||||
0x70, 0x06, 0x41, 0x38, 0x42, 0x02, 0x5c, 0xcc, 0xc9, 0x99, 0x29, 0x12, 0xcc, 0x60, 0x31, 0x10,
|
||||
0x53, 0x48, 0x8a, 0x8b, 0xa3, 0x28, 0xb5, 0x38, 0x3f, 0xa7, 0x2c, 0xb5, 0x48, 0x82, 0x05, 0x2c,
|
||||
0x0c, 0xe7, 0x5b, 0x69, 0x7c, 0x9a, 0x77, 0xb9, 0x8f, 0x59, 0x89, 0x8b, 0x0d, 0x64, 0xb6, 0x00,
|
||||
0xa3, 0x10, 0x37, 0xd4, 0x4c, 0x01, 0x46, 0x09, 0x46, 0x21, 0x4e, 0xb0, 0x51, 0x02, 0x4c, 0x12,
|
||||
0x8c, 0x12, 0x8c, 0x4e, 0x76, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91,
|
||||
0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5,
|
||||
0x92, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x9f, 0x57, 0x9c, 0x9f,
|
||||
0x57, 0xa4, 0x0f, 0x26, 0x2a, 0xf4, 0x21, 0x3e, 0x2e, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03,
|
||||
0x7b, 0xc6, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x1a, 0xfe, 0x9e, 0x9c, 0x07, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *DWN) 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 *DWN) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *DWN) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Resolver) > 0 {
|
||||
i -= len(m.Resolver)
|
||||
copy(dAtA[i:], m.Resolver)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Resolver)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Cid) > 0 {
|
||||
i -= len(m.Cid)
|
||||
copy(dAtA[i:], m.Cid)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Cid)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Alias) > 0 {
|
||||
i -= len(m.Alias)
|
||||
copy(dAtA[i:], m.Alias)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Alias)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Id != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.Id))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintState(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovState(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
func (m *DWN) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Id != 0 {
|
||||
n += 1 + sovState(uint64(m.Id))
|
||||
}
|
||||
l = len(m.Alias)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Cid)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Resolver)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovState(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozState(x uint64) (n int) {
|
||||
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *DWN) 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 ErrIntOverflowState
|
||||
}
|
||||
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: DWN: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: DWN: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
||||
}
|
||||
m.Id = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Id |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Alias", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
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 ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Alias = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
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 ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Cid = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Resolver", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
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 ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Resolver = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipState(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipState(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, ErrIntOverflowState
|
||||
}
|
||||
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, ErrIntOverflowState
|
||||
}
|
||||
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, ErrIntOverflowState
|
||||
}
|
||||
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, ErrInvalidLengthState
|
||||
}
|
||||
iNdEx += length
|
||||
case 3:
|
||||
depth++
|
||||
case 4:
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupState
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthState
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowState = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
Reference in New Issue
Block a user