wormchain: add back protobuf

This commit is contained in:
Conor Patrick 2022-10-27 23:57:08 +00:00 committed by Evan Gray
parent 7931399149
commit af633ce300
16 changed files with 11872 additions and 16 deletions

View File

@ -4,7 +4,6 @@ FROM docker.io/golang:1.19.0@sha256:4c00329e17be6fedd8bd4412df454a205348da00f9e0
RUN apt-get update
RUN apt install -y netcat
RUN apt install -y jq
RUN curl https://get.ignite.com/cli@v0.23.0 | bash && mv ignite /usr/local/bin/
WORKDIR /app
@ -24,7 +23,6 @@ EXPOSE 4500
RUN unset GOPATH
RUN make proto -B
RUN make client
RUN chmod +x /app/build/wormchaind
RUN make validators

View File

@ -12,7 +12,6 @@ validators/first_validator/keyring-test
validators/second_validator/keyring-test
ts-sdk/node_modules
ts-sdk/lib
*.pb.go
.idea
*.iml

View File

@ -1,14 +1,9 @@
PROTO_FILES=$(shell find proto -name "*.proto")
GO_FILES=$(shell find . -name "*.go")
IGNITE_EXPECTED_VERSION:=v0.23.0
IGNITE_ACTUAL_VERSION:=$(shell ignite version | awk '/Ignite CLI version:/ { print $$4 }')
# Address of the main tilt validator that the others should connect to
TILT_VALADDRESS=wormholevaloper1cyyzpxplxdzkeea7kwsydadg87357qna87hzv8
ifneq ("$(IGNITE_ACTUAL_VERSION)", "$(IGNITE_EXPECTED_VERSION)")
$(error "Expected ignite version $(IGNITE_EXPECTED_VERSION) but found $(IGNITE_ACTUAL_VERSION)")
endif
.PHONY: all
all: client vue validators
@ -35,10 +30,13 @@ validators:
mkdir -p validators/second_validator/keyring-test
cp build/keyring-test/* validators/second_validator/keyring-test/
build/wormchaind: cmd/wormchaind/main.go $(GO_FILES) proto
build/wormchaind: cmd/wormchaind/main.go $(GO_FILES)
go build -o $@ $<
proto: $(PROTO_FILES)
check-ignite:
@ if [ "$(shell ignite version | awk '/Ignite CLI version:/ { print $$4 }')" != "$(IGNITE_EXPECTED_VERSION)" ] ; then echo "Expected ignite version $(IGNITE_EXPECTED_VERSION)" && exit 1 ; fi
proto: check-ignite $(PROTO_FILES)
ignite generate proto-go
touch proto

View File

@ -11,12 +11,6 @@ curl https://get.ignite.com/cli@v0.23.0 | bash
cp ignite ~/.local/bin/
```
Build the protobuf.
```
ignite generate proto-go
```
Build and install wormchain.
```

View File

@ -0,0 +1,429 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: wormhole/config.proto
package types
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Config struct {
GuardianSetExpiration uint64 `protobuf:"varint,1,opt,name=guardian_set_expiration,json=guardianSetExpiration,proto3" json:"guardian_set_expiration,omitempty"`
GovernanceEmitter []byte `protobuf:"bytes,2,opt,name=governance_emitter,json=governanceEmitter,proto3" json:"governance_emitter,omitempty"`
GovernanceChain uint32 `protobuf:"varint,3,opt,name=governance_chain,json=governanceChain,proto3" json:"governance_chain,omitempty"`
ChainId uint32 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
}
func (m *Config) Reset() { *m = Config{} }
func (m *Config) String() string { return proto.CompactTextString(m) }
func (*Config) ProtoMessage() {}
func (*Config) Descriptor() ([]byte, []int) {
return fileDescriptor_14d08d38823c924a, []int{0}
}
func (m *Config) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Config.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 *Config) XXX_Merge(src proto.Message) {
xxx_messageInfo_Config.Merge(m, src)
}
func (m *Config) XXX_Size() int {
return m.Size()
}
func (m *Config) XXX_DiscardUnknown() {
xxx_messageInfo_Config.DiscardUnknown(m)
}
var xxx_messageInfo_Config proto.InternalMessageInfo
func (m *Config) GetGuardianSetExpiration() uint64 {
if m != nil {
return m.GuardianSetExpiration
}
return 0
}
func (m *Config) GetGovernanceEmitter() []byte {
if m != nil {
return m.GovernanceEmitter
}
return nil
}
func (m *Config) GetGovernanceChain() uint32 {
if m != nil {
return m.GovernanceChain
}
return 0
}
func (m *Config) GetChainId() uint32 {
if m != nil {
return m.ChainId
}
return 0
}
func init() {
proto.RegisterType((*Config)(nil), "wormhole_foundation.wormchain.wormhole.Config")
}
func init() { proto.RegisterFile("wormhole/config.proto", fileDescriptor_14d08d38823c924a) }
var fileDescriptor_14d08d38823c924a = []byte{
// 272 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0xcf, 0x2f, 0xca,
0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0xce, 0xcf, 0x4b, 0xcb, 0x4c, 0xd7, 0x2b, 0x28, 0xca, 0x2f,
0xc9, 0x17, 0x52, 0x83, 0x09, 0xc7, 0xa7, 0xe5, 0x97, 0xe6, 0xa5, 0x24, 0x96, 0x64, 0xe6, 0xe7,
0xe9, 0x81, 0xc4, 0x92, 0x33, 0x12, 0x33, 0x21, 0x2c, 0x90, 0xac, 0x94, 0x48, 0x7a, 0x7e, 0x7a,
0x3e, 0x58, 0x8b, 0x3e, 0x88, 0x05, 0xd1, 0xad, 0xb4, 0x95, 0x91, 0x8b, 0xcd, 0x19, 0x6c, 0x9c,
0x90, 0x19, 0x97, 0x78, 0x7a, 0x69, 0x62, 0x51, 0x4a, 0x66, 0x62, 0x5e, 0x7c, 0x71, 0x6a, 0x49,
0x7c, 0x6a, 0x45, 0x41, 0x66, 0x11, 0xd8, 0x38, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x96, 0x20, 0x51,
0x98, 0x74, 0x70, 0x6a, 0x89, 0x2b, 0x5c, 0x52, 0x48, 0x97, 0x4b, 0x28, 0x3d, 0xbf, 0x2c, 0xb5,
0x28, 0x2f, 0x31, 0x2f, 0x39, 0x35, 0x3e, 0x35, 0x37, 0xb3, 0xa4, 0x24, 0xb5, 0x48, 0x82, 0x49,
0x81, 0x51, 0x83, 0x27, 0x48, 0x10, 0x21, 0xe3, 0x0a, 0x91, 0x10, 0xd2, 0xe4, 0x12, 0x40, 0x52,
0x0e, 0x76, 0xa4, 0x04, 0xb3, 0x02, 0xa3, 0x06, 0x6f, 0x10, 0x3f, 0x42, 0xdc, 0x19, 0x24, 0x2c,
0x24, 0xc9, 0xc5, 0x01, 0x96, 0x8f, 0xcf, 0x4c, 0x91, 0x60, 0x01, 0x2b, 0x61, 0x07, 0xf3, 0x3d,
0x53, 0x9c, 0x82, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6,
0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x32, 0x3d,
0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xe6, 0x79, 0x5d, 0x44, 0xd0, 0xe8,
0xc3, 0x83, 0x46, 0xbf, 0x02, 0x2e, 0xaf, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e,
0x13, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xda, 0x45, 0x4d, 0x6a, 0x01, 0x00, 0x00,
}
func (m *Config) 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 *Config) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.ChainId != 0 {
i = encodeVarintConfig(dAtA, i, uint64(m.ChainId))
i--
dAtA[i] = 0x20
}
if m.GovernanceChain != 0 {
i = encodeVarintConfig(dAtA, i, uint64(m.GovernanceChain))
i--
dAtA[i] = 0x18
}
if len(m.GovernanceEmitter) > 0 {
i -= len(m.GovernanceEmitter)
copy(dAtA[i:], m.GovernanceEmitter)
i = encodeVarintConfig(dAtA, i, uint64(len(m.GovernanceEmitter)))
i--
dAtA[i] = 0x12
}
if m.GuardianSetExpiration != 0 {
i = encodeVarintConfig(dAtA, i, uint64(m.GuardianSetExpiration))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintConfig(dAtA []byte, offset int, v uint64) int {
offset -= sovConfig(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Config) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.GuardianSetExpiration != 0 {
n += 1 + sovConfig(uint64(m.GuardianSetExpiration))
}
l = len(m.GovernanceEmitter)
if l > 0 {
n += 1 + l + sovConfig(uint64(l))
}
if m.GovernanceChain != 0 {
n += 1 + sovConfig(uint64(m.GovernanceChain))
}
if m.ChainId != 0 {
n += 1 + sovConfig(uint64(m.ChainId))
}
return n
}
func sovConfig(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozConfig(x uint64) (n int) {
return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Config) 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 ErrIntOverflowConfig
}
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: Config: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Config: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field GuardianSetExpiration", wireType)
}
m.GuardianSetExpiration = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.GuardianSetExpiration |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field GovernanceEmitter", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthConfig
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthConfig
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.GovernanceEmitter = append(m.GovernanceEmitter[:0], dAtA[iNdEx:postIndex]...)
if m.GovernanceEmitter == nil {
m.GovernanceEmitter = []byte{}
}
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field GovernanceChain", wireType)
}
m.GovernanceChain = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.GovernanceChain |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType)
}
m.ChainId = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowConfig
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ChainId |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipConfig(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthConfig
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipConfig(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowConfig
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowConfig
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowConfig
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthConfig
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupConfig
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthConfig
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowConfig = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupConfig = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -0,0 +1,302 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: wormhole/consensus_guardian_set_index.proto
package types
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type ConsensusGuardianSetIndex struct {
Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
}
func (m *ConsensusGuardianSetIndex) Reset() { *m = ConsensusGuardianSetIndex{} }
func (m *ConsensusGuardianSetIndex) String() string { return proto.CompactTextString(m) }
func (*ConsensusGuardianSetIndex) ProtoMessage() {}
func (*ConsensusGuardianSetIndex) Descriptor() ([]byte, []int) {
return fileDescriptor_18e45d0c16ad5fce, []int{0}
}
func (m *ConsensusGuardianSetIndex) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ConsensusGuardianSetIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ConsensusGuardianSetIndex.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 *ConsensusGuardianSetIndex) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConsensusGuardianSetIndex.Merge(m, src)
}
func (m *ConsensusGuardianSetIndex) XXX_Size() int {
return m.Size()
}
func (m *ConsensusGuardianSetIndex) XXX_DiscardUnknown() {
xxx_messageInfo_ConsensusGuardianSetIndex.DiscardUnknown(m)
}
var xxx_messageInfo_ConsensusGuardianSetIndex proto.InternalMessageInfo
func (m *ConsensusGuardianSetIndex) GetIndex() uint32 {
if m != nil {
return m.Index
}
return 0
}
func init() {
proto.RegisterType((*ConsensusGuardianSetIndex)(nil), "wormhole_foundation.wormchain.wormhole.ConsensusGuardianSetIndex")
}
func init() {
proto.RegisterFile("wormhole/consensus_guardian_set_index.proto", fileDescriptor_18e45d0c16ad5fce)
}
var fileDescriptor_18e45d0c16ad5fce = []byte{
// 190 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2e, 0xcf, 0x2f, 0xca,
0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0x8e, 0x4f,
0x2f, 0x4d, 0x2c, 0x4a, 0xc9, 0x4c, 0xcc, 0x8b, 0x2f, 0x4e, 0x2d, 0x89, 0xcf, 0xcc, 0x4b, 0x49,
0xad, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83, 0x29, 0x8e, 0x4f, 0xcb, 0x2f, 0xcd,
0x4b, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x89, 0x25, 0x67, 0x24, 0x66, 0x42, 0x58, 0x20,
0x59, 0x25, 0x43, 0x2e, 0x49, 0x67, 0x98, 0x69, 0xee, 0x50, 0xc3, 0x82, 0x53, 0x4b, 0x3c, 0x41,
0x46, 0x09, 0x89, 0x70, 0xb1, 0x82, 0xcd, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0d, 0x82, 0x70,
0x9c, 0x82, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09,
0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x32, 0x3d, 0xb3,
0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x66, 0x83, 0x2e, 0xc2, 0x7e, 0x7d, 0xb8,
0xfd, 0xfa, 0x15, 0x70, 0x79, 0xfd, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xb3, 0x8d,
0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0x7c, 0x1c, 0x4e, 0xe5, 0x00, 0x00, 0x00,
}
func (m *ConsensusGuardianSetIndex) 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 *ConsensusGuardianSetIndex) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ConsensusGuardianSetIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Index != 0 {
i = encodeVarintConsensusGuardianSetIndex(dAtA, i, uint64(m.Index))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintConsensusGuardianSetIndex(dAtA []byte, offset int, v uint64) int {
offset -= sovConsensusGuardianSetIndex(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *ConsensusGuardianSetIndex) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Index != 0 {
n += 1 + sovConsensusGuardianSetIndex(uint64(m.Index))
}
return n
}
func sovConsensusGuardianSetIndex(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozConsensusGuardianSetIndex(x uint64) (n int) {
return sovConsensusGuardianSetIndex(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ConsensusGuardianSetIndex) 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 ErrIntOverflowConsensusGuardianSetIndex
}
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: ConsensusGuardianSetIndex: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ConsensusGuardianSetIndex: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
}
m.Index = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowConsensusGuardianSetIndex
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Index |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipConsensusGuardianSetIndex(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthConsensusGuardianSetIndex
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipConsensusGuardianSetIndex(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowConsensusGuardianSetIndex
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowConsensusGuardianSetIndex
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowConsensusGuardianSetIndex
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthConsensusGuardianSetIndex
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupConsensusGuardianSetIndex
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthConsensusGuardianSetIndex
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthConsensusGuardianSetIndex = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowConsensusGuardianSetIndex = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupConsensusGuardianSetIndex = fmt.Errorf("proto: unexpected end of group")
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,650 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: wormhole/genesis.proto
package types
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// GenesisState defines the wormhole module's genesis state.
type GenesisState struct {
GuardianSetList []GuardianSet `protobuf:"bytes,1,rep,name=guardianSetList,proto3" json:"guardianSetList"`
Config *Config `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
ReplayProtectionList []ReplayProtection `protobuf:"bytes,3,rep,name=replayProtectionList,proto3" json:"replayProtectionList"`
SequenceCounterList []SequenceCounter `protobuf:"bytes,4,rep,name=sequenceCounterList,proto3" json:"sequenceCounterList"`
ConsensusGuardianSetIndex *ConsensusGuardianSetIndex `protobuf:"bytes,5,opt,name=consensusGuardianSetIndex,proto3" json:"consensusGuardianSetIndex,omitempty"`
GuardianValidatorList []GuardianValidator `protobuf:"bytes,6,rep,name=guardianValidatorList,proto3" json:"guardianValidatorList"`
}
func (m *GenesisState) Reset() { *m = GenesisState{} }
func (m *GenesisState) String() string { return proto.CompactTextString(m) }
func (*GenesisState) ProtoMessage() {}
func (*GenesisState) Descriptor() ([]byte, []int) {
return fileDescriptor_9a7ced3fe0304831, []int{0}
}
func (m *GenesisState) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *GenesisState) XXX_Merge(src proto.Message) {
xxx_messageInfo_GenesisState.Merge(m, src)
}
func (m *GenesisState) XXX_Size() int {
return m.Size()
}
func (m *GenesisState) XXX_DiscardUnknown() {
xxx_messageInfo_GenesisState.DiscardUnknown(m)
}
var xxx_messageInfo_GenesisState proto.InternalMessageInfo
func (m *GenesisState) GetGuardianSetList() []GuardianSet {
if m != nil {
return m.GuardianSetList
}
return nil
}
func (m *GenesisState) GetConfig() *Config {
if m != nil {
return m.Config
}
return nil
}
func (m *GenesisState) GetReplayProtectionList() []ReplayProtection {
if m != nil {
return m.ReplayProtectionList
}
return nil
}
func (m *GenesisState) GetSequenceCounterList() []SequenceCounter {
if m != nil {
return m.SequenceCounterList
}
return nil
}
func (m *GenesisState) GetConsensusGuardianSetIndex() *ConsensusGuardianSetIndex {
if m != nil {
return m.ConsensusGuardianSetIndex
}
return nil
}
func (m *GenesisState) GetGuardianValidatorList() []GuardianValidator {
if m != nil {
return m.GuardianValidatorList
}
return nil
}
func init() {
proto.RegisterType((*GenesisState)(nil), "wormhole_foundation.wormchain.wormhole.GenesisState")
}
func init() { proto.RegisterFile("wormhole/genesis.proto", fileDescriptor_9a7ced3fe0304831) }
var fileDescriptor_9a7ced3fe0304831 = []byte{
// 426 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcf, 0x8b, 0xda, 0x40,
0x14, 0xc7, 0x93, 0xfa, 0xe3, 0x30, 0x16, 0x0a, 0xa9, 0x16, 0x6b, 0x21, 0xda, 0x1e, 0x8a, 0x50,
0x9a, 0x80, 0x1e, 0x5a, 0x8f, 0x55, 0xa8, 0x14, 0x7a, 0x28, 0x09, 0xf4, 0xb0, 0x97, 0x30, 0x26,
0x63, 0x1c, 0xd0, 0x19, 0x37, 0x33, 0xd9, 0xd5, 0xd3, 0xfe, 0x0b, 0x7b, 0xdc, 0x3f, 0xc9, 0xa3,
0xc7, 0x3d, 0x2d, 0x8b, 0xfe, 0x23, 0x4b, 0x66, 0x92, 0xd1, 0x75, 0xb3, 0x10, 0x6f, 0xc3, 0x9b,
0xf7, 0x3e, 0xdf, 0xf7, 0xbe, 0xef, 0x81, 0x0f, 0xd7, 0x34, 0x5a, 0xcc, 0xe8, 0x1c, 0xd9, 0x21,
0x22, 0x88, 0x61, 0x66, 0x2d, 0x23, 0xca, 0xa9, 0xf1, 0x35, 0x8b, 0x7b, 0x53, 0x1a, 0x93, 0x00,
0x72, 0x4c, 0x89, 0x95, 0xc4, 0xfc, 0x19, 0xc4, 0xf2, 0x95, 0xfc, 0xb6, 0x3e, 0x1d, 0xea, 0x63,
0x18, 0x05, 0x18, 0x12, 0x8f, 0x21, 0x2e, 0x21, 0xad, 0x86, 0xfa, 0xf4, 0x29, 0x99, 0xe2, 0x30,
0x0d, 0x77, 0x54, 0x38, 0x42, 0xcb, 0x39, 0x5c, 0x7b, 0x49, 0x18, 0xf9, 0x42, 0x42, 0x66, 0xb4,
0x55, 0x06, 0x43, 0x97, 0x31, 0x22, 0x3e, 0xf2, 0x7c, 0x1a, 0x13, 0x8e, 0xa2, 0x34, 0xe1, 0xdb,
0x31, 0x99, 0x21, 0xc2, 0x62, 0xe6, 0x1d, 0x37, 0xe0, 0x61, 0x12, 0xa0, 0x55, 0x9a, 0xfc, 0xf9,
0x65, 0x8f, 0x57, 0x70, 0x8e, 0x03, 0xc8, 0x69, 0xc6, 0xab, 0x87, 0x34, 0xa4, 0xe2, 0x69, 0x27,
0x2f, 0x19, 0xfd, 0x72, 0x57, 0x01, 0x6f, 0xc7, 0xd2, 0x16, 0x97, 0x43, 0x8e, 0x0c, 0x1f, 0xbc,
0xcb, 0x10, 0x2e, 0xe2, 0x7f, 0x31, 0xe3, 0x4d, 0xbd, 0x53, 0xea, 0xd6, 0x7a, 0x7d, 0xab, 0x98,
0x5f, 0xd6, 0xf8, 0x50, 0x3e, 0x2c, 0x6f, 0x1e, 0xda, 0x9a, 0x73, 0x4a, 0x34, 0x7e, 0x83, 0xaa,
0xb4, 0xab, 0xf9, 0xa6, 0xa3, 0x77, 0x6b, 0x3d, 0xab, 0x28, 0x7b, 0x24, 0xaa, 0x9c, 0xb4, 0xda,
0x88, 0x40, 0x5d, 0xfa, 0xfb, 0x4f, 0xd9, 0x2b, 0x3a, 0x2e, 0x89, 0x8e, 0x7f, 0x16, 0xa5, 0x3a,
0x27, 0x8c, 0xb4, 0xed, 0x5c, 0xb6, 0x41, 0xc1, 0xfb, 0x6c, 0x63, 0x23, 0xb9, 0x30, 0x21, 0x59,
0x16, 0x92, 0x3f, 0x8a, 0x4a, 0xba, 0xcf, 0x11, 0xa9, 0x62, 0x1e, 0xd9, 0xb8, 0x01, 0x1f, 0xd5,
0x05, 0x1c, 0x79, 0xfb, 0x27, 0x59, 0x7f, 0xb3, 0x22, 0xfc, 0xfb, 0x75, 0x86, 0x7f, 0xf9, 0x20,
0xe7, 0x75, 0x0d, 0x23, 0x06, 0x8d, 0x6c, 0x81, 0xff, 0xb3, 0xa3, 0x12, 0x33, 0x57, 0xc5, 0xcc,
0x83, 0x73, 0x0f, 0x43, 0x41, 0xd2, 0xa9, 0xf3, 0xe9, 0x43, 0x77, 0xb3, 0x33, 0xf5, 0xed, 0xce,
0xd4, 0x1f, 0x77, 0xa6, 0x7e, 0xbb, 0x37, 0xb5, 0xed, 0xde, 0xd4, 0xee, 0xf7, 0xa6, 0x76, 0x31,
0x08, 0x31, 0x9f, 0xc5, 0x13, 0xcb, 0xa7, 0x0b, 0x3b, 0xa3, 0x7f, 0x3f, 0x68, 0xdb, 0x4a, 0xdb,
0x5e, 0xa9, 0x7f, 0x9b, 0xaf, 0x97, 0x88, 0x4d, 0xaa, 0xe2, 0xec, 0xfb, 0x4f, 0x01, 0x00, 0x00,
0xff, 0xff, 0x40, 0x4b, 0xe8, 0xcd, 0x15, 0x04, 0x00, 0x00,
}
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.GuardianValidatorList) > 0 {
for iNdEx := len(m.GuardianValidatorList) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.GuardianValidatorList[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x32
}
}
if m.ConsensusGuardianSetIndex != nil {
{
size, err := m.ConsensusGuardianSetIndex.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x2a
}
if len(m.SequenceCounterList) > 0 {
for iNdEx := len(m.SequenceCounterList) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.SequenceCounterList[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x22
}
}
if len(m.ReplayProtectionList) > 0 {
for iNdEx := len(m.ReplayProtectionList) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.ReplayProtectionList[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
}
if m.Config != nil {
{
size, err := m.Config.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
if len(m.GuardianSetList) > 0 {
for iNdEx := len(m.GuardianSetList) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.GuardianSetList[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGenesis(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
offset -= sovGenesis(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *GenesisState) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.GuardianSetList) > 0 {
for _, e := range m.GuardianSetList {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
if m.Config != nil {
l = m.Config.Size()
n += 1 + l + sovGenesis(uint64(l))
}
if len(m.ReplayProtectionList) > 0 {
for _, e := range m.ReplayProtectionList {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
if len(m.SequenceCounterList) > 0 {
for _, e := range m.SequenceCounterList {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
if m.ConsensusGuardianSetIndex != nil {
l = m.ConsensusGuardianSetIndex.Size()
n += 1 + l + sovGenesis(uint64(l))
}
if len(m.GuardianValidatorList) > 0 {
for _, e := range m.GuardianValidatorList {
l = e.Size()
n += 1 + l + sovGenesis(uint64(l))
}
}
return n
}
func sovGenesis(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozGenesis(x uint64) (n int) {
return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GenesisState) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: GenesisState: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field GuardianSetList", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.GuardianSetList = append(m.GuardianSetList, GuardianSet{})
if err := m.GuardianSetList[len(m.GuardianSetList)-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 Config", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Config == nil {
m.Config = &Config{}
}
if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ReplayProtectionList", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ReplayProtectionList = append(m.ReplayProtectionList, ReplayProtection{})
if err := m.ReplayProtectionList[len(m.ReplayProtectionList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SequenceCounterList", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.SequenceCounterList = append(m.SequenceCounterList, SequenceCounter{})
if err := m.SequenceCounterList[len(m.SequenceCounterList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ConsensusGuardianSetIndex", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.ConsensusGuardianSetIndex == nil {
m.ConsensusGuardianSetIndex = &ConsensusGuardianSetIndex{}
}
if err := m.ConsensusGuardianSetIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field GuardianValidatorList", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenesis
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGenesis
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.GuardianValidatorList = append(m.GuardianValidatorList, GuardianValidator{})
if err := m.GuardianValidatorList[len(m.GuardianValidatorList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGenesis
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGenesis(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenesis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenesis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGenesis
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthGenesis
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupGenesis
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthGenesis
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -0,0 +1,900 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: wormhole/governance.proto
package types
import (
bytes "bytes"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// GuardianSetUpdateProposal defines a guardian set update governance proposal
type GuardianSetUpdateProposal struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
NewGuardianSet GuardianSet `protobuf:"bytes,3,opt,name=newGuardianSet,proto3" json:"newGuardianSet"`
}
func (m *GuardianSetUpdateProposal) Reset() { *m = GuardianSetUpdateProposal{} }
func (*GuardianSetUpdateProposal) ProtoMessage() {}
func (*GuardianSetUpdateProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_ceebda8f8c3f5f74, []int{0}
}
func (m *GuardianSetUpdateProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GuardianSetUpdateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GuardianSetUpdateProposal.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 *GuardianSetUpdateProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_GuardianSetUpdateProposal.Merge(m, src)
}
func (m *GuardianSetUpdateProposal) XXX_Size() int {
return m.Size()
}
func (m *GuardianSetUpdateProposal) XXX_DiscardUnknown() {
xxx_messageInfo_GuardianSetUpdateProposal.DiscardUnknown(m)
}
var xxx_messageInfo_GuardianSetUpdateProposal proto.InternalMessageInfo
func (m *GuardianSetUpdateProposal) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *GuardianSetUpdateProposal) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *GuardianSetUpdateProposal) GetNewGuardianSet() GuardianSet {
if m != nil {
return m.NewGuardianSet
}
return GuardianSet{}
}
// GovernanceWormholeMessageProposal defines a governance proposal to emit a generic message in the governance message
// format.
type GovernanceWormholeMessageProposal struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
Action uint32 `protobuf:"varint,3,opt,name=action,proto3" json:"action,omitempty"`
Module []byte `protobuf:"bytes,4,opt,name=module,proto3" json:"module,omitempty"`
TargetChain uint32 `protobuf:"varint,5,opt,name=targetChain,proto3" json:"targetChain,omitempty"`
Payload []byte `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"`
}
func (m *GovernanceWormholeMessageProposal) Reset() { *m = GovernanceWormholeMessageProposal{} }
func (*GovernanceWormholeMessageProposal) ProtoMessage() {}
func (*GovernanceWormholeMessageProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_ceebda8f8c3f5f74, []int{1}
}
func (m *GovernanceWormholeMessageProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GovernanceWormholeMessageProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GovernanceWormholeMessageProposal.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 *GovernanceWormholeMessageProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_GovernanceWormholeMessageProposal.Merge(m, src)
}
func (m *GovernanceWormholeMessageProposal) XXX_Size() int {
return m.Size()
}
func (m *GovernanceWormholeMessageProposal) XXX_DiscardUnknown() {
xxx_messageInfo_GovernanceWormholeMessageProposal.DiscardUnknown(m)
}
var xxx_messageInfo_GovernanceWormholeMessageProposal proto.InternalMessageInfo
func (m *GovernanceWormholeMessageProposal) GetTitle() string {
if m != nil {
return m.Title
}
return ""
}
func (m *GovernanceWormholeMessageProposal) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *GovernanceWormholeMessageProposal) GetAction() uint32 {
if m != nil {
return m.Action
}
return 0
}
func (m *GovernanceWormholeMessageProposal) GetModule() []byte {
if m != nil {
return m.Module
}
return nil
}
func (m *GovernanceWormholeMessageProposal) GetTargetChain() uint32 {
if m != nil {
return m.TargetChain
}
return 0
}
func (m *GovernanceWormholeMessageProposal) GetPayload() []byte {
if m != nil {
return m.Payload
}
return nil
}
func init() {
proto.RegisterType((*GuardianSetUpdateProposal)(nil), "wormhole_foundation.wormchain.wormhole.GuardianSetUpdateProposal")
proto.RegisterType((*GovernanceWormholeMessageProposal)(nil), "wormhole_foundation.wormchain.wormhole.GovernanceWormholeMessageProposal")
}
func init() { proto.RegisterFile("wormhole/governance.proto", fileDescriptor_ceebda8f8c3f5f74) }
var fileDescriptor_ceebda8f8c3f5f74 = []byte{
// 358 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x51, 0xb1, 0x4e, 0xf2, 0x50,
0x18, 0xed, 0xfd, 0x7f, 0x40, 0xbd, 0xa8, 0x43, 0x43, 0x4c, 0xc1, 0xa4, 0x54, 0x06, 0xc3, 0x62,
0x9b, 0xc8, 0xa4, 0x23, 0x0e, 0x4c, 0x26, 0xa6, 0xc4, 0x98, 0xb8, 0x90, 0x4b, 0xfb, 0x59, 0x9a,
0x94, 0x7e, 0xcd, 0xed, 0xad, 0xc8, 0x5b, 0x38, 0x3a, 0xf2, 0x28, 0x8e, 0x8c, 0xb8, 0x39, 0x19,
0x03, 0x8b, 0x8f, 0x61, 0x6e, 0x5b, 0xa0, 0x71, 0x32, 0x71, 0xfb, 0xce, 0x39, 0x3d, 0x27, 0x3d,
0xe7, 0xd2, 0xfa, 0x04, 0xf9, 0x78, 0x84, 0x01, 0x58, 0x1e, 0x3e, 0x02, 0x0f, 0x59, 0xe8, 0x80,
0x19, 0x71, 0x14, 0xa8, 0x9e, 0xae, 0xa5, 0xc1, 0x03, 0x26, 0xa1, 0xcb, 0x84, 0x8f, 0xa1, 0x29,
0x39, 0x67, 0xc4, 0xfc, 0xec, 0x92, 0x6a, 0xe3, 0x78, 0x1b, 0x91, 0x30, 0xee, 0xfa, 0x2c, 0x1c,
0xc4, 0x20, 0xb2, 0x90, 0x46, 0xcd, 0x43, 0x0f, 0xd3, 0xd3, 0x92, 0x57, 0xc6, 0xb6, 0x5e, 0x09,
0xad, 0xf7, 0xf2, 0x8f, 0xfb, 0x20, 0x6e, 0x23, 0x97, 0x09, 0xb8, 0xe1, 0x18, 0x61, 0xcc, 0x02,
0xb5, 0x46, 0xcb, 0xc2, 0x17, 0x01, 0x68, 0xc4, 0x20, 0xed, 0x3d, 0x3b, 0x03, 0xaa, 0x41, 0xab,
0x2e, 0xc4, 0x0e, 0xf7, 0x23, 0xf9, 0x23, 0xda, 0xbf, 0x54, 0x2b, 0x52, 0x2a, 0xa3, 0x87, 0x21,
0x4c, 0x0a, 0xb9, 0xda, 0x7f, 0x83, 0xb4, 0xab, 0xe7, 0x1d, 0xf3, 0x77, 0x4d, 0xcc, 0x82, 0xb5,
0x5b, 0x9a, 0x7f, 0x34, 0x15, 0xfb, 0x47, 0xe0, 0xe5, 0xee, 0xcb, 0xac, 0xa9, 0x7c, 0xcd, 0x9a,
0xa4, 0xf5, 0x46, 0xe8, 0x49, 0x6f, 0x33, 0xd9, 0x5d, 0x1e, 0x71, 0x0d, 0x71, 0xcc, 0xbc, 0xbf,
0x57, 0x39, 0xa2, 0x15, 0xe6, 0xa4, 0xa2, 0xac, 0x70, 0x60, 0xe7, 0x48, 0xf2, 0x63, 0x74, 0x93,
0x00, 0xb4, 0x92, 0x41, 0xda, 0xfb, 0x76, 0x8e, 0x64, 0xa2, 0x60, 0xdc, 0x03, 0x71, 0x25, 0x1b,
0x69, 0xe5, 0xd4, 0x54, 0xa4, 0x54, 0x8d, 0xee, 0x44, 0x6c, 0x1a, 0x20, 0x73, 0xb5, 0x4a, 0x6a,
0x5d, 0xc3, 0x6d, 0xa7, 0x6e, 0x7f, 0xbe, 0xd4, 0xc9, 0x62, 0xa9, 0x93, 0xcf, 0xa5, 0x4e, 0x9e,
0x57, 0xba, 0xb2, 0x58, 0xe9, 0xca, 0xfb, 0x4a, 0x57, 0xee, 0x2f, 0x3c, 0x5f, 0x8c, 0x92, 0xa1,
0xe9, 0xe0, 0xd8, 0x5a, 0xcf, 0x75, 0xb6, 0x1d, 0xd3, 0xda, 0x8c, 0x69, 0x3d, 0x6d, 0x74, 0x4b,
0x4c, 0x23, 0x88, 0x87, 0x95, 0xf4, 0xc9, 0x3b, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x06, 0x0f,
0x17, 0x16, 0x6a, 0x02, 0x00, 0x00,
}
func (this *GuardianSetUpdateProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*GuardianSetUpdateProposal)
if !ok {
that2, ok := that.(GuardianSetUpdateProposal)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Title != that1.Title {
return false
}
if this.Description != that1.Description {
return false
}
if !this.NewGuardianSet.Equal(&that1.NewGuardianSet) {
return false
}
return true
}
func (this *GovernanceWormholeMessageProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*GovernanceWormholeMessageProposal)
if !ok {
that2, ok := that.(GovernanceWormholeMessageProposal)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Title != that1.Title {
return false
}
if this.Description != that1.Description {
return false
}
if this.Action != that1.Action {
return false
}
if !bytes.Equal(this.Module, that1.Module) {
return false
}
if this.TargetChain != that1.TargetChain {
return false
}
if !bytes.Equal(this.Payload, that1.Payload) {
return false
}
return true
}
func (m *GuardianSetUpdateProposal) 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 *GuardianSetUpdateProposal) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GuardianSetUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
{
size, err := m.NewGuardianSet.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintGovernance(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
if len(m.Description) > 0 {
i -= len(m.Description)
copy(dAtA[i:], m.Description)
i = encodeVarintGovernance(dAtA, i, uint64(len(m.Description)))
i--
dAtA[i] = 0x12
}
if len(m.Title) > 0 {
i -= len(m.Title)
copy(dAtA[i:], m.Title)
i = encodeVarintGovernance(dAtA, i, uint64(len(m.Title)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *GovernanceWormholeMessageProposal) 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 *GovernanceWormholeMessageProposal) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GovernanceWormholeMessageProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Payload) > 0 {
i -= len(m.Payload)
copy(dAtA[i:], m.Payload)
i = encodeVarintGovernance(dAtA, i, uint64(len(m.Payload)))
i--
dAtA[i] = 0x32
}
if m.TargetChain != 0 {
i = encodeVarintGovernance(dAtA, i, uint64(m.TargetChain))
i--
dAtA[i] = 0x28
}
if len(m.Module) > 0 {
i -= len(m.Module)
copy(dAtA[i:], m.Module)
i = encodeVarintGovernance(dAtA, i, uint64(len(m.Module)))
i--
dAtA[i] = 0x22
}
if m.Action != 0 {
i = encodeVarintGovernance(dAtA, i, uint64(m.Action))
i--
dAtA[i] = 0x18
}
if len(m.Description) > 0 {
i -= len(m.Description)
copy(dAtA[i:], m.Description)
i = encodeVarintGovernance(dAtA, i, uint64(len(m.Description)))
i--
dAtA[i] = 0x12
}
if len(m.Title) > 0 {
i -= len(m.Title)
copy(dAtA[i:], m.Title)
i = encodeVarintGovernance(dAtA, i, uint64(len(m.Title)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintGovernance(dAtA []byte, offset int, v uint64) int {
offset -= sovGovernance(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *GuardianSetUpdateProposal) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Title)
if l > 0 {
n += 1 + l + sovGovernance(uint64(l))
}
l = len(m.Description)
if l > 0 {
n += 1 + l + sovGovernance(uint64(l))
}
l = m.NewGuardianSet.Size()
n += 1 + l + sovGovernance(uint64(l))
return n
}
func (m *GovernanceWormholeMessageProposal) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Title)
if l > 0 {
n += 1 + l + sovGovernance(uint64(l))
}
l = len(m.Description)
if l > 0 {
n += 1 + l + sovGovernance(uint64(l))
}
if m.Action != 0 {
n += 1 + sovGovernance(uint64(m.Action))
}
l = len(m.Module)
if l > 0 {
n += 1 + l + sovGovernance(uint64(l))
}
if m.TargetChain != 0 {
n += 1 + sovGovernance(uint64(m.TargetChain))
}
l = len(m.Payload)
if l > 0 {
n += 1 + l + sovGovernance(uint64(l))
}
return n
}
func sovGovernance(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozGovernance(x uint64) (n int) {
return sovGovernance(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GuardianSetUpdateProposal) 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 ErrIntOverflowGovernance
}
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: GuardianSetUpdateProposal: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GuardianSetUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGovernance
}
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 ErrInvalidLengthGovernance
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGovernance
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Title = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGovernance
}
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 ErrInvalidLengthGovernance
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGovernance
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Description = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field NewGuardianSet", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGovernance
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGovernance
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthGovernance
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.NewGuardianSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGovernance(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGovernance
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *GovernanceWormholeMessageProposal) 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 ErrIntOverflowGovernance
}
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: GovernanceWormholeMessageProposal: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GovernanceWormholeMessageProposal: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGovernance
}
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 ErrInvalidLengthGovernance
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGovernance
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Title = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGovernance
}
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 ErrInvalidLengthGovernance
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthGovernance
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Description = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
}
m.Action = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGovernance
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Action |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGovernance
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthGovernance
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthGovernance
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Module = append(m.Module[:0], dAtA[iNdEx:postIndex]...)
if m.Module == nil {
m.Module = []byte{}
}
iNdEx = postIndex
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field TargetChain", wireType)
}
m.TargetChain = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGovernance
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.TargetChain |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGovernance
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthGovernance
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthGovernance
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...)
if m.Payload == nil {
m.Payload = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGovernance(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGovernance
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGovernance(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGovernance
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGovernance
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGovernance
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthGovernance
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupGovernance
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthGovernance
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthGovernance = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGovernance = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupGovernance = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -0,0 +1,317 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: wormhole/guardian_key.proto
package types
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type GuardianKey struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
}
func (m *GuardianKey) Reset() { *m = GuardianKey{} }
func (m *GuardianKey) String() string { return proto.CompactTextString(m) }
func (*GuardianKey) ProtoMessage() {}
func (*GuardianKey) Descriptor() ([]byte, []int) {
return fileDescriptor_87576a0b45454f44, []int{0}
}
func (m *GuardianKey) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GuardianKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GuardianKey.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 *GuardianKey) XXX_Merge(src proto.Message) {
xxx_messageInfo_GuardianKey.Merge(m, src)
}
func (m *GuardianKey) XXX_Size() int {
return m.Size()
}
func (m *GuardianKey) XXX_DiscardUnknown() {
xxx_messageInfo_GuardianKey.DiscardUnknown(m)
}
var xxx_messageInfo_GuardianKey proto.InternalMessageInfo
func (m *GuardianKey) GetKey() []byte {
if m != nil {
return m.Key
}
return nil
}
func init() {
proto.RegisterType((*GuardianKey)(nil), "wormhole_foundation.wormchain.wormhole.GuardianKey")
}
func init() { proto.RegisterFile("wormhole/guardian_key.proto", fileDescriptor_87576a0b45454f44) }
var fileDescriptor_87576a0b45454f44 = []byte{
// 168 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xcf, 0x2f, 0xca,
0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0x2f, 0x4d, 0x2c, 0x4a, 0xc9, 0x4c, 0xcc, 0x8b, 0xcf, 0x4e,
0xad, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83, 0x49, 0xc6, 0xa7, 0xe5, 0x97, 0xe6,
0xa5, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0xe9, 0x81, 0xc4, 0x92, 0x33, 0x12, 0x33, 0x21, 0x2c, 0x90,
0xac, 0x92, 0x3c, 0x17, 0xb7, 0x3b, 0x54, 0xb7, 0x77, 0x6a, 0xa5, 0x90, 0x00, 0x17, 0x73, 0x76,
0x6a, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x4f, 0x10, 0x88, 0xe9, 0x14, 0x7c, 0xe2, 0x91, 0x1c,
0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1,
0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x96, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9,
0xf9, 0xb9, 0xfa, 0x30, 0xf3, 0x74, 0x11, 0xb6, 0xe9, 0xc3, 0x6d, 0xd3, 0xaf, 0x80, 0xcb, 0xeb,
0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x69, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff,
0x63, 0x2f, 0xc8, 0x4a, 0xc3, 0x00, 0x00, 0x00,
}
func (m *GuardianKey) 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 *GuardianKey) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GuardianKey) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Key) > 0 {
i -= len(m.Key)
copy(dAtA[i:], m.Key)
i = encodeVarintGuardianKey(dAtA, i, uint64(len(m.Key)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintGuardianKey(dAtA []byte, offset int, v uint64) int {
offset -= sovGuardianKey(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *GuardianKey) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Key)
if l > 0 {
n += 1 + l + sovGuardianKey(uint64(l))
}
return n
}
func sovGuardianKey(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozGuardianKey(x uint64) (n int) {
return sovGuardianKey(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GuardianKey) 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 ErrIntOverflowGuardianKey
}
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: GuardianKey: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GuardianKey: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGuardianKey
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthGuardianKey
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthGuardianKey
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
if m.Key == nil {
m.Key = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGuardianKey(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGuardianKey
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGuardianKey(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGuardianKey
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGuardianKey
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGuardianKey
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthGuardianKey
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupGuardianKey
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthGuardianKey
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthGuardianKey = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGuardianKey = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupGuardianKey = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -0,0 +1,430 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: wormhole/guardian_set.proto
package types
import (
bytes "bytes"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type GuardianSet struct {
Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
Keys [][]byte `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"`
ExpirationTime uint64 `protobuf:"varint,3,opt,name=expirationTime,proto3" json:"expirationTime,omitempty"`
}
func (m *GuardianSet) Reset() { *m = GuardianSet{} }
func (m *GuardianSet) String() string { return proto.CompactTextString(m) }
func (*GuardianSet) ProtoMessage() {}
func (*GuardianSet) Descriptor() ([]byte, []int) {
return fileDescriptor_3a6a773f49e89397, []int{0}
}
func (m *GuardianSet) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GuardianSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GuardianSet.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 *GuardianSet) XXX_Merge(src proto.Message) {
xxx_messageInfo_GuardianSet.Merge(m, src)
}
func (m *GuardianSet) XXX_Size() int {
return m.Size()
}
func (m *GuardianSet) XXX_DiscardUnknown() {
xxx_messageInfo_GuardianSet.DiscardUnknown(m)
}
var xxx_messageInfo_GuardianSet proto.InternalMessageInfo
func (m *GuardianSet) GetIndex() uint32 {
if m != nil {
return m.Index
}
return 0
}
func (m *GuardianSet) GetKeys() [][]byte {
if m != nil {
return m.Keys
}
return nil
}
func (m *GuardianSet) GetExpirationTime() uint64 {
if m != nil {
return m.ExpirationTime
}
return 0
}
func init() {
proto.RegisterType((*GuardianSet)(nil), "wormhole_foundation.wormchain.wormhole.GuardianSet")
}
func init() { proto.RegisterFile("wormhole/guardian_set.proto", fileDescriptor_3a6a773f49e89397) }
var fileDescriptor_3a6a773f49e89397 = []byte{
// 231 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xcf, 0x2f, 0xca,
0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0x2f, 0x4d, 0x2c, 0x4a, 0xc9, 0x4c, 0xcc, 0x8b, 0x2f, 0x4e,
0x2d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83, 0x49, 0xc6, 0xa7, 0xe5, 0x97, 0xe6,
0xa5, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0xe9, 0x81, 0xc4, 0x92, 0x33, 0x12, 0x33, 0x21, 0x2c, 0x90,
0xac, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x58, 0x8b, 0x3e, 0x88, 0x05, 0xd1, 0xad, 0x94, 0xca,
0xc5, 0xed, 0x0e, 0x35, 0x33, 0x38, 0xb5, 0x44, 0x48, 0x84, 0x8b, 0x35, 0x33, 0x2f, 0x25, 0xb5,
0x42, 0x82, 0x51, 0x81, 0x51, 0x83, 0x37, 0x08, 0xc2, 0x11, 0x12, 0xe2, 0x62, 0xc9, 0x4e, 0xad,
0x2c, 0x96, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x09, 0x02, 0xb3, 0x85, 0xd4, 0xb8, 0xf8, 0x52, 0x2b,
0x0a, 0x32, 0x8b, 0xc0, 0xf6, 0x85, 0x64, 0xe6, 0xa6, 0x4a, 0x30, 0x2b, 0x30, 0x6a, 0xb0, 0x04,
0xa1, 0x89, 0x5a, 0xb1, 0xbc, 0x58, 0x20, 0xcf, 0xe8, 0x14, 0x7c, 0xe2, 0x91, 0x1c, 0xe3, 0x85,
0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3,
0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x96, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9,
0xfa, 0x30, 0xb7, 0xea, 0x22, 0x7c, 0xa2, 0x0f, 0xf7, 0x89, 0x7e, 0x05, 0x5c, 0x5e, 0xbf, 0xa4,
0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x05, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x97,
0xa8, 0x99, 0x25, 0x1f, 0x01, 0x00, 0x00,
}
func (this *GuardianSet) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*GuardianSet)
if !ok {
that2, ok := that.(GuardianSet)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.Index != that1.Index {
return false
}
if len(this.Keys) != len(that1.Keys) {
return false
}
for i := range this.Keys {
if !bytes.Equal(this.Keys[i], that1.Keys[i]) {
return false
}
}
if this.ExpirationTime != that1.ExpirationTime {
return false
}
return true
}
func (m *GuardianSet) 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 *GuardianSet) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GuardianSet) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.ExpirationTime != 0 {
i = encodeVarintGuardianSet(dAtA, i, uint64(m.ExpirationTime))
i--
dAtA[i] = 0x18
}
if len(m.Keys) > 0 {
for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Keys[iNdEx])
copy(dAtA[i:], m.Keys[iNdEx])
i = encodeVarintGuardianSet(dAtA, i, uint64(len(m.Keys[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if m.Index != 0 {
i = encodeVarintGuardianSet(dAtA, i, uint64(m.Index))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintGuardianSet(dAtA []byte, offset int, v uint64) int {
offset -= sovGuardianSet(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *GuardianSet) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Index != 0 {
n += 1 + sovGuardianSet(uint64(m.Index))
}
if len(m.Keys) > 0 {
for _, b := range m.Keys {
l = len(b)
n += 1 + l + sovGuardianSet(uint64(l))
}
}
if m.ExpirationTime != 0 {
n += 1 + sovGuardianSet(uint64(m.ExpirationTime))
}
return n
}
func sovGuardianSet(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozGuardianSet(x uint64) (n int) {
return sovGuardianSet(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GuardianSet) 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 ErrIntOverflowGuardianSet
}
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: GuardianSet: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GuardianSet: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
}
m.Index = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGuardianSet
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Index |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGuardianSet
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthGuardianSet
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthGuardianSet
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx))
copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType)
}
m.ExpirationTime = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGuardianSet
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ExpirationTime |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipGuardianSet(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGuardianSet
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGuardianSet(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGuardianSet
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGuardianSet
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGuardianSet
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthGuardianSet
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupGuardianSet
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthGuardianSet
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthGuardianSet = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGuardianSet = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupGuardianSet = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -0,0 +1,372 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: wormhole/guardian_validator.proto
package types
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type GuardianValidator struct {
GuardianKey []byte `protobuf:"bytes,1,opt,name=guardianKey,proto3" json:"guardianKey,omitempty"`
ValidatorAddr []byte `protobuf:"bytes,2,opt,name=validatorAddr,proto3" json:"validatorAddr,omitempty"`
}
func (m *GuardianValidator) Reset() { *m = GuardianValidator{} }
func (m *GuardianValidator) String() string { return proto.CompactTextString(m) }
func (*GuardianValidator) ProtoMessage() {}
func (*GuardianValidator) Descriptor() ([]byte, []int) {
return fileDescriptor_a7e08ab792af660a, []int{0}
}
func (m *GuardianValidator) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GuardianValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GuardianValidator.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 *GuardianValidator) XXX_Merge(src proto.Message) {
xxx_messageInfo_GuardianValidator.Merge(m, src)
}
func (m *GuardianValidator) XXX_Size() int {
return m.Size()
}
func (m *GuardianValidator) XXX_DiscardUnknown() {
xxx_messageInfo_GuardianValidator.DiscardUnknown(m)
}
var xxx_messageInfo_GuardianValidator proto.InternalMessageInfo
func (m *GuardianValidator) GetGuardianKey() []byte {
if m != nil {
return m.GuardianKey
}
return nil
}
func (m *GuardianValidator) GetValidatorAddr() []byte {
if m != nil {
return m.ValidatorAddr
}
return nil
}
func init() {
proto.RegisterType((*GuardianValidator)(nil), "wormhole_foundation.wormchain.wormhole.GuardianValidator")
}
func init() { proto.RegisterFile("wormhole/guardian_validator.proto", fileDescriptor_a7e08ab792af660a) }
var fileDescriptor_a7e08ab792af660a = []byte{
// 193 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0xcf, 0x2f, 0xca,
0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0x2f, 0x4d, 0x2c, 0x4a, 0xc9, 0x4c, 0xcc, 0x8b, 0x2f, 0x4b,
0xcc, 0xc9, 0x4c, 0x49, 0x2c, 0xc9, 0x2f, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83,
0x29, 0x89, 0x4f, 0xcb, 0x2f, 0xcd, 0x4b, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x89, 0x25,
0x67, 0x24, 0x66, 0x42, 0x58, 0x20, 0x59, 0xa5, 0x68, 0x2e, 0x41, 0x77, 0xa8, 0x19, 0x61, 0x30,
0x23, 0x84, 0x14, 0xb8, 0xb8, 0x61, 0x06, 0x7b, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0,
0x04, 0x21, 0x0b, 0x09, 0xa9, 0x70, 0xf1, 0xc2, 0x6d, 0x74, 0x4c, 0x49, 0x29, 0x92, 0x60, 0x02,
0xab, 0x41, 0x15, 0x74, 0x0a, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f,
0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28,
0xcb, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x98, 0x5b, 0x74, 0x11,
0x2e, 0xd5, 0x87, 0xbb, 0x54, 0xbf, 0x02, 0x2e, 0xaf, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4,
0x06, 0xf6, 0xa0, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x50, 0x80, 0xd5, 0x79, 0x05, 0x01, 0x00,
0x00,
}
func (m *GuardianValidator) 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 *GuardianValidator) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *GuardianValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.ValidatorAddr) > 0 {
i -= len(m.ValidatorAddr)
copy(dAtA[i:], m.ValidatorAddr)
i = encodeVarintGuardianValidator(dAtA, i, uint64(len(m.ValidatorAddr)))
i--
dAtA[i] = 0x12
}
if len(m.GuardianKey) > 0 {
i -= len(m.GuardianKey)
copy(dAtA[i:], m.GuardianKey)
i = encodeVarintGuardianValidator(dAtA, i, uint64(len(m.GuardianKey)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintGuardianValidator(dAtA []byte, offset int, v uint64) int {
offset -= sovGuardianValidator(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *GuardianValidator) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.GuardianKey)
if l > 0 {
n += 1 + l + sovGuardianValidator(uint64(l))
}
l = len(m.ValidatorAddr)
if l > 0 {
n += 1 + l + sovGuardianValidator(uint64(l))
}
return n
}
func sovGuardianValidator(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozGuardianValidator(x uint64) (n int) {
return sovGuardianValidator(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *GuardianValidator) 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 ErrIntOverflowGuardianValidator
}
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: GuardianValidator: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: GuardianValidator: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field GuardianKey", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGuardianValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthGuardianValidator
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthGuardianValidator
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.GuardianKey = append(m.GuardianKey[:0], dAtA[iNdEx:postIndex]...)
if m.GuardianKey == nil {
m.GuardianKey = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGuardianValidator
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthGuardianValidator
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthGuardianValidator
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ValidatorAddr = append(m.ValidatorAddr[:0], dAtA[iNdEx:postIndex]...)
if m.ValidatorAddr == nil {
m.ValidatorAddr = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGuardianValidator(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthGuardianValidator
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipGuardianValidator(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGuardianValidator
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGuardianValidator
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowGuardianValidator
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthGuardianValidator
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupGuardianValidator
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthGuardianValidator
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthGuardianValidator = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowGuardianValidator = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupGuardianValidator = fmt.Errorf("proto: unexpected end of group")
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,315 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: wormhole/replay_protection.proto
package types
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type ReplayProtection struct {
Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
}
func (m *ReplayProtection) Reset() { *m = ReplayProtection{} }
func (m *ReplayProtection) String() string { return proto.CompactTextString(m) }
func (*ReplayProtection) ProtoMessage() {}
func (*ReplayProtection) Descriptor() ([]byte, []int) {
return fileDescriptor_da495f697a0fb01c, []int{0}
}
func (m *ReplayProtection) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ReplayProtection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ReplayProtection.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 *ReplayProtection) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplayProtection.Merge(m, src)
}
func (m *ReplayProtection) XXX_Size() int {
return m.Size()
}
func (m *ReplayProtection) XXX_DiscardUnknown() {
xxx_messageInfo_ReplayProtection.DiscardUnknown(m)
}
var xxx_messageInfo_ReplayProtection proto.InternalMessageInfo
func (m *ReplayProtection) GetIndex() string {
if m != nil {
return m.Index
}
return ""
}
func init() {
proto.RegisterType((*ReplayProtection)(nil), "wormhole_foundation.wormchain.wormhole.ReplayProtection")
}
func init() { proto.RegisterFile("wormhole/replay_protection.proto", fileDescriptor_da495f697a0fb01c) }
var fileDescriptor_da495f697a0fb01c = []byte{
// 170 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xcf, 0x2f, 0xca,
0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x2f, 0x4a, 0x2d, 0xc8, 0x49, 0xac, 0x8c, 0x2f, 0x28, 0xca, 0x2f,
0x49, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x31, 0xf3, 0x85, 0xd4, 0x60, 0x2a, 0xe2, 0xd3,
0xf2, 0x4b, 0xf3, 0x52, 0x12, 0xc1, 0x52, 0x20, 0xb1, 0xe4, 0x8c, 0xc4, 0x4c, 0x08, 0x0b, 0x24,
0xab, 0xa4, 0xc1, 0x25, 0x10, 0x04, 0x36, 0x22, 0x00, 0x6e, 0x82, 0x90, 0x08, 0x17, 0x6b, 0x66,
0x5e, 0x4a, 0x6a, 0x85, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x84, 0xe3, 0x14, 0x7c, 0xe2,
0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70,
0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x96, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49,
0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x30, 0x83, 0x75, 0x11, 0xd6, 0xea, 0xc3, 0xad, 0xd5, 0xaf, 0x80,
0xcb, 0xeb, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x5d, 0x6b, 0x0c, 0x08, 0x00, 0x00,
0xff, 0xff, 0xca, 0x3f, 0x36, 0x04, 0xd1, 0x00, 0x00, 0x00,
}
func (m *ReplayProtection) 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 *ReplayProtection) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ReplayProtection) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Index) > 0 {
i -= len(m.Index)
copy(dAtA[i:], m.Index)
i = encodeVarintReplayProtection(dAtA, i, uint64(len(m.Index)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintReplayProtection(dAtA []byte, offset int, v uint64) int {
offset -= sovReplayProtection(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *ReplayProtection) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Index)
if l > 0 {
n += 1 + l + sovReplayProtection(uint64(l))
}
return n
}
func sovReplayProtection(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozReplayProtection(x uint64) (n int) {
return sovReplayProtection(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *ReplayProtection) 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 ErrIntOverflowReplayProtection
}
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: ReplayProtection: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: ReplayProtection: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowReplayProtection
}
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 ErrInvalidLengthReplayProtection
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthReplayProtection
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Index = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipReplayProtection(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthReplayProtection
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipReplayProtection(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowReplayProtection
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowReplayProtection
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowReplayProtection
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthReplayProtection
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupReplayProtection
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthReplayProtection
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthReplayProtection = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowReplayProtection = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupReplayProtection = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -0,0 +1,351 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: wormhole/sequence_counter.proto
package types
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type SequenceCounter struct {
Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"`
}
func (m *SequenceCounter) Reset() { *m = SequenceCounter{} }
func (m *SequenceCounter) String() string { return proto.CompactTextString(m) }
func (*SequenceCounter) ProtoMessage() {}
func (*SequenceCounter) Descriptor() ([]byte, []int) {
return fileDescriptor_adec725923edb1a5, []int{0}
}
func (m *SequenceCounter) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SequenceCounter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SequenceCounter.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 *SequenceCounter) XXX_Merge(src proto.Message) {
xxx_messageInfo_SequenceCounter.Merge(m, src)
}
func (m *SequenceCounter) XXX_Size() int {
return m.Size()
}
func (m *SequenceCounter) XXX_DiscardUnknown() {
xxx_messageInfo_SequenceCounter.DiscardUnknown(m)
}
var xxx_messageInfo_SequenceCounter proto.InternalMessageInfo
func (m *SequenceCounter) GetIndex() string {
if m != nil {
return m.Index
}
return ""
}
func (m *SequenceCounter) GetSequence() uint64 {
if m != nil {
return m.Sequence
}
return 0
}
func init() {
proto.RegisterType((*SequenceCounter)(nil), "wormhole_foundation.wormchain.wormhole.SequenceCounter")
}
func init() { proto.RegisterFile("wormhole/sequence_counter.proto", fileDescriptor_adec725923edb1a5) }
var fileDescriptor_adec725923edb1a5 = []byte{
// 190 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xcf, 0x2f, 0xca,
0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x2f, 0x4e, 0x2d, 0x2c, 0x4d, 0xcd, 0x4b, 0x4e, 0x8d, 0x4f, 0xce,
0x2f, 0xcd, 0x2b, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83, 0x29, 0x88,
0x4f, 0xcb, 0x2f, 0xcd, 0x4b, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x89, 0x25, 0x67, 0x24,
0x66, 0x42, 0x58, 0x20, 0x59, 0x25, 0x67, 0x2e, 0xfe, 0x60, 0xa8, 0x09, 0xce, 0x10, 0x03, 0x84,
0x44, 0xb8, 0x58, 0x33, 0xf3, 0x52, 0x52, 0x2b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x20,
0x1c, 0x21, 0x29, 0x2e, 0x0e, 0x98, 0x55, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x70, 0xbe,
0x53, 0xf0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1,
0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x59, 0xa6, 0x67, 0x96,
0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0xec, 0xd4, 0x45, 0xb8, 0x48, 0x1f, 0xee,
0x22, 0xfd, 0x0a, 0xb8, 0xbc, 0x7e, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x23, 0xc6,
0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x9e, 0xfe, 0x1f, 0xeb, 0x00, 0x00, 0x00,
}
func (m *SequenceCounter) 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 *SequenceCounter) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *SequenceCounter) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Sequence != 0 {
i = encodeVarintSequenceCounter(dAtA, i, uint64(m.Sequence))
i--
dAtA[i] = 0x10
}
if len(m.Index) > 0 {
i -= len(m.Index)
copy(dAtA[i:], m.Index)
i = encodeVarintSequenceCounter(dAtA, i, uint64(len(m.Index)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintSequenceCounter(dAtA []byte, offset int, v uint64) int {
offset -= sovSequenceCounter(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *SequenceCounter) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Index)
if l > 0 {
n += 1 + l + sovSequenceCounter(uint64(l))
}
if m.Sequence != 0 {
n += 1 + sovSequenceCounter(uint64(m.Sequence))
}
return n
}
func sovSequenceCounter(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozSequenceCounter(x uint64) (n int) {
return sovSequenceCounter(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *SequenceCounter) 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 ErrIntOverflowSequenceCounter
}
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: SequenceCounter: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: SequenceCounter: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSequenceCounter
}
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 ErrInvalidLengthSequenceCounter
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthSequenceCounter
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Index = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType)
}
m.Sequence = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSequenceCounter
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Sequence |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipSequenceCounter(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSequenceCounter
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipSequenceCounter(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowSequenceCounter
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowSequenceCounter
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowSequenceCounter
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthSequenceCounter
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupSequenceCounter
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthSequenceCounter
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthSequenceCounter = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowSequenceCounter = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupSequenceCounter = fmt.Errorf("proto: unexpected end of group")
)

File diff suppressed because it is too large Load Diff