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:
Prad Nukala
2024-10-15 14:31:19 -04:00
committed by GitHub
parent 104df074e9
commit b6c49828ed
146 changed files with 18035 additions and 4202 deletions
-3
View File
@@ -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)
}
+14 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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,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, 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, 0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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
View File
File diff suppressed because it is too large Load Diff