mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feature/1111 sync chain dwn endpoint (#1143)
- **feat(did): add assertion type to DID spec** - **refactor: update build process to include assets generation** - **refactor: update import paths for to** - **feat: introduce new authentication state management** - **feat: add current account route** - **feat: implement global toasts with custom HTML** - **refactor: remove unused session code** - **feat: add config.json to embedded assets** - **refactor: remove unused dependency on gorilla/sessions** - **refactor: simplify session management and remove unnecessary fields** - **fix: remove unnecessary import for unused protobuf types** - **feat: introduce separate HTTP contexts for Highway and DWN** - **fix(keeper): Handle missing controller during initial sync** - **refactor: extract DWN configuration from DWNContext** - **feat: add view route** - **fix: update configuration file name in embed.go** - **feat: improve vaultindex page loading experience** - **feat(hway): add highway context to echo context** - **chore(deps): bump onsonr/crypto from 1.32.0 to 1.33.0** - **refactor: rename DWNSessionMiddleware to WebNodeSessionMiddleware** - **feat: rename client API to web node API** - **refactor: separate API and view routes** - **refactor: remove unused build targets in Makefile** - **feat: add Devbox integration to container** - **feat: add wasm support for dwn** - **refactor: update module proto import** - **feat: add default first and third party caveats** - **feat: Add target vault allocation mechanism** - **refactor: introduce standardized session cookie handling** - **fix: update service worker installation and ready states** - **feat: add worker handlers** - **feat: Enable SSH access to devcontainer** - **refactor: rename HighwayContext to HwayContext** - **feat: add block expiration calculation to sonr context** - **feat: remove config from cookie and header** - **feat(gen): Remove generated code for IPFS, Motr and Sonr** - **refactor: remove unused createMotrConfig function** - **feat: add project analytics with Repobeats** - **docs: Remove component details from README** - **refactor: rename SetConfig to injectConfig**
This commit is contained in:
@@ -11,7 +11,7 @@ func (k Keeper) NewController(ctx sdk.Context) (uint64, types.ControllerI, error
|
||||
if err != nil {
|
||||
return 0, nil, err
|
||||
}
|
||||
controller, err := types.NewController(shares)
|
||||
controller, err := types.NewController(ctx, shares)
|
||||
if err != nil {
|
||||
return 0, nil, err
|
||||
}
|
||||
@@ -25,3 +25,15 @@ func (k Keeper) NewController(ctx sdk.Context) (uint64, types.ControllerI, error
|
||||
}
|
||||
return num, controller, nil
|
||||
}
|
||||
|
||||
func (k Keeper) ResolveController(ctx sdk.Context, did string) (types.ControllerI, error) {
|
||||
ct, err := k.OrmDB.ControllerTable().GetByDid(ctx, did)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c, err := types.LoadControllerFromTableEntry(ctx, ct)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
+24
-7
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
|
||||
"cosmossdk.io/errors"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||
|
||||
"github.com/onsonr/sonr/x/did/types"
|
||||
@@ -21,12 +20,6 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer {
|
||||
return &msgServer{k: keeper}
|
||||
}
|
||||
|
||||
// RegisterController implements types.MsgServer.
|
||||
func (ms msgServer) RegisterController(goCtx context.Context, msg *types.MsgRegisterController) (*types.MsgRegisterControllerResponse, error) {
|
||||
_ = sdk.UnwrapSDKContext(goCtx)
|
||||
return &types.MsgRegisterControllerResponse{}, nil
|
||||
}
|
||||
|
||||
// UpdateParams updates the x/did module parameters.
|
||||
func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
||||
if ms.k.authority != msg.Authority {
|
||||
@@ -45,3 +38,27 @@ func (ms msgServer) ExecuteTx(ctx context.Context, msg *types.MsgExecuteTx) (*ty
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
return &types.MsgExecuteTxResponse{}, nil
|
||||
}
|
||||
|
||||
// LinkAssertion implements types.MsgServer.
|
||||
func (ms msgServer) LinkAssertion(ctx context.Context, msg *types.MsgLinkAssertion) (*types.MsgLinkAssertionResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
return &types.MsgLinkAssertionResponse{}, nil
|
||||
}
|
||||
|
||||
// LinkAuthentication implements types.MsgServer.
|
||||
func (ms msgServer) LinkAuthentication(ctx context.Context, msg *types.MsgLinkAuthentication) (*types.MsgLinkAuthenticationResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
return &types.MsgLinkAuthenticationResponse{}, nil
|
||||
}
|
||||
|
||||
// UnlinkAssertion implements types.MsgServer.
|
||||
func (ms msgServer) UnlinkAssertion(ctx context.Context, msg *types.MsgUnlinkAssertion) (*types.MsgUnlinkAssertionResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
return &types.MsgUnlinkAssertionResponse{}, nil
|
||||
}
|
||||
|
||||
// UnlinkAuthentication implements types.MsgServer.
|
||||
func (ms msgServer) UnlinkAuthentication(ctx context.Context, msg *types.MsgUnlinkAuthentication) (*types.MsgUnlinkAuthenticationResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
return &types.MsgUnlinkAuthenticationResponse{}, nil
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/msgservice"
|
||||
// this line is used by starport scaffolding # 1
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -24,7 +23,6 @@ func init() {
|
||||
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
|
||||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil)
|
||||
cdc.RegisterConcrete(&MsgRegisterController{}, ModuleName+"/MsgRegisterController", nil)
|
||||
}
|
||||
|
||||
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
@@ -36,7 +34,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
registry.RegisterImplementations(
|
||||
(*sdk.Msg)(nil),
|
||||
&MsgUpdateParams{},
|
||||
&MsgRegisterController{},
|
||||
)
|
||||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/onsonr/crypto/mpc"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
didv1 "github.com/onsonr/sonr/api/did/v1"
|
||||
)
|
||||
|
||||
@@ -19,7 +20,7 @@ type ControllerI interface {
|
||||
ExportUserKs() (string, error)
|
||||
}
|
||||
|
||||
func NewController(shares []mpc.Share) (ControllerI, error) {
|
||||
func NewController(ctx sdk.Context, shares []mpc.Share) (ControllerI, error) {
|
||||
var (
|
||||
valKs = shares[0]
|
||||
userKs = shares[1]
|
||||
@@ -48,11 +49,21 @@ func NewController(shares []mpc.Share) (ControllerI, error) {
|
||||
address: sonrAddr,
|
||||
btcAddr: btcAddr,
|
||||
ethAddr: ethAddr,
|
||||
chainID: "sonr-testnet-1",
|
||||
chainID: ctx.ChainID(),
|
||||
publicKey: pbBz,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func LoadControllerFromTableEntry(ctx sdk.Context, entry *didv1.Controller) (ControllerI, error) {
|
||||
return &controller{
|
||||
address: entry.Did,
|
||||
btcAddr: entry.BtcAddress,
|
||||
ethAddr: entry.EthAddress,
|
||||
chainID: ctx.ChainID(),
|
||||
publicKey: entry.PublicKey.RawKey.Key,
|
||||
}, nil
|
||||
}
|
||||
|
||||
type controller struct {
|
||||
userKs mpc.Share
|
||||
valKs mpc.Share
|
||||
@@ -61,6 +72,7 @@ type controller struct {
|
||||
ethAddr string
|
||||
btcAddr string
|
||||
publicKey []byte
|
||||
did string
|
||||
}
|
||||
|
||||
func (c *controller) BtcAddress() string {
|
||||
|
||||
+3
-38
@@ -7,9 +7,9 @@ import (
|
||||
|
||||
var _ sdk.Msg = &MsgUpdateParams{}
|
||||
|
||||
//
|
||||
// [UpdateParams]
|
||||
//
|
||||
// ╭────────────────────────────────────────────────────────╮
|
||||
// │ MsgUpdateParams │
|
||||
// ╰────────────────────────────────────────────────────────╯
|
||||
|
||||
// NewMsgUpdateParams creates new instance of MsgUpdateParams
|
||||
func NewMsgUpdateParams(
|
||||
@@ -47,38 +47,3 @@ func (msg *MsgUpdateParams) Validate() error {
|
||||
|
||||
return msg.Params.Validate()
|
||||
}
|
||||
|
||||
//
|
||||
// [RegisterController]
|
||||
//
|
||||
|
||||
// NewMsgRegisterController creates a new instance of MsgRegisterController
|
||||
func NewMsgRegisterController(
|
||||
sender sdk.Address,
|
||||
) (*MsgRegisterController, error) {
|
||||
return &MsgRegisterController{
|
||||
Authority: sender.String(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Route returns the name of the module
|
||||
func (msg MsgRegisterController) Route() string { return ModuleName }
|
||||
|
||||
// Type returns the the action
|
||||
func (msg MsgRegisterController) Type() string { return "register_controller" }
|
||||
|
||||
// GetSignBytes implements the LegacyMsg interface.
|
||||
func (msg MsgRegisterController) GetSignBytes() []byte {
|
||||
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
|
||||
}
|
||||
|
||||
// GetSigners returns the expected signers for a MsgUpdateParams message.
|
||||
func (msg *MsgRegisterController) GetSigners() []sdk.AccAddress {
|
||||
addr, _ := sdk.AccAddressFromBech32(msg.Authority)
|
||||
return []sdk.AccAddress{addr}
|
||||
}
|
||||
|
||||
// ValidateBasic does a sanity check on the provided data.
|
||||
func (msg *MsgRegisterController) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
+646
-47
@@ -23,6 +23,105 @@ var _ = math.Inf
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type Assertion struct {
|
||||
// The unique identifier of the assertion
|
||||
Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"`
|
||||
// The authentication of the DID
|
||||
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||
// Origin of the authentication
|
||||
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
|
||||
// PubKey is the verification method
|
||||
PublicKey *PubKey `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
||||
// AssertionType is the assertion type
|
||||
AssertionType string `protobuf:"bytes,5,opt,name=assertion_type,json=assertionType,proto3" json:"assertion_type,omitempty"`
|
||||
// Metadata of the authentication
|
||||
Accumulator map[string][]byte `protobuf:"bytes,6,rep,name=accumulator,proto3" json:"accumulator,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
// CreationBlock is the block number of the creation of the authentication
|
||||
CreationBlock int64 `protobuf:"varint,7,opt,name=creation_block,json=creationBlock,proto3" json:"creation_block,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Assertion) Reset() { *m = Assertion{} }
|
||||
func (m *Assertion) String() string { return proto.CompactTextString(m) }
|
||||
func (*Assertion) ProtoMessage() {}
|
||||
func (*Assertion) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_f44bb702879c34b4, []int{0}
|
||||
}
|
||||
func (m *Assertion) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Assertion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Assertion.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 *Assertion) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Assertion.Merge(m, src)
|
||||
}
|
||||
func (m *Assertion) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Assertion) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Assertion.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Assertion proto.InternalMessageInfo
|
||||
|
||||
func (m *Assertion) GetDid() string {
|
||||
if m != nil {
|
||||
return m.Did
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Assertion) GetController() string {
|
||||
if m != nil {
|
||||
return m.Controller
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Assertion) GetSubject() string {
|
||||
if m != nil {
|
||||
return m.Subject
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Assertion) GetPublicKey() *PubKey {
|
||||
if m != nil {
|
||||
return m.PublicKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Assertion) GetAssertionType() string {
|
||||
if m != nil {
|
||||
return m.AssertionType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Assertion) GetAccumulator() map[string][]byte {
|
||||
if m != nil {
|
||||
return m.Accumulator
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Assertion) GetCreationBlock() int64 {
|
||||
if m != nil {
|
||||
return m.CreationBlock
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Authentication struct {
|
||||
// The unique identifier of the authentication
|
||||
Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"`
|
||||
@@ -44,7 +143,7 @@ func (m *Authentication) Reset() { *m = Authentication{} }
|
||||
func (m *Authentication) String() string { return proto.CompactTextString(m) }
|
||||
func (*Authentication) ProtoMessage() {}
|
||||
func (*Authentication) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_f44bb702879c34b4, []int{0}
|
||||
return fileDescriptor_f44bb702879c34b4, []int{1}
|
||||
}
|
||||
func (m *Authentication) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -148,7 +247,7 @@ func (m *Controller) Reset() { *m = Controller{} }
|
||||
func (m *Controller) String() string { return proto.CompactTextString(m) }
|
||||
func (*Controller) ProtoMessage() {}
|
||||
func (*Controller) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_f44bb702879c34b4, []int{1}
|
||||
return fileDescriptor_f44bb702879c34b4, []int{2}
|
||||
}
|
||||
func (m *Controller) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -266,7 +365,7 @@ func (m *Verification) Reset() { *m = Verification{} }
|
||||
func (m *Verification) String() string { return proto.CompactTextString(m) }
|
||||
func (*Verification) ProtoMessage() {}
|
||||
func (*Verification) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_f44bb702879c34b4, []int{2}
|
||||
return fileDescriptor_f44bb702879c34b4, []int{3}
|
||||
}
|
||||
func (m *Verification) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -359,6 +458,8 @@ func (m *Verification) GetCreationBlock() int64 {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Assertion)(nil), "did.v1.Assertion")
|
||||
proto.RegisterMapType((map[string][]byte)(nil), "did.v1.Assertion.AccumulatorEntry")
|
||||
proto.RegisterType((*Authentication)(nil), "did.v1.Authentication")
|
||||
proto.RegisterMapType((map[string]string)(nil), "did.v1.Authentication.MetadataEntry")
|
||||
proto.RegisterType((*Controller)(nil), "did.v1.Controller")
|
||||
@@ -369,50 +470,143 @@ func init() {
|
||||
func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) }
|
||||
|
||||
var fileDescriptor_f44bb702879c34b4 = []byte{
|
||||
// 674 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xd1, 0x6a, 0xd3, 0x50,
|
||||
0x1c, 0xc6, 0x77, 0x9a, 0xb6, 0x5b, 0xff, 0xed, 0x4a, 0x77, 0x98, 0x7a, 0x18, 0x1a, 0x6b, 0xa7,
|
||||
0x52, 0x71, 0xb6, 0x6c, 0xde, 0xc8, 0x14, 0x71, 0x13, 0x2f, 0x64, 0x0c, 0x24, 0xca, 0x40, 0x6f,
|
||||
0x42, 0x92, 0x73, 0x5c, 0x8f, 0x4d, 0x72, 0x6a, 0xce, 0x49, 0x31, 0x97, 0x82, 0x17, 0x5e, 0x89,
|
||||
0x4f, 0xe0, 0xf3, 0x78, 0x39, 0xf0, 0xc6, 0x4b, 0xd9, 0xde, 0xc0, 0x27, 0x90, 0x9c, 0x24, 0x6b,
|
||||
0x8a, 0xc3, 0xa1, 0x78, 0x53, 0x7a, 0xbe, 0x7c, 0xf9, 0x37, 0xff, 0xdf, 0xd7, 0x2f, 0x80, 0x29,
|
||||
0xa7, 0xc3, 0xe9, 0xe6, 0x50, 0x2a, 0x47, 0xb1, 0xc1, 0x24, 0x12, 0x4a, 0xe0, 0x3a, 0xe5, 0x74,
|
||||
0x30, 0xdd, 0x5c, 0xbb, 0xe4, 0x09, 0x19, 0x08, 0x39, 0x14, 0x51, 0x90, 0x5a, 0x44, 0x14, 0x64,
|
||||
0x86, 0xb5, 0xd5, 0xfc, 0xa6, 0x43, 0x16, 0x32, 0xc9, 0x65, 0xa6, 0xf6, 0xde, 0x1b, 0xd0, 0xde,
|
||||
0x89, 0xd5, 0x88, 0x85, 0x8a, 0x7b, 0x8e, 0xe2, 0x22, 0xc4, 0x1d, 0x30, 0x28, 0xa7, 0x04, 0x75,
|
||||
0x51, 0xbf, 0x61, 0xa5, 0x5f, 0xb1, 0x09, 0xe0, 0x89, 0x50, 0x45, 0xc2, 0xf7, 0x59, 0x44, 0x2a,
|
||||
0xfa, 0x42, 0x49, 0xc1, 0x04, 0x16, 0x65, 0xec, 0xbe, 0x61, 0x9e, 0x22, 0x86, 0xbe, 0x58, 0x1c,
|
||||
0xf1, 0x1d, 0x80, 0x49, 0xec, 0xfa, 0xdc, 0xb3, 0xc7, 0x2c, 0x21, 0xd5, 0x2e, 0xea, 0x37, 0xb7,
|
||||
0xda, 0x83, 0xec, 0x51, 0x07, 0xcf, 0x62, 0x77, 0x8f, 0x25, 0x56, 0x23, 0x73, 0xec, 0xb1, 0x04,
|
||||
0xaf, 0xc3, 0xb2, 0x17, 0x31, 0x9a, 0x3e, 0x8c, 0xe3, 0xdb, 0x9c, 0x92, 0x5a, 0x17, 0xf5, 0x5b,
|
||||
0x56, 0x6b, 0x26, 0x3e, 0xa5, 0xf8, 0x11, 0x2c, 0x05, 0x4c, 0x39, 0xd4, 0x51, 0x0e, 0xa9, 0x77,
|
||||
0x8d, 0x7e, 0x73, 0xeb, 0x7a, 0x31, 0x71, 0x7e, 0x93, 0xc1, 0x7e, 0x6e, 0x7b, 0x12, 0xaa, 0x28,
|
||||
0xb1, 0x4e, 0xef, 0xc2, 0x37, 0xa0, 0xed, 0x45, 0x4c, 0x7b, 0x6c, 0xd7, 0x17, 0xde, 0x98, 0x2c,
|
||||
0x76, 0x51, 0xdf, 0xb0, 0x96, 0x0b, 0x75, 0x37, 0x15, 0xd7, 0xee, 0xc3, 0xf2, 0xdc, 0x84, 0x94,
|
||||
0x4c, 0xba, 0x46, 0x4e, 0x66, 0xcc, 0x12, 0xbc, 0x0a, 0xb5, 0xa9, 0xe3, 0xc7, 0x2c, 0x87, 0x92,
|
||||
0x1d, 0xb6, 0x2b, 0xf7, 0xd0, 0xf6, 0xad, 0x9f, 0x5f, 0xbe, 0x7d, 0x32, 0xd6, 0xa1, 0xa6, 0x69,
|
||||
0x62, 0x02, 0x78, 0x06, 0x6c, 0x23, 0xc7, 0xd3, 0x41, 0x04, 0x11, 0xd4, 0xfb, 0x68, 0x00, 0x3c,
|
||||
0x9e, 0xd1, 0xbc, 0x08, 0xf5, 0x30, 0x0e, 0x5c, 0x16, 0xe9, 0x1f, 0xaa, 0x5a, 0xf9, 0xa9, 0xc8,
|
||||
0xa5, 0x32, 0xcb, 0xe5, 0x1a, 0xb4, 0xa4, 0x08, 0x23, 0xdb, 0xa1, 0x34, 0x62, 0x52, 0xe6, 0xf0,
|
||||
0x9b, 0xa9, 0xb6, 0x93, 0x49, 0xf8, 0x2a, 0x34, 0x99, 0x1a, 0x9d, 0x3a, 0xaa, 0x59, 0x76, 0x4c,
|
||||
0x8d, 0x4a, 0x06, 0x57, 0x79, 0xa7, 0x86, 0x5a, 0x66, 0x70, 0x95, 0x57, 0x18, 0xe6, 0x23, 0xac,
|
||||
0x9f, 0x17, 0xe1, 0x05, 0xa8, 0x8f, 0xa5, 0x3d, 0x75, 0x7c, 0xcd, 0xb4, 0x61, 0xd5, 0xc6, 0xf2,
|
||||
0xc0, 0xf1, 0x75, 0xb2, 0xbe, 0xc3, 0x03, 0x46, 0x73, 0xe2, 0x4b, 0x9a, 0x78, 0x2b, 0x17, 0x35,
|
||||
0xf0, 0x33, 0x72, 0x69, 0x9c, 0x91, 0xcb, 0xf6, 0x4b, 0x8d, 0xf6, 0x39, 0x40, 0x01, 0xaa, 0x83,
|
||||
0x30, 0x9e, 0x47, 0x91, 0x92, 0xc5, 0x2b, 0x73, 0xbb, 0x77, 0x2a, 0x99, 0x54, 0xda, 0xb6, 0x63,
|
||||
0x10, 0x84, 0x1b, 0x1a, 0x6b, 0xa7, 0x4a, 0x10, 0xa9, 0xf4, 0x3e, 0x54, 0xa1, 0x75, 0xc0, 0x22,
|
||||
0xfe, 0xfa, 0xdf, 0xcb, 0x70, 0x05, 0x80, 0x72, 0x6a, 0x07, 0x4c, 0x8d, 0x04, 0xcd, 0x23, 0x69,
|
||||
0x50, 0x4e, 0xf7, 0xb5, 0x90, 0xa6, 0xcb, 0xa5, 0x8c, 0x59, 0x94, 0x67, 0x91, 0x9f, 0xca, 0x1d,
|
||||
0xaa, 0xfd, 0xa9, 0x43, 0xe7, 0x06, 0x70, 0x1b, 0x56, 0xa6, 0xa5, 0x0d, 0x6c, 0x95, 0x4c, 0x58,
|
||||
0x9e, 0x45, 0xa7, 0x7c, 0xe1, 0x45, 0x32, 0x61, 0xf8, 0x61, 0xa9, 0x4b, 0x4b, 0xba, 0x4b, 0xbd,
|
||||
0x62, 0x72, 0x19, 0xc3, 0x5f, 0x34, 0xa9, 0xf1, 0xdf, 0x9b, 0xf4, 0x56, 0xc7, 0x3d, 0x2e, 0x9a,
|
||||
0xb4, 0x0a, 0xed, 0x0c, 0x59, 0xb9, 0x45, 0xb8, 0x07, 0x97, 0x4b, 0xfd, 0x9a, 0x05, 0xb0, 0x91,
|
||||
0x79, 0x75, 0xf8, 0x37, 0xa1, 0xfb, 0x1b, 0x99, 0x62, 0x48, 0xe1, 0x33, 0x08, 0x22, 0xd5, 0xdd,
|
||||
0x07, 0x5f, 0x8f, 0x4d, 0x74, 0x74, 0x6c, 0xa2, 0x1f, 0xc7, 0x26, 0xfa, 0x7c, 0x62, 0x2e, 0x1c,
|
||||
0x9d, 0x98, 0x0b, 0xdf, 0x4f, 0xcc, 0x85, 0x57, 0xbd, 0x43, 0xae, 0x46, 0xb1, 0x3b, 0xf0, 0x44,
|
||||
0x30, 0x14, 0x61, 0xfa, 0x97, 0x1b, 0xea, 0x8f, 0x77, 0xc3, 0xf4, 0xf5, 0x9a, 0x4e, 0x94, 0x6e,
|
||||
0x5d, 0xbf, 0x5a, 0xef, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x91, 0xe2, 0xb2, 0x85, 0xa7, 0x05,
|
||||
0x00, 0x00,
|
||||
// 745 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95, 0xc1, 0x6e, 0xd3, 0x48,
|
||||
0x18, 0xc7, 0x3b, 0x71, 0x92, 0xd6, 0x5f, 0xd2, 0xc8, 0x1d, 0x75, 0x77, 0x47, 0xd5, 0x6e, 0x36,
|
||||
0x9b, 0xee, 0xae, 0xb2, 0xda, 0x6e, 0xa2, 0x76, 0x2f, 0xa8, 0xa0, 0x8a, 0x14, 0x38, 0xa0, 0xaa,
|
||||
0x12, 0x32, 0xa8, 0x12, 0x5c, 0xa2, 0xb1, 0x67, 0x68, 0x4c, 0x6c, 0x4f, 0xf0, 0x8c, 0x23, 0x72,
|
||||
0x44, 0x02, 0x89, 0x13, 0xe2, 0x09, 0x78, 0x1e, 0x8e, 0x95, 0xb8, 0x70, 0x44, 0xed, 0x1b, 0xf0,
|
||||
0x04, 0xc8, 0x63, 0x3b, 0x71, 0xa0, 0xa2, 0x50, 0x21, 0x71, 0x89, 0x32, 0x7f, 0xff, 0xfd, 0x79,
|
||||
0xbe, 0xff, 0xcf, 0xdf, 0x18, 0x30, 0xf3, 0x58, 0x6f, 0xb2, 0xdd, 0x93, 0x8a, 0x2a, 0xde, 0x1d,
|
||||
0x47, 0x42, 0x09, 0x5c, 0x65, 0x1e, 0xeb, 0x4e, 0xb6, 0x37, 0x7e, 0x71, 0x85, 0x0c, 0x84, 0xec,
|
||||
0x89, 0x28, 0x48, 0x2c, 0x22, 0x0a, 0x52, 0xc3, 0xc6, 0x7a, 0x76, 0xd3, 0x31, 0x0f, 0xb9, 0xf4,
|
||||
0x64, 0xaa, 0xb6, 0x9f, 0x1b, 0x60, 0xf6, 0xa5, 0xe4, 0x91, 0xf2, 0x44, 0x88, 0x2d, 0x30, 0x98,
|
||||
0xc7, 0x08, 0x6a, 0xa1, 0x8e, 0x69, 0x27, 0x7f, 0x71, 0x13, 0xc0, 0x15, 0xa1, 0x8a, 0x84, 0xef,
|
||||
0xf3, 0x88, 0x94, 0xf4, 0x85, 0x82, 0x82, 0x09, 0x2c, 0xcb, 0xd8, 0x79, 0xc4, 0x5d, 0x45, 0x0c,
|
||||
0x7d, 0x31, 0x5f, 0xe2, 0xff, 0x00, 0xc6, 0xb1, 0xe3, 0x7b, 0xee, 0x60, 0xc4, 0xa7, 0xa4, 0xdc,
|
||||
0x42, 0x9d, 0xda, 0x4e, 0xa3, 0x9b, 0xee, 0xb2, 0x7b, 0x27, 0x76, 0x0e, 0xf8, 0xd4, 0x36, 0x53,
|
||||
0xc7, 0x01, 0x9f, 0xe2, 0xbf, 0xa0, 0x41, 0xf3, 0x7d, 0x0c, 0xd4, 0x74, 0xcc, 0x49, 0x45, 0xd7,
|
||||
0x5b, 0x9d, 0xa9, 0xf7, 0xa6, 0x63, 0x8e, 0x6f, 0x42, 0x8d, 0xba, 0x6e, 0x1c, 0xc4, 0x3e, 0x55,
|
||||
0x22, 0x22, 0xd5, 0x96, 0xd1, 0xa9, 0xed, 0xb4, 0xf3, 0xb2, 0xb3, 0x4e, 0xba, 0xfd, 0xb9, 0xe9,
|
||||
0x56, 0xa8, 0xa2, 0xa9, 0x5d, 0xbc, 0x2d, 0x79, 0x98, 0x1b, 0x71, 0xaa, 0x9f, 0xe5, 0xf8, 0xc2,
|
||||
0x1d, 0x91, 0xe5, 0x16, 0xea, 0x18, 0xf6, 0x6a, 0xae, 0xee, 0x27, 0xe2, 0xc6, 0x1e, 0x58, 0x9f,
|
||||
0xd6, 0x49, 0x22, 0x4a, 0xfa, 0xc9, 0x22, 0x1a, 0xf1, 0x29, 0x5e, 0x87, 0xca, 0x84, 0xfa, 0x31,
|
||||
0xd7, 0xe9, 0xd4, 0xed, 0x74, 0xb1, 0x5b, 0xba, 0x82, 0x76, 0xff, 0xf9, 0xf0, 0xfa, 0xed, 0x4b,
|
||||
0x63, 0x13, 0x2a, 0x3a, 0x56, 0x4c, 0x00, 0xcf, 0x93, 0xdb, 0xca, 0x72, 0xb2, 0x10, 0x41, 0x04,
|
||||
0xb5, 0x9f, 0x1a, 0xd0, 0xe8, 0xc7, 0x6a, 0xc8, 0x43, 0xe5, 0xb9, 0xf4, 0x47, 0xc3, 0xd8, 0x84,
|
||||
0x24, 0x09, 0x96, 0x6c, 0x86, 0xfa, 0x03, 0x8f, 0x69, 0x16, 0x75, 0xbb, 0x3e, 0x17, 0x6f, 0x33,
|
||||
0x7c, 0x1d, 0x56, 0x02, 0xae, 0x28, 0xa3, 0x8a, 0x66, 0x1c, 0xfe, 0x9c, 0x71, 0x58, 0xe8, 0xa4,
|
||||
0x7b, 0x98, 0xd9, 0x52, 0x12, 0xb3, 0xbb, 0xbe, 0x16, 0xc3, 0x55, 0x58, 0x5d, 0xa8, 0x70, 0x11,
|
||||
0x03, 0xf3, 0x52, 0x0c, 0x4a, 0xed, 0x17, 0x06, 0xc0, 0x8d, 0x79, 0x9a, 0x3f, 0x43, 0x35, 0x8c,
|
||||
0x03, 0x87, 0x47, 0xfa, 0x41, 0x65, 0x3b, 0x5b, 0xe5, 0x5c, 0x4a, 0x73, 0x2e, 0x7f, 0x40, 0x5d,
|
||||
0x8a, 0x30, 0x1a, 0x50, 0xc6, 0x22, 0x2e, 0x65, 0x16, 0x7e, 0x2d, 0xd1, 0xfa, 0xa9, 0x84, 0x7f,
|
||||
0x87, 0x1a, 0x57, 0xc3, 0x99, 0xa3, 0x9c, 0xb2, 0xe3, 0x6a, 0x58, 0x30, 0x38, 0xca, 0x9d, 0x19,
|
||||
0xd2, 0x97, 0x1f, 0x1c, 0xe5, 0xe6, 0x86, 0x45, 0x84, 0xd5, 0x8b, 0x10, 0xfe, 0x04, 0xd5, 0x91,
|
||||
0x1c, 0x4c, 0xa8, 0xaf, 0x33, 0x35, 0xed, 0xca, 0x48, 0x1e, 0x51, 0x5f, 0x93, 0xf5, 0xa9, 0x17,
|
||||
0x70, 0x96, 0x25, 0xbe, 0xa2, 0x13, 0xaf, 0x67, 0xa2, 0x0e, 0xfc, 0x1c, 0x2e, 0xe6, 0x39, 0x5c,
|
||||
0x76, 0xef, 0xeb, 0x68, 0xef, 0x02, 0xe4, 0x41, 0x59, 0x08, 0xe3, 0xc5, 0x28, 0x92, 0x64, 0xf1,
|
||||
0xda, 0x42, 0xef, 0x56, 0x29, 0x95, 0x0a, 0xdd, 0x5a, 0x06, 0x41, 0xd8, 0xd4, 0xb1, 0x5a, 0x65,
|
||||
0x82, 0x88, 0xd1, 0x7e, 0x56, 0x86, 0xfa, 0x11, 0x8f, 0xbc, 0x87, 0x97, 0x1f, 0x86, 0xdf, 0x00,
|
||||
0x98, 0xc7, 0x06, 0x01, 0x57, 0x43, 0xc1, 0x32, 0x24, 0x26, 0xf3, 0xd8, 0xa1, 0x16, 0x12, 0xba,
|
||||
0x9e, 0x94, 0x31, 0x8f, 0x32, 0x16, 0xd9, 0xaa, 0x38, 0x43, 0x95, 0x2f, 0xcd, 0xd0, 0x85, 0x00,
|
||||
0xfe, 0x85, 0xb5, 0x49, 0xa1, 0x83, 0xf4, 0x4c, 0x4b, 0x59, 0x58, 0xc5, 0x0b, 0xfa, 0x58, 0xdb,
|
||||
0x2b, 0xcc, 0xd2, 0xca, 0xe2, 0x99, 0x56, 0x8c, 0xe1, 0x1b, 0x26, 0xc9, 0xfc, 0xee, 0x93, 0xf4,
|
||||
0x58, 0xe3, 0x1e, 0xe5, 0x93, 0xb4, 0x0e, 0x8d, 0x34, 0xb2, 0xe2, 0x14, 0xe1, 0x36, 0xfc, 0x5a,
|
||||
0x98, 0xaf, 0x39, 0x80, 0xad, 0xd4, 0xab, 0xe1, 0xff, 0x0d, 0xad, 0xcf, 0x92, 0xc9, 0x8b, 0xe4,
|
||||
0x3e, 0x83, 0x20, 0x52, 0xde, 0xbf, 0xf6, 0xe6, 0xb4, 0x89, 0x4e, 0x4e, 0x9b, 0xe8, 0xfd, 0x69,
|
||||
0x13, 0xbd, 0x3a, 0x6b, 0x2e, 0x9d, 0x9c, 0x35, 0x97, 0xde, 0x9d, 0x35, 0x97, 0x1e, 0xb4, 0x8f,
|
||||
0x3d, 0x35, 0x8c, 0x9d, 0xae, 0x2b, 0x82, 0x9e, 0x08, 0x93, 0x57, 0xae, 0xa7, 0x7f, 0x9e, 0xf4,
|
||||
0x92, 0xcf, 0x5c, 0x52, 0x51, 0x3a, 0x55, 0xfd, 0x89, 0xfb, 0xff, 0x63, 0x00, 0x00, 0x00, 0xff,
|
||||
0xff, 0x4d, 0x8f, 0xef, 0xfc, 0x2f, 0x07, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Assertion) 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 *Assertion) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Assertion) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.CreationBlock != 0 {
|
||||
i = encodeVarintState(dAtA, i, uint64(m.CreationBlock))
|
||||
i--
|
||||
dAtA[i] = 0x38
|
||||
}
|
||||
if len(m.Accumulator) > 0 {
|
||||
for k := range m.Accumulator {
|
||||
v := m.Accumulator[k]
|
||||
baseI := i
|
||||
if len(v) > 0 {
|
||||
i -= len(v)
|
||||
copy(dAtA[i:], v)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(v)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
i -= len(k)
|
||||
copy(dAtA[i:], k)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(k)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
i = encodeVarintState(dAtA, i, uint64(baseI-i))
|
||||
i--
|
||||
dAtA[i] = 0x32
|
||||
}
|
||||
}
|
||||
if len(m.AssertionType) > 0 {
|
||||
i -= len(m.AssertionType)
|
||||
copy(dAtA[i:], m.AssertionType)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.AssertionType)))
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if m.PublicKey != nil {
|
||||
{
|
||||
size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintState(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Subject) > 0 {
|
||||
i -= len(m.Subject)
|
||||
copy(dAtA[i:], m.Subject)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Controller) > 0 {
|
||||
i -= len(m.Controller)
|
||||
copy(dAtA[i:], m.Controller)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Controller)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Did) > 0 {
|
||||
i -= len(m.Did)
|
||||
copy(dAtA[i:], m.Did)
|
||||
i = encodeVarintState(dAtA, i, uint64(len(m.Did)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Authentication) Marshal() (dAtA []byte, err error) {
|
||||
@@ -699,6 +893,50 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int {
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
func (m *Assertion) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Did)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Controller)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.Subject)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if m.PublicKey != nil {
|
||||
l = m.PublicKey.Size()
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
l = len(m.AssertionType)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovState(uint64(l))
|
||||
}
|
||||
if len(m.Accumulator) > 0 {
|
||||
for k, v := range m.Accumulator {
|
||||
_ = k
|
||||
_ = v
|
||||
l = 0
|
||||
if len(v) > 0 {
|
||||
l = 1 + len(v) + sovState(uint64(len(v)))
|
||||
}
|
||||
mapEntrySize := 1 + len(k) + sovState(uint64(len(k))) + l
|
||||
n += mapEntrySize + 1 + sovState(uint64(mapEntrySize))
|
||||
}
|
||||
}
|
||||
if m.CreationBlock != 0 {
|
||||
n += 1 + sovState(uint64(m.CreationBlock))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Authentication) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
@@ -835,6 +1073,367 @@ func sovState(x uint64) (n int) {
|
||||
func sozState(x uint64) (n int) {
|
||||
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *Assertion) 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: Assertion: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Assertion: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Did", 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.Did = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Controller", 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.Controller = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Subject", 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.Subject = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.PublicKey == nil {
|
||||
m.PublicKey = &PubKey{}
|
||||
}
|
||||
if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AssertionType", 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.AssertionType = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Accumulator", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Accumulator == nil {
|
||||
m.Accumulator = make(map[string][]byte)
|
||||
}
|
||||
var mapkey string
|
||||
mapvalue := []byte{}
|
||||
for iNdEx < postIndex {
|
||||
entryPreIndex := 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)
|
||||
if fieldNum == 1 {
|
||||
var stringLenmapkey uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLenmapkey |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLenmapkey := int(stringLenmapkey)
|
||||
if intStringLenmapkey < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
||||
if postStringIndexmapkey < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postStringIndexmapkey > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
|
||||
iNdEx = postStringIndexmapkey
|
||||
} else if fieldNum == 2 {
|
||||
var mapbyteLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
mapbyteLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intMapbyteLen := int(mapbyteLen)
|
||||
if intMapbyteLen < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
postbytesIndex := iNdEx + intMapbyteLen
|
||||
if postbytesIndex < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if postbytesIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
mapvalue = make([]byte, mapbyteLen)
|
||||
copy(mapvalue, dAtA[iNdEx:postbytesIndex])
|
||||
iNdEx = postbytesIndex
|
||||
} else {
|
||||
iNdEx = entryPreIndex
|
||||
skippy, err := skipState(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthState
|
||||
}
|
||||
if (iNdEx + skippy) > postIndex {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
m.Accumulator[mapkey] = mapvalue
|
||||
iNdEx = postIndex
|
||||
case 7:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field CreationBlock", wireType)
|
||||
}
|
||||
m.CreationBlock = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowState
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.CreationBlock |= int64(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 *Authentication) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
+2079
-217
File diff suppressed because it is too large
Load Diff
@@ -3,13 +3,39 @@ package keeper
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/onsonr/sonr/internal/ctx"
|
||||
didtypes "github.com/onsonr/sonr/x/did/types"
|
||||
"gopkg.in/macaroon.v2"
|
||||
)
|
||||
|
||||
// IssueMacaroon creates a macaroon with the specified parameters.
|
||||
func (k Keeper) IssueMacaroon(ctx sdk.Context, sharedMPCPubKey, location, id string, blockExpiry uint64) (*macaroon.Macaroon, error) {
|
||||
var fourYears = time.Hour * 24 * 365 * 4
|
||||
|
||||
// IssueAdminMacaroon creates a macaroon with the specified parameters.
|
||||
func (k Keeper) IssueAdminMacaroon(sdkctx sdk.Context, controller didtypes.ControllerI) (*macaroon.Macaroon, error) {
|
||||
sctx := ctx.GetSonrCTX(sdkctx)
|
||||
// Derive the root key by hashing the shared MPC public key
|
||||
rootKey := sha256.Sum256([]byte(controller.PublicKey()))
|
||||
// Create the macaroon
|
||||
m, err := macaroon.New(rootKey[:], []byte(controller.SonrAddress()), controller.ChainID(), macaroon.LatestVersion)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Add the block expiry caveat
|
||||
caveat := fmt.Sprintf("block-expiry=%d", sctx.GetBlockExpiration(fourYears))
|
||||
err = m.AddFirstPartyCaveat([]byte(caveat))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// IssueServiceMacaroon creates a macaroon with the specified parameters.
|
||||
func (k Keeper) IssueServiceMacaroon(sdkctx sdk.Context, sharedMPCPubKey, location, id string, blockExpiry uint64) (*macaroon.Macaroon, error) {
|
||||
// Derive the root key by hashing the shared MPC public key
|
||||
rootKey := sha256.Sum256([]byte(sharedMPCPubKey))
|
||||
// Create the macaroon
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
OriginMacroonCaveat MacroonCaveat = "origin"
|
||||
ScopesMacroonCaveat MacroonCaveat = "scopes"
|
||||
SubjectMacroonCaveat MacroonCaveat = "subject"
|
||||
ExpMacroonCaveat MacroonCaveat = "exp"
|
||||
TokenMacroonCaveat MacroonCaveat = "token"
|
||||
)
|
||||
|
||||
var MacroonCaveats = []MacroonCaveat{OriginMacroonCaveat, ScopesMacroonCaveat, SubjectMacroonCaveat, ExpMacroonCaveat, TokenMacroonCaveat}
|
||||
|
||||
type MacroonCaveat string
|
||||
|
||||
func (c MacroonCaveat) Equal(other string) bool {
|
||||
return string(c) == other
|
||||
}
|
||||
|
||||
func (c MacroonCaveat) String() string {
|
||||
return string(c)
|
||||
}
|
||||
|
||||
func (c MacroonCaveat) Verify(value string) error {
|
||||
switch c {
|
||||
case OriginMacroonCaveat:
|
||||
return nil
|
||||
case ScopesMacroonCaveat:
|
||||
return nil
|
||||
case SubjectMacroonCaveat:
|
||||
return nil
|
||||
case ExpMacroonCaveat:
|
||||
// Check if the expiration time is still valid
|
||||
exp, err := time.Parse(time.RFC3339, value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if time.Now().After(exp) {
|
||||
return fmt.Errorf("expired")
|
||||
}
|
||||
return nil
|
||||
case TokenMacroonCaveat:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("unknown caveat: %s", c)
|
||||
}
|
||||
}
|
||||
+352
-59
@@ -242,8 +242,8 @@ func (m *Scopes) GetSupported() []string {
|
||||
|
||||
// Caveats defines the available caveats
|
||||
type Caveats struct {
|
||||
SupportedFirstParty []string `protobuf:"bytes,1,rep,name=supported_first_party,json=supportedFirstParty,proto3" json:"supported_first_party,omitempty"`
|
||||
SupportedThirdParty []string `protobuf:"bytes,2,rep,name=supported_third_party,json=supportedThirdParty,proto3" json:"supported_third_party,omitempty"`
|
||||
SupportedFirstParty []*Caveat `protobuf:"bytes,1,rep,name=supported_first_party,json=supportedFirstParty,proto3" json:"supported_first_party,omitempty"`
|
||||
SupportedThirdParty []*Caveat `protobuf:"bytes,2,rep,name=supported_third_party,json=supportedThirdParty,proto3" json:"supported_third_party,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Caveats) Reset() { *m = Caveats{} }
|
||||
@@ -279,14 +279,14 @@ func (m *Caveats) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_Caveats proto.InternalMessageInfo
|
||||
|
||||
func (m *Caveats) GetSupportedFirstParty() []string {
|
||||
func (m *Caveats) GetSupportedFirstParty() []*Caveat {
|
||||
if m != nil {
|
||||
return m.SupportedFirstParty
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Caveats) GetSupportedThirdParty() []string {
|
||||
func (m *Caveats) GetSupportedThirdParty() []*Caveat {
|
||||
if m != nil {
|
||||
return m.SupportedThirdParty
|
||||
}
|
||||
@@ -347,6 +347,66 @@ func (m *Transactions) GetDenylist() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
type Caveat struct {
|
||||
Scopes []string `protobuf:"bytes,1,rep,name=scopes,proto3" json:"scopes,omitempty"`
|
||||
Caveat string `protobuf:"bytes,2,opt,name=caveat,proto3" json:"caveat,omitempty"`
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Caveat) Reset() { *m = Caveat{} }
|
||||
func (m *Caveat) String() string { return proto.CompactTextString(m) }
|
||||
func (*Caveat) ProtoMessage() {}
|
||||
func (*Caveat) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_06e0b5dfdf5e52ba, []int{6}
|
||||
}
|
||||
func (m *Caveat) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Caveat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Caveat.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 *Caveat) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Caveat.Merge(m, src)
|
||||
}
|
||||
func (m *Caveat) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Caveat) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Caveat.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Caveat proto.InternalMessageInfo
|
||||
|
||||
func (m *Caveat) GetScopes() []string {
|
||||
if m != nil {
|
||||
return m.Scopes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Caveat) GetCaveat() string {
|
||||
if m != nil {
|
||||
return m.Caveat
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Caveat) GetDescription() string {
|
||||
if m != nil {
|
||||
return m.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*GenesisState)(nil), "macaroon.v1.GenesisState")
|
||||
proto.RegisterType((*Params)(nil), "macaroon.v1.Params")
|
||||
@@ -354,42 +414,46 @@ func init() {
|
||||
proto.RegisterType((*Scopes)(nil), "macaroon.v1.Scopes")
|
||||
proto.RegisterType((*Caveats)(nil), "macaroon.v1.Caveats")
|
||||
proto.RegisterType((*Transactions)(nil), "macaroon.v1.Transactions")
|
||||
proto.RegisterType((*Caveat)(nil), "macaroon.v1.Caveat")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("macaroon/v1/genesis.proto", fileDescriptor_06e0b5dfdf5e52ba) }
|
||||
|
||||
var fileDescriptor_06e0b5dfdf5e52ba = []byte{
|
||||
// 470 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x6a, 0xdb, 0x30,
|
||||
0x18, 0xc7, 0xad, 0xb4, 0x38, 0x8b, 0x5a, 0xe8, 0xa6, 0xb6, 0xe0, 0x86, 0xe2, 0x14, 0x5f, 0x56,
|
||||
0x36, 0xb0, 0x49, 0x77, 0xcb, 0xad, 0x1d, 0x6c, 0xa7, 0x41, 0x71, 0x73, 0x1a, 0x83, 0xa2, 0xd8,
|
||||
0xaa, 0x2d, 0xb0, 0x25, 0x23, 0x29, 0x59, 0xf3, 0x0a, 0x63, 0x87, 0x1d, 0x77, 0xec, 0x23, 0x0c,
|
||||
0xf6, 0x12, 0x3d, 0xf6, 0xb8, 0xd3, 0x18, 0xc9, 0x61, 0x7b, 0x8c, 0x61, 0x49, 0x76, 0xda, 0x2d,
|
||||
0xd0, 0x8b, 0x91, 0xbe, 0xdf, 0xf7, 0xff, 0x7f, 0xff, 0x4f, 0x18, 0x1e, 0x94, 0x38, 0xc1, 0x82,
|
||||
0x73, 0x16, 0xcd, 0x86, 0x51, 0x46, 0x18, 0x91, 0x54, 0x86, 0x95, 0xe0, 0x8a, 0xa3, 0xad, 0x06,
|
||||
0x85, 0xb3, 0x61, 0xff, 0x19, 0x2e, 0x29, 0xe3, 0x91, 0xfe, 0x1a, 0xde, 0xdf, 0xcb, 0x78, 0xc6,
|
||||
0xf5, 0x31, 0xaa, 0x4f, 0xb6, 0xba, 0x93, 0xd2, 0xb4, 0xf6, 0x52, 0xd7, 0xa6, 0x10, 0x9c, 0xc2,
|
||||
0xed, 0xb7, 0xc6, 0xf7, 0x42, 0x61, 0x45, 0xd0, 0x10, 0xba, 0x15, 0x16, 0xb8, 0x94, 0x1e, 0x38,
|
||||
0x02, 0xc7, 0x5b, 0x27, 0xbb, 0xe1, 0xbd, 0x39, 0xe1, 0xb9, 0x46, 0x67, 0x9b, 0xb7, 0x3f, 0x07,
|
||||
0x4e, 0x6c, 0x1b, 0x83, 0xef, 0x00, 0xba, 0x06, 0xa0, 0x10, 0x76, 0x4b, 0xa2, 0x72, 0x9e, 0x36,
|
||||
0xf2, 0xbd, 0x07, 0xf2, 0x77, 0x86, 0xc5, 0x4d, 0x13, 0x7a, 0x09, 0x5d, 0x99, 0xf0, 0x8a, 0x48,
|
||||
0xaf, 0xb3, 0x66, 0xda, 0x85, 0x46, 0xb1, 0x6d, 0xa9, 0xcd, 0x13, 0x3c, 0x23, 0x58, 0x49, 0x6f,
|
||||
0x63, 0x8d, 0xf9, 0x6b, 0xc3, 0xe2, 0xa6, 0x69, 0x74, 0xf8, 0xf5, 0x66, 0xe0, 0xfc, 0xb9, 0x19,
|
||||
0x80, 0x4f, 0xbf, 0xbf, 0xbd, 0xd8, 0x69, 0x5f, 0xd2, 0xa6, 0xfe, 0x00, 0xbb, 0x36, 0x0e, 0xf2,
|
||||
0x60, 0x37, 0x25, 0x57, 0x78, 0x5a, 0x28, 0x9d, 0xba, 0x17, 0x37, 0x57, 0x74, 0x08, 0x7b, 0x72,
|
||||
0x5a, 0x55, 0x5c, 0x28, 0x92, 0x7a, 0x9d, 0xa3, 0x8d, 0xe3, 0x5e, 0xbc, 0x2a, 0x8c, 0x0e, 0x1a,
|
||||
0xf3, 0xa7, 0xad, 0xb9, 0x5d, 0x2c, 0x18, 0x43, 0xd7, 0xa4, 0x47, 0x08, 0x6e, 0x4e, 0xb0, 0x24,
|
||||
0xd6, 0x59, 0x9f, 0x1f, 0xb1, 0xf5, 0xfe, 0xcf, 0x6c, 0x5e, 0x20, 0xf8, 0x0c, 0x60, 0xd7, 0xae,
|
||||
0x89, 0x4e, 0xe0, 0x7e, 0x2b, 0xb9, 0xbc, 0xa2, 0x42, 0xaa, 0xcb, 0x0a, 0x0b, 0x35, 0xf7, 0x80,
|
||||
0xf6, 0xdb, 0x6d, 0xe1, 0x9b, 0x9a, 0x9d, 0xd7, 0xe8, 0xa1, 0x46, 0xe5, 0x54, 0xa4, 0x56, 0xd3,
|
||||
0xf9, 0x47, 0x33, 0xae, 0x99, 0xd6, 0xac, 0x5b, 0xd2, 0x3e, 0x70, 0x90, 0xc3, 0xed, 0xb1, 0xc0,
|
||||
0x4c, 0xe2, 0x44, 0x51, 0xce, 0x64, 0xbd, 0x16, 0x2e, 0x0a, 0xfe, 0xb1, 0xa0, 0x52, 0xd9, 0x18,
|
||||
0xab, 0x02, 0xea, 0xc3, 0x27, 0x29, 0x61, 0x73, 0x0d, 0xcd, 0xbc, 0xf6, 0x3e, 0xf2, 0x9b, 0x21,
|
||||
0xfb, 0xed, 0x10, 0x75, 0xcf, 0xf9, 0xec, 0xf4, 0x76, 0xe1, 0x83, 0xbb, 0x85, 0x0f, 0x7e, 0x2d,
|
||||
0x7c, 0xf0, 0x65, 0xe9, 0x3b, 0x77, 0x4b, 0xdf, 0xf9, 0xb1, 0xf4, 0x9d, 0xf7, 0xcf, 0x33, 0xaa,
|
||||
0xf2, 0xe9, 0x24, 0x4c, 0x78, 0x19, 0x71, 0x26, 0x39, 0x13, 0x91, 0xfe, 0x5c, 0x47, 0x2b, 0xa7,
|
||||
0x79, 0x45, 0xe4, 0xc4, 0xd5, 0xff, 0xfb, 0xab, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x19, 0xb5,
|
||||
0x2c, 0xe7, 0x53, 0x03, 0x00, 0x00,
|
||||
// 517 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x6a, 0xdb, 0x40,
|
||||
0x10, 0xb6, 0xec, 0x20, 0x57, 0xe3, 0x40, 0xda, 0xcd, 0x0f, 0x8a, 0x09, 0xb2, 0xd1, 0xa5, 0xa1,
|
||||
0x05, 0x09, 0xb7, 0x37, 0xdf, 0x92, 0x42, 0x73, 0x2a, 0x84, 0x8d, 0x4f, 0xa1, 0x10, 0xd6, 0xd2,
|
||||
0xc6, 0x16, 0x58, 0x5a, 0xb1, 0xbb, 0x76, 0xe3, 0x57, 0xe8, 0xa9, 0xc7, 0x1e, 0xf3, 0x08, 0x85,
|
||||
0x42, 0x9f, 0x21, 0xc7, 0x1c, 0x7b, 0x2a, 0xc5, 0x3e, 0xb4, 0x8f, 0x51, 0xb4, 0xbb, 0x92, 0x1d,
|
||||
0x62, 0x68, 0x2e, 0xcb, 0xce, 0x7c, 0xf3, 0x7d, 0xf3, 0xed, 0x68, 0x04, 0x87, 0x29, 0x89, 0x08,
|
||||
0x67, 0x2c, 0x0b, 0x67, 0xbd, 0x70, 0x44, 0x33, 0x2a, 0x12, 0x11, 0xe4, 0x9c, 0x49, 0x86, 0x5a,
|
||||
0x25, 0x14, 0xcc, 0x7a, 0xed, 0x17, 0x24, 0x4d, 0x32, 0x16, 0xaa, 0x53, 0xe3, 0xed, 0x9d, 0x38,
|
||||
0x89, 0x0b, 0x96, 0xbc, 0x31, 0x89, 0xbd, 0x11, 0x1b, 0x31, 0x75, 0x0d, 0x8b, 0x9b, 0xce, 0xfa,
|
||||
0x27, 0xb0, 0x7d, 0xa6, 0x75, 0x2f, 0x24, 0x91, 0x14, 0xf5, 0xc0, 0xce, 0x09, 0x27, 0xa9, 0x70,
|
||||
0xad, 0xae, 0x75, 0xdc, 0x7a, 0xb3, 0x1b, 0xac, 0xf5, 0x09, 0xce, 0x15, 0x74, 0xba, 0x75, 0xf7,
|
||||
0xab, 0x53, 0xc3, 0xa6, 0xd0, 0xff, 0x6e, 0x81, 0xad, 0x01, 0x14, 0x40, 0x33, 0xa5, 0x72, 0xcc,
|
||||
0xe2, 0x92, 0xbe, 0xf7, 0x80, 0xfe, 0x41, 0x63, 0xb8, 0x2c, 0x42, 0xaf, 0xc1, 0x16, 0x11, 0xcb,
|
||||
0xa9, 0x70, 0xeb, 0x1b, 0xba, 0x5d, 0x28, 0x08, 0x9b, 0x92, 0x42, 0x3c, 0x22, 0x33, 0x4a, 0xa4,
|
||||
0x70, 0x1b, 0x1b, 0xc4, 0xdf, 0x69, 0x0c, 0x97, 0x45, 0xfd, 0xa3, 0xaf, 0xb7, 0x9d, 0xda, 0xdf,
|
||||
0xdb, 0x8e, 0xf5, 0xf9, 0xcf, 0xb7, 0x57, 0x3b, 0xd5, 0x24, 0x8d, 0xeb, 0x8f, 0xd0, 0x34, 0x76,
|
||||
0x90, 0x0b, 0xcd, 0x98, 0x5e, 0x93, 0xe9, 0x44, 0x2a, 0xd7, 0x0e, 0x2e, 0x43, 0x74, 0x04, 0x8e,
|
||||
0x98, 0xe6, 0x39, 0xe3, 0x92, 0xc6, 0x6e, 0xbd, 0xdb, 0x38, 0x76, 0xf0, 0x2a, 0xd1, 0x3f, 0x2c,
|
||||
0xc5, 0x9f, 0x57, 0xe2, 0xe6, 0x61, 0xfe, 0x00, 0x6c, 0xed, 0x1e, 0x21, 0xd8, 0x1a, 0x12, 0x41,
|
||||
0x8d, 0xb2, 0xba, 0xff, 0x47, 0xd6, 0x7d, 0xec, 0x59, 0x4f, 0xc0, 0xff, 0x61, 0x41, 0xd3, 0x3c,
|
||||
0x13, 0x9d, 0xc1, 0x7e, 0x45, 0xb9, 0xba, 0x4e, 0xb8, 0x90, 0x57, 0x39, 0xe1, 0x72, 0xee, 0x5a,
|
||||
0xdd, 0xc6, 0xa3, 0x49, 0x6a, 0x12, 0xde, 0xad, 0x18, 0xef, 0x0b, 0xc2, 0x79, 0x51, 0xff, 0x50,
|
||||
0x48, 0x8e, 0x13, 0x1e, 0x1b, 0xa1, 0xfa, 0x53, 0x84, 0x06, 0x05, 0x41, 0x09, 0x6d, 0x1a, 0x87,
|
||||
0xf9, 0x14, 0xfe, 0x18, 0xb6, 0x07, 0x9c, 0x64, 0x82, 0x44, 0x32, 0x61, 0x99, 0x28, 0x06, 0x40,
|
||||
0x26, 0x13, 0xf6, 0x69, 0x92, 0x08, 0xa9, 0x0c, 0x3b, 0x78, 0x95, 0x40, 0x6d, 0x78, 0x16, 0xd3,
|
||||
0x6c, 0xae, 0x40, 0x3d, 0x9d, 0x2a, 0xee, 0x7b, 0x65, 0x93, 0xfd, 0xaa, 0x89, 0x5c, 0x53, 0xf6,
|
||||
0x2f, 0xc1, 0xd6, 0x1e, 0xd1, 0x41, 0xb5, 0x5b, 0xba, 0x41, 0xb9, 0x46, 0x07, 0x60, 0x6b, 0x5b,
|
||||
0x6a, 0xe7, 0x1c, 0x6c, 0x22, 0xd4, 0x85, 0x56, 0x4c, 0x45, 0xc4, 0x93, 0xbc, 0x50, 0x52, 0x2b,
|
||||
0xe6, 0xe0, 0xf5, 0xd4, 0xe9, 0xc9, 0xdd, 0xc2, 0xb3, 0xee, 0x17, 0x9e, 0xf5, 0x7b, 0xe1, 0x59,
|
||||
0x5f, 0x96, 0x5e, 0xed, 0x7e, 0xe9, 0xd5, 0x7e, 0x2e, 0xbd, 0xda, 0xe5, 0xcb, 0x51, 0x22, 0xc7,
|
||||
0xd3, 0x61, 0x10, 0xb1, 0x34, 0x64, 0x99, 0x60, 0x19, 0x0f, 0xd5, 0x71, 0x13, 0xae, 0x5c, 0xce,
|
||||
0x73, 0x2a, 0x86, 0xb6, 0xfa, 0xeb, 0xde, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x50, 0xa1, 0x26,
|
||||
0x49, 0xd9, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *Params) Equal(that interface{}) bool {
|
||||
@@ -509,7 +573,7 @@ func (this *Caveats) Equal(that interface{}) bool {
|
||||
return false
|
||||
}
|
||||
for i := range this.SupportedFirstParty {
|
||||
if this.SupportedFirstParty[i] != that1.SupportedFirstParty[i] {
|
||||
if !this.SupportedFirstParty[i].Equal(that1.SupportedFirstParty[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -517,7 +581,7 @@ func (this *Caveats) Equal(that interface{}) bool {
|
||||
return false
|
||||
}
|
||||
for i := range this.SupportedThirdParty {
|
||||
if this.SupportedThirdParty[i] != that1.SupportedThirdParty[i] {
|
||||
if !this.SupportedThirdParty[i].Equal(that1.SupportedThirdParty[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -752,18 +816,28 @@ func (m *Caveats) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = l
|
||||
if len(m.SupportedThirdParty) > 0 {
|
||||
for iNdEx := len(m.SupportedThirdParty) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.SupportedThirdParty[iNdEx])
|
||||
copy(dAtA[i:], m.SupportedThirdParty[iNdEx])
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.SupportedThirdParty[iNdEx])))
|
||||
{
|
||||
size, err := m.SupportedThirdParty[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
}
|
||||
if len(m.SupportedFirstParty) > 0 {
|
||||
for iNdEx := len(m.SupportedFirstParty) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.SupportedFirstParty[iNdEx])
|
||||
copy(dAtA[i:], m.SupportedFirstParty[iNdEx])
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.SupportedFirstParty[iNdEx])))
|
||||
{
|
||||
size, err := m.SupportedFirstParty[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
@@ -812,6 +886,52 @@ func (m *Transactions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Caveat) 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 *Caveat) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Caveat) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
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.Caveat) > 0 {
|
||||
i -= len(m.Caveat)
|
||||
copy(dAtA[i:], m.Caveat)
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Caveat)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Scopes) > 0 {
|
||||
for iNdEx := len(m.Scopes) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.Scopes[iNdEx])
|
||||
copy(dAtA[i:], m.Scopes[iNdEx])
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(len(m.Scopes[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovGenesis(v)
|
||||
base := offset
|
||||
@@ -900,14 +1020,14 @@ func (m *Caveats) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.SupportedFirstParty) > 0 {
|
||||
for _, s := range m.SupportedFirstParty {
|
||||
l = len(s)
|
||||
for _, e := range m.SupportedFirstParty {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
}
|
||||
if len(m.SupportedThirdParty) > 0 {
|
||||
for _, s := range m.SupportedThirdParty {
|
||||
l = len(s)
|
||||
for _, e := range m.SupportedThirdParty {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
}
|
||||
@@ -935,6 +1055,29 @@ func (m *Transactions) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Caveat) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Scopes) > 0 {
|
||||
for _, s := range m.Scopes {
|
||||
l = len(s)
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
}
|
||||
l = len(m.Caveat)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
l = len(m.Description)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovGenesis(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -1443,7 +1586,7 @@ func (m *Caveats) Unmarshal(dAtA []byte) error {
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field SupportedFirstParty", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenesis
|
||||
@@ -1453,29 +1596,31 @@ func (m *Caveats) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.SupportedFirstParty = append(m.SupportedFirstParty, string(dAtA[iNdEx:postIndex]))
|
||||
m.SupportedFirstParty = append(m.SupportedFirstParty, &Caveat{})
|
||||
if err := m.SupportedFirstParty[len(m.SupportedFirstParty)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field SupportedThirdParty", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenesis
|
||||
@@ -1485,23 +1630,25 @@ func (m *Caveats) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.SupportedThirdParty = append(m.SupportedThirdParty, string(dAtA[iNdEx:postIndex]))
|
||||
m.SupportedThirdParty = append(m.SupportedThirdParty, &Caveat{})
|
||||
if err := m.SupportedThirdParty[len(m.SupportedThirdParty)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
@@ -1638,6 +1785,152 @@ func (m *Transactions) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Caveat) 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: Caveat: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Caveat: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Scopes", 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.Scopes = append(m.Scopes, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Caveat", 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.Caveat = 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
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipGenesis(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipGenesis(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
@@ -45,8 +45,67 @@ func DefaultScopes() *Scopes {
|
||||
func DefaultCaveats() *Caveats {
|
||||
return &Caveats{
|
||||
// First party - JWT Format
|
||||
SupportedFirstParty: []string{"aud", "exp", "iat", "iss", "nbf", "nonce", "sub"},
|
||||
SupportedFirstParty: DefaultFirstPartyCaveats(),
|
||||
// Third party - UCAN Format
|
||||
SupportedThirdParty: []string{"cap", "nbf", "exp", "att", "prf", "rmt", "sig", "ucv"},
|
||||
SupportedThirdParty: DefaultThirdPartyCaveats(),
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultFirstPartyCaveats() []*Caveat {
|
||||
return []*Caveat{
|
||||
{
|
||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
||||
Caveat: "aud",
|
||||
Description: "Audience must be a valid DID",
|
||||
},
|
||||
{
|
||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
||||
Caveat: "exp",
|
||||
Description: "Expiration time must be a valid timestamp",
|
||||
},
|
||||
{
|
||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
||||
Caveat: "iat",
|
||||
Description: "Issued at time must be a valid timestamp",
|
||||
},
|
||||
{
|
||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
||||
Caveat: "iss",
|
||||
Description: "Issuer must be a valid DID",
|
||||
},
|
||||
{
|
||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
||||
Caveat: "nbf",
|
||||
Description: "Not before time must be a valid timestamp",
|
||||
},
|
||||
{
|
||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
||||
Caveat: "nonce",
|
||||
Description: "Nonce must be a valid string",
|
||||
},
|
||||
{
|
||||
Scopes: []string{"openid", "profile", "sonr.address"},
|
||||
Caveat: "sub",
|
||||
Description: "Subject must be a valid DID",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultThirdPartyCaveats() []*Caveat {
|
||||
return []*Caveat{
|
||||
{
|
||||
Scopes: []string{"create", "read", "update", "delete", "sign", "verify", "simulate", "execute", "broadcast", "admin"},
|
||||
Caveat: "cap",
|
||||
Description: "Capability must be a valid capability",
|
||||
},
|
||||
{
|
||||
Scopes: []string{"create", "read", "update", "delete", "sign", "verify", "simulate", "execute", "broadcast", "admin"},
|
||||
Caveat: "exp",
|
||||
Description: "Expiration time must be a valid timestamp",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Caveat) Equal(other *Caveat) bool {
|
||||
return c.Caveat == other.Caveat
|
||||
}
|
||||
|
||||
@@ -5,13 +5,14 @@ import (
|
||||
"time"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/onsonr/sonr/internal/ctx"
|
||||
dwngen "github.com/onsonr/sonr/internal/dwn/gen"
|
||||
"github.com/onsonr/sonr/x/vault/types"
|
||||
)
|
||||
|
||||
// assembleVault assembles the initial vault
|
||||
func (k Keeper) AssembleVault(ctx sdk.Context) (string, int64, error) {
|
||||
_, con, err := k.DIDKeeper.NewController(ctx)
|
||||
func (k Keeper) AssembleVault(cotx sdk.Context) (string, int64, error) {
|
||||
_, con, err := k.DIDKeeper.NewController(cotx)
|
||||
if err != nil {
|
||||
return "", 0, err
|
||||
}
|
||||
@@ -19,7 +20,7 @@ func (k Keeper) AssembleVault(ctx sdk.Context) (string, int64, error) {
|
||||
if err != nil {
|
||||
return "", 0, err
|
||||
}
|
||||
sch, err := k.CurrentSchema(ctx)
|
||||
sch, err := k.CurrentSchema(cotx)
|
||||
if err != nil {
|
||||
return "", 0, err
|
||||
}
|
||||
@@ -31,7 +32,8 @@ func (k Keeper) AssembleVault(ctx sdk.Context) (string, int64, error) {
|
||||
if err != nil {
|
||||
return "", 0, err
|
||||
}
|
||||
return cid.String(), k.CalculateExpiration(ctx, time.Second*15), nil
|
||||
sctx := ctx.GetSonrCTX(cotx)
|
||||
return cid.String(), sctx.GetBlockExpiration(time.Second * 30), nil
|
||||
}
|
||||
|
||||
// currentSchema returns the current schema
|
||||
|
||||
@@ -2,7 +2,6 @@ package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/log"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
@@ -52,13 +51,6 @@ func (c Keeper) IPFSConnected() bool {
|
||||
return c.ipfsClient != nil
|
||||
}
|
||||
|
||||
// CalculateExpiration calculates the expiration time for a vault
|
||||
func (k Keeper) CalculateExpiration(c sdk.Context, duration time.Duration) int64 {
|
||||
blockTime := c.BlockTime()
|
||||
avgBlockTime := float64(blockTime.Sub(blockTime).Seconds())
|
||||
return int64(duration.Seconds() / avgBlockTime)
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
||||
@@ -29,12 +29,6 @@ func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*type
|
||||
return &types.QueryParamsResponse{Params: &p}, nil
|
||||
}
|
||||
|
||||
// Sync implements types.QueryServer.
|
||||
func (k Querier) Sync(goCtx context.Context, req *types.SyncRequest) (*types.SyncResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
return &types.SyncResponse{}, nil
|
||||
}
|
||||
|
||||
// Schema implements types.QueryServer.
|
||||
func (k Querier) Schema(goCtx context.Context, req *types.QuerySchemaRequest) (*types.QuerySchemaResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
@@ -47,3 +41,49 @@ func (k Querier) Schema(goCtx context.Context, req *types.QuerySchemaRequest) (*
|
||||
Schema: p.Schema,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// SyncInitial implements types.QueryServer.
|
||||
func (k Querier) SyncInitial(goCtx context.Context, req *types.SyncInitialRequest) (*types.SyncInitialResponse, 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.SyncInitialResponse{
|
||||
Success: false,
|
||||
Schema: p.Schema,
|
||||
ChainID: ctx.ChainID(),
|
||||
}, nil
|
||||
}
|
||||
return &types.SyncInitialResponse{
|
||||
Success: true,
|
||||
Schema: p.Schema,
|
||||
ChainID: ctx.ChainID(),
|
||||
Address: c.SonrAddress(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// SyncCurrent implements types.QueryServer.
|
||||
func (k Querier) SyncCurrent(goCtx context.Context, req *types.SyncCurrentRequest) (*types.SyncCurrentResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
return &types.SyncCurrentResponse{}, nil
|
||||
}
|
||||
|
||||
// Allocate implements types.QueryServer.
|
||||
func (k Querier) Allocate(goCtx context.Context, req *types.AllocateRequest) (*types.AllocateResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
|
||||
// 2.Allocate the vault msg.GetSubject(), msg.GetOrigin()
|
||||
cid, expiryBlock, err := k.AssembleVault(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &types.AllocateResponse{
|
||||
Success: true,
|
||||
Cid: cid,
|
||||
ExpiryBlock: expiryBlock,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -93,17 +93,6 @@ 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)
|
||||
}
|
||||
|
||||
+1415
-88
File diff suppressed because it is too large
Load Diff
+183
-17
@@ -70,37 +70,109 @@ func local_request_Query_Schema_0(ctx context.Context, marshaler runtime.Marshal
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Query_Sync_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
filter_Query_Allocate_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_Query_Sync_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SyncRequest
|
||||
func request_Query_Allocate_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq AllocateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sync_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Allocate_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.Sync(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
msg, err := client.Allocate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_Sync_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SyncRequest
|
||||
func local_request_Query_Allocate_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq AllocateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sync_0); err != nil {
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Allocate_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.Sync(ctx, &protoReq)
|
||||
msg, err := server.Allocate(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Query_SyncInitial_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_Query_SyncInitial_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SyncInitialRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SyncInitial_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SyncInitial(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_SyncInitial_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SyncInitialRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SyncInitial_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SyncInitial(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Query_SyncCurrent_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_Query_SyncCurrent_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SyncCurrentRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SyncCurrent_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.SyncCurrent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Query_SyncCurrent_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SyncCurrentRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SyncCurrent_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SyncCurrent(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
@@ -157,7 +229,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("POST", pattern_Query_Allocate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
@@ -168,7 +240,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Query_Sync_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
resp, md, err := local_request_Query_Allocate_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
@@ -176,7 +248,53 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_Sync_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_Query_Allocate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Query_SyncInitial_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Query_SyncInitial_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_SyncInitial_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Query_SyncCurrent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Query_SyncCurrent_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_SyncCurrent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
@@ -261,7 +379,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Query_Sync_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("POST", pattern_Query_Allocate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
@@ -270,14 +388,54 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Query_Sync_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_Query_Allocate_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_Sync_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
forward_Query_Allocate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Query_SyncInitial_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Query_SyncInitial_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_SyncInitial_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Query_SyncCurrent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Query_SyncCurrent_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Query_SyncCurrent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
@@ -289,7 +447,11 @@ var (
|
||||
|
||||
pattern_Query_Schema_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "schema"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Query_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "sync"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
pattern_Query_Allocate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "allocate"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Query_SyncInitial_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "sync-initial"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
|
||||
pattern_Query_SyncCurrent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"vault", "v1", "sync-current"}, "", runtime.AssumeColonVerbOpt(false)))
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -297,5 +459,9 @@ var (
|
||||
|
||||
forward_Query_Schema_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_Sync_0 = runtime.ForwardResponseMessage
|
||||
forward_Query_Allocate_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_SyncInitial_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Query_SyncCurrent_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
+387
-387
@@ -31,105 +31,6 @@ var _ = math.Inf
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
type MsgUpdateParams 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 (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}
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParams.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgUpdateParams) GetAuthority() string {
|
||||
if m != nil {
|
||||
return m.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) GetParams() Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return Params{}
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
// MsgUpdateParams message.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
type MsgUpdateParamsResponse struct {
|
||||
}
|
||||
|
||||
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}
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||
|
||||
// MsgAllocateVault is the message type for the AllocateVault RPC.
|
||||
type MsgAllocateVault struct {
|
||||
// authority is the address of the service account.
|
||||
@@ -144,7 +45,7 @@ func (m *MsgAllocateVault) Reset() { *m = MsgAllocateVault{} }
|
||||
func (m *MsgAllocateVault) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgAllocateVault) ProtoMessage() {}
|
||||
func (*MsgAllocateVault) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_311d0123a4881c5c, []int{2}
|
||||
return fileDescriptor_311d0123a4881c5c, []int{0}
|
||||
}
|
||||
func (m *MsgAllocateVault) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -211,7 +112,7 @@ func (m *MsgAllocateVaultResponse) Reset() { *m = MsgAllocateVaultRespon
|
||||
func (m *MsgAllocateVaultResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgAllocateVaultResponse) ProtoMessage() {}
|
||||
func (*MsgAllocateVaultResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_311d0123a4881c5c, []int{3}
|
||||
return fileDescriptor_311d0123a4881c5c, []int{1}
|
||||
}
|
||||
func (m *MsgAllocateVaultResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
@@ -268,48 +169,147 @@ func (m *MsgAllocateVaultResponse) GetLocalhost() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
type MsgUpdateParams 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 (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{2}
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParams.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgUpdateParams) GetAuthority() string {
|
||||
if m != nil {
|
||||
return m.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) GetParams() Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return Params{}
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
// MsgUpdateParams message.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
type MsgUpdateParamsResponse struct {
|
||||
}
|
||||
|
||||
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{3}
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "vault.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "vault.v1.MsgUpdateParamsResponse")
|
||||
proto.RegisterType((*MsgAllocateVault)(nil), "vault.v1.MsgAllocateVault")
|
||||
proto.RegisterType((*MsgAllocateVaultResponse)(nil), "vault.v1.MsgAllocateVaultResponse")
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "vault.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "vault.v1.MsgUpdateParamsResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("vault/v1/tx.proto", fileDescriptor_311d0123a4881c5c) }
|
||||
|
||||
var fileDescriptor_311d0123a4881c5c = []byte{
|
||||
// 492 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x4f, 0x6b, 0x13, 0x41,
|
||||
0x18, 0xc6, 0x33, 0x4d, 0x1b, 0x9b, 0x69, 0xd5, 0x38, 0x84, 0x76, 0xb3, 0x94, 0x35, 0x0d, 0x1e,
|
||||
0x42, 0xc1, 0x1d, 0x5a, 0xc1, 0x83, 0x07, 0xa1, 0x39, 0x1b, 0x90, 0x15, 0x3d, 0x78, 0x29, 0x93,
|
||||
0xcd, 0x30, 0x19, 0xb3, 0x3b, 0xef, 0xb2, 0x33, 0x09, 0xc9, 0x4d, 0xea, 0x49, 0xf0, 0x20, 0xf8,
|
||||
0x45, 0x7a, 0xf0, 0x3b, 0xd8, 0x63, 0xd1, 0x8b, 0x27, 0x91, 0x44, 0xe8, 0xd7, 0x90, 0xfd, 0x97,
|
||||
0x98, 0x48, 0x2f, 0xbd, 0x2c, 0xf3, 0x3e, 0xcf, 0x33, 0xef, 0xfb, 0xdb, 0xe1, 0xc5, 0x0f, 0xc6,
|
||||
0x6c, 0x14, 0x18, 0x3a, 0x3e, 0xa6, 0x66, 0xe2, 0x46, 0x31, 0x18, 0x20, 0xdb, 0xa9, 0xe4, 0x8e,
|
||||
0x8f, 0xed, 0x7d, 0x1f, 0x74, 0x08, 0x9a, 0x86, 0x5a, 0x24, 0x89, 0x50, 0x8b, 0x2c, 0x62, 0x37,
|
||||
0x32, 0xe3, 0x2c, 0xad, 0x68, 0x56, 0xe4, 0x56, 0x5d, 0x80, 0x80, 0x4c, 0x4f, 0x4e, 0xb9, 0x7a,
|
||||
0x20, 0x00, 0x44, 0xc0, 0x29, 0x8b, 0x24, 0x65, 0x4a, 0x81, 0x61, 0x46, 0x82, 0x2a, 0xee, 0xec,
|
||||
0x2d, 0x20, 0x04, 0x57, 0x5c, 0xcb, 0x5c, 0x6f, 0x7d, 0x44, 0xf8, 0x7e, 0x57, 0x8b, 0xd7, 0x51,
|
||||
0x9f, 0x19, 0xfe, 0x92, 0xc5, 0x2c, 0xd4, 0xe4, 0x29, 0xae, 0xb2, 0x91, 0x19, 0x40, 0x2c, 0xcd,
|
||||
0xd4, 0x42, 0x4d, 0xd4, 0xae, 0x76, 0xac, 0xef, 0x5f, 0x1f, 0xd7, 0x73, 0x88, 0xd3, 0x7e, 0x3f,
|
||||
0xe6, 0x5a, 0xbf, 0x32, 0xb1, 0x54, 0xc2, 0x5b, 0x46, 0x89, 0x8b, 0x2b, 0x51, 0xda, 0xc1, 0xda,
|
||||
0x68, 0xa2, 0xf6, 0xce, 0x49, 0xcd, 0x2d, 0x7e, 0xd3, 0xcd, 0x3a, 0x77, 0x36, 0x2f, 0x7f, 0x3d,
|
||||
0x2c, 0x79, 0x79, 0xea, 0xd9, 0xbd, 0xf3, 0xeb, 0x8b, 0xa3, 0xe5, 0xfd, 0x56, 0x03, 0xef, 0xaf,
|
||||
0xa1, 0x78, 0x5c, 0x47, 0xa0, 0x34, 0x6f, 0x7d, 0x42, 0xb8, 0xd6, 0xd5, 0xe2, 0x34, 0x08, 0xc0,
|
||||
0x67, 0x86, 0xbf, 0x49, 0xfa, 0xde, 0x9a, 0xd3, 0xc2, 0x77, 0xf4, 0xa8, 0xf7, 0x8e, 0xfb, 0x26,
|
||||
0x05, 0xad, 0x7a, 0x45, 0x49, 0xf6, 0x70, 0x05, 0x62, 0x29, 0xa4, 0xb2, 0xca, 0xa9, 0x91, 0x57,
|
||||
0xff, 0x91, 0x7e, 0x40, 0xd8, 0x5a, 0xc7, 0x29, 0x58, 0x49, 0x0d, 0x97, 0x7d, 0xd9, 0xcf, 0x80,
|
||||
0xbc, 0xe4, 0x48, 0x0e, 0xf1, 0x2e, 0x9f, 0x44, 0x32, 0x9e, 0x9e, 0xf5, 0x02, 0xf0, 0x87, 0xe9,
|
||||
0xd4, 0xb2, 0xb7, 0x93, 0x69, 0x9d, 0x44, 0x22, 0x75, 0xbc, 0x65, 0x60, 0xc8, 0x8b, 0xc1, 0x59,
|
||||
0x41, 0x0e, 0x70, 0x35, 0x99, 0x10, 0x0c, 0x40, 0x1b, 0x6b, 0xb3, 0x89, 0xda, 0xdb, 0xde, 0x52,
|
||||
0x38, 0xf9, 0x86, 0x70, 0xb9, 0xab, 0x05, 0x19, 0xe2, 0xbb, 0xab, 0x0f, 0x63, 0x2f, 0x1f, 0x7e,
|
||||
0x9d, 0xd2, 0x6e, 0xdd, 0xec, 0x2d, 0x5e, 0xdb, 0x3e, 0xff, 0xf1, 0xe7, 0xcb, 0x46, 0xbd, 0x45,
|
||||
0xe8, 0x62, 0x6b, 0x58, 0x1e, 0x24, 0x2f, 0xf0, 0xee, 0xca, 0xb2, 0x34, 0x56, 0xfa, 0xfd, 0x6b,
|
||||
0xd9, 0x87, 0x37, 0x5a, 0xc5, 0x24, 0x7b, 0xeb, 0xfd, 0xf5, 0xc5, 0x11, 0xea, 0x3c, 0xbf, 0x9c,
|
||||
0x39, 0xe8, 0x6a, 0xe6, 0xa0, 0xdf, 0x33, 0x07, 0x7d, 0x9e, 0x3b, 0xa5, 0xab, 0xb9, 0x53, 0xfa,
|
||||
0x39, 0x77, 0x4a, 0x6f, 0x1f, 0x09, 0x69, 0x06, 0xa3, 0x9e, 0xeb, 0x43, 0x48, 0x41, 0x69, 0x50,
|
||||
0x31, 0x4d, 0x3f, 0x93, 0x1c, 0xcd, 0x4c, 0x23, 0xae, 0x7b, 0x95, 0x74, 0x99, 0x9f, 0xfc, 0x0d,
|
||||
0x00, 0x00, 0xff, 0xff, 0xd2, 0xc4, 0xc0, 0x89, 0x6b, 0x03, 0x00, 0x00,
|
||||
// 491 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x4f, 0x6b, 0x13, 0x41,
|
||||
0x1c, 0xcd, 0x34, 0x6d, 0x6c, 0xa6, 0x55, 0xe3, 0x10, 0xda, 0xcd, 0x52, 0xd6, 0x76, 0xf1, 0x50,
|
||||
0x0a, 0xee, 0xd0, 0x0a, 0x1e, 0x3c, 0x08, 0xcd, 0xd9, 0x80, 0xac, 0xe8, 0xc1, 0x4b, 0x99, 0x6c,
|
||||
0x86, 0xc9, 0x98, 0xdd, 0xf9, 0x2d, 0x3b, 0x93, 0x90, 0xdc, 0xa4, 0x9e, 0x04, 0x0f, 0x82, 0x5f,
|
||||
0xa4, 0x07, 0xbf, 0x83, 0x3d, 0x16, 0xbd, 0x78, 0x12, 0x49, 0x84, 0x7e, 0x0d, 0xd9, 0x7f, 0x8d,
|
||||
0x89, 0xe4, 0xd2, 0xcb, 0xb2, 0xbf, 0xf7, 0xde, 0xfc, 0xde, 0xe3, 0xcd, 0xe0, 0x07, 0x23, 0x36,
|
||||
0x0c, 0x0d, 0x1d, 0x1d, 0x53, 0x33, 0xf6, 0xe2, 0x04, 0x0c, 0x90, 0xcd, 0x0c, 0xf2, 0x46, 0xc7,
|
||||
0xf6, 0x6e, 0x00, 0x3a, 0x02, 0x4d, 0x23, 0x2d, 0x52, 0x45, 0xa4, 0x45, 0x2e, 0xb1, 0x5b, 0x39,
|
||||
0x71, 0x96, 0x4d, 0x34, 0x1f, 0x0a, 0xaa, 0x29, 0x40, 0x40, 0x8e, 0xa7, 0x7f, 0x05, 0xba, 0x27,
|
||||
0x00, 0x44, 0xc8, 0x29, 0x8b, 0x25, 0x65, 0x4a, 0x81, 0x61, 0x46, 0x82, 0x2a, 0xcf, 0xec, 0xdc,
|
||||
0x84, 0x10, 0x5c, 0x71, 0x2d, 0x0b, 0xdc, 0xfd, 0x84, 0x70, 0xa3, 0xa3, 0xc5, 0x69, 0x18, 0x42,
|
||||
0xc0, 0x0c, 0x7f, 0x93, 0xaa, 0xc8, 0x53, 0x5c, 0x67, 0x43, 0xd3, 0x87, 0x44, 0x9a, 0x89, 0x85,
|
||||
0xf6, 0xd1, 0x61, 0xbd, 0x6d, 0x7d, 0xff, 0xfa, 0xb8, 0x59, 0xa4, 0x38, 0xed, 0xf5, 0x12, 0xae,
|
||||
0xf5, 0x2b, 0x93, 0x48, 0x25, 0xfc, 0xb9, 0x94, 0x58, 0xf8, 0x8e, 0x1e, 0x76, 0xdf, 0xf1, 0xc0,
|
||||
0x58, 0x6b, 0xe9, 0x29, 0xbf, 0x1c, 0xc9, 0x0e, 0xae, 0x41, 0x22, 0x85, 0x54, 0x56, 0x35, 0x23,
|
||||
0x8a, 0xe9, 0xd9, 0xbd, 0xf3, 0xeb, 0x8b, 0xa3, 0xf9, 0x06, 0xf7, 0x03, 0xc2, 0xd6, 0x72, 0x1c,
|
||||
0x9f, 0xeb, 0x18, 0x94, 0xe6, 0xa4, 0x81, 0xab, 0x81, 0xec, 0xe5, 0x81, 0xfc, 0xf4, 0x97, 0x1c,
|
||||
0xe0, 0x6d, 0x3e, 0x8e, 0x65, 0x32, 0x39, 0xeb, 0x86, 0x10, 0x0c, 0x32, 0xd7, 0xaa, 0xbf, 0x95,
|
||||
0x63, 0xed, 0x14, 0x22, 0x4d, 0xbc, 0x61, 0x60, 0xc0, 0x4b, 0xe3, 0x7c, 0x20, 0x7b, 0xb8, 0x9e,
|
||||
0x3a, 0x84, 0x7d, 0xd0, 0xc6, 0x5a, 0xdf, 0x47, 0x87, 0x9b, 0xfe, 0x1c, 0x70, 0x3f, 0x22, 0x7c,
|
||||
0xbf, 0xa3, 0xc5, 0xeb, 0xb8, 0xc7, 0x0c, 0x7f, 0xc9, 0x12, 0x16, 0xe9, 0x5b, 0x77, 0xe2, 0xe1,
|
||||
0x5a, 0x9c, 0x6d, 0xc8, 0xc2, 0x6d, 0x9d, 0x34, 0xbc, 0xf2, 0xee, 0xbd, 0x7c, 0x73, 0x7b, 0xfd,
|
||||
0xf2, 0xd7, 0xc3, 0x8a, 0x5f, 0xa8, 0xfe, 0x6b, 0xa4, 0x85, 0x77, 0x97, 0xa2, 0x94, 0x7d, 0x9c,
|
||||
0x7c, 0x43, 0xb8, 0xda, 0xd1, 0x82, 0x0c, 0xf0, 0xdd, 0xc5, 0xfb, 0xb3, 0xe7, 0x1e, 0xcb, 0x65,
|
||||
0xda, 0xee, 0x6a, 0xae, 0x5c, 0xec, 0xda, 0xe7, 0x3f, 0xfe, 0x7c, 0x59, 0x6b, 0xba, 0x84, 0xde,
|
||||
0xbc, 0x1a, 0x56, 0x08, 0xc9, 0x0b, 0xbc, 0xbd, 0xd0, 0x4b, 0x6b, 0x61, 0xdf, 0xbf, 0x94, 0x7d,
|
||||
0xb0, 0x92, 0x2a, 0x9d, 0xec, 0x8d, 0xf7, 0xd7, 0x17, 0x47, 0xa8, 0xfd, 0xfc, 0x72, 0xea, 0xa0,
|
||||
0xab, 0xa9, 0x83, 0x7e, 0x4f, 0x1d, 0xf4, 0x79, 0xe6, 0x54, 0xae, 0x66, 0x4e, 0xe5, 0xe7, 0xcc,
|
||||
0xa9, 0xbc, 0x7d, 0x24, 0xa4, 0xe9, 0x0f, 0xbb, 0x5e, 0x00, 0x11, 0x05, 0xa5, 0x41, 0x25, 0x34,
|
||||
0xfb, 0x8c, 0x8b, 0x68, 0x66, 0x12, 0x73, 0xdd, 0xad, 0x65, 0x8f, 0xf9, 0xc9, 0xdf, 0x00, 0x00,
|
||||
0x00, 0xff, 0xff, 0xc3, 0x77, 0xd8, 0x9e, 0x6b, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -440,69 +440,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
Metadata: "vault/v1/tx.proto",
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) 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 *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgAllocateVault) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
@@ -599,6 +536,69 @@ func (m *MsgAllocateVaultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) 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 *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) 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
|
||||
@@ -610,30 +610,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
|
||||
dAtA[offset] = uint8(v)
|
||||
return base
|
||||
}
|
||||
func (m *MsgUpdateParams) 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 *MsgUpdateParamsResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgAllocateVault) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
@@ -678,177 +654,36 @@ func (m *MsgAllocateVaultResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) 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 *MsgUpdateParamsResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTx(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozTx(x uint64) (n int) {
|
||||
return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *MsgUpdateParams) 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: MsgUpdateParams: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParams: 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 *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgAllocateVault) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
@@ -1148,6 +983,171 @@ func (m *MsgAllocateVaultResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgUpdateParams) 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: MsgUpdateParams: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParams: 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 *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: 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
|
||||
|
||||
+7
-29
@@ -13,10 +13,13 @@ type Vault struct {
|
||||
|
||||
func NewVault(keyshareJSON string, adddress string, chainID string, schema *dwngen.Schema) (*Vault, error) {
|
||||
dwnCfg := &dwngen.Config{
|
||||
Motr: createMotrConfig(keyshareJSON, adddress, "sonr.id"),
|
||||
Ipfs: defaultIPFSConfig(),
|
||||
Sonr: defaultSonrConfig(chainID),
|
||||
Schema: schema,
|
||||
MotrKeyshare: keyshareJSON,
|
||||
MotrAddress: adddress,
|
||||
IpfsGatewayUrl: "https://ipfs.sonr.land",
|
||||
SonrApiUrl: "https://api.sonr.land",
|
||||
SonrRpcUrl: "https://rpc.sonr.land",
|
||||
SonrChainId: chainID,
|
||||
VaultSchema: schema,
|
||||
}
|
||||
fileMap, err := dwn.NewVaultDirectory(dwnCfg)
|
||||
if err != nil {
|
||||
@@ -26,28 +29,3 @@ func NewVault(keyshareJSON string, adddress string, chainID string, schema *dwng
|
||||
FS: fileMap,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func createMotrConfig(keyshareJSON string, adddress string, origin string) *dwngen.Motr {
|
||||
return &dwngen.Motr{
|
||||
Keyshare: keyshareJSON,
|
||||
Address: adddress,
|
||||
Origin: origin,
|
||||
}
|
||||
}
|
||||
|
||||
func defaultIPFSConfig() *dwngen.IPFS {
|
||||
return &dwngen.IPFS{
|
||||
ApiUrl: "https://api.sonr-ipfs.land",
|
||||
GatewayUrl: "https://ipfs.sonr.land",
|
||||
}
|
||||
}
|
||||
|
||||
func defaultSonrConfig(chainID string) *dwngen.Sonr {
|
||||
return &dwngen.Sonr{
|
||||
ApiUrl: "https://api.sonr.land",
|
||||
GrpcUrl: "https://grpc.sonr.land",
|
||||
RpcUrl: "https://rpc.sonr.land",
|
||||
WebSocketUrl: "wss://rpc.sonr.land/ws",
|
||||
ChainId: chainID,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user