types

package
v3.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RollappPacket events
	AttributeKeyRollappId                = "rollapp_id"
	AttributeKeyPacketStatus             = "status"
	AttributeKeyPacketSourcePort         = "source_port"
	AttributeKeyPacketSourceChannel      = "source_channel"
	AttributeKeyPacketDestinationPort    = "destination_port"
	AttributeKeyPacketDestinationChannel = "destination_channel"
	AttributeKeyPacketSequence           = "packet_sequence"
	AttributeKeyPacketError              = "error"
)

Variables

View Source
var (
	// AllRollappPacketKeyPrefix is the prefix to retrieve all RollappPackets
	AllRollappPacketKeyPrefix = []byte{0x00}
	// PendingRollappPacketKeyPrefix is the prefix for pending rollapp packets
	PendingRollappPacketKeyPrefix = []byte{0x00, 0x01}
	// FinalizedRollappPacketKeyPrefix is the prefix for finalized rollapp packets
	FinalizedRollappPacketKeyPrefix = []byte{0x00, 0x02}
	// RevertedRollappPacketKeyPrefix is the prefix for reverted rollapp packets
	RevertedRollappPacketKeyPrefix = []byte{0x00, 0x03}
)
View Source
var (
	ErrInvalidLengthRollappPacket        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRollappPacket          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRollappPacket = fmt.Errorf("proto: unexpected end of group")
)
View Source
var RollappPacket_Type_name = map[int32]string{
	0: "ON_RECV",
	1: "ON_ACK",
	2: "ON_TIMEOUT",
}
View Source
var RollappPacket_Type_value = map[string]int32{
	"ON_RECV":    0,
	"ON_ACK":     1,
	"ON_TIMEOUT": 2,
}
View Source
var Status_name = map[int32]string{
	0: "PENDING",
	1: "FINALIZED",
	3: "REVERTED",
}
View Source
var Status_value = map[string]int32{
	"PENDING":   0,
	"FINALIZED": 1,
	"REVERTED":  3,
}

Functions

func MustGetStatusBytes

func MustGetStatusBytes(status Status) []byte

MustGetStatusBytes returns the byte representation of the status

func RollappPacketByRollappIDPrefix

func RollappPacketByRollappIDPrefix(rollappID string) []byte

RollappPacketByRollappIDPrefix constructs a key prefix for a specific RollappPacket by rollappID: "rollappID/"

func RollappPacketByStatusByRollappIDByProofHeightPrefix

func RollappPacketByStatusByRollappIDByProofHeightPrefix(rollappID string, status Status, proofHeight uint64) []byte

RollappPacketByStatusByRollappIDByProofHeightPrefix constructs a key prefix for a specific RollappPacket by rollappID, status and proofHeight: "rollappID/status/proofHeight"

func RollappPacketByStatusByRollappIDPrefix

func RollappPacketByStatusByRollappIDPrefix(status Status, rollappID string) (result []byte)

RollappPacketByStatusByRollappIDPrefix constructs a key prefix for a specific RollappPacket by status and rollappID: "status/rollappID/"

func RollappPacketByStatusPrefix

func RollappPacketByStatusPrefix(status Status) []byte

RollappPacketByStatusPrefix constructs a key prefix for a specific RollappPacket by status: "status/"

func RollappPacketKey

func RollappPacketKey(rollappPacket *RollappPacket) []byte

RollappPacketKey constructs a key for a specific RollappPacket of the form: status/rollappID/proofHeight/packetType/packetSourceChannel/packetSequence.

In order to build a packet UID We need to take the source channel + packet + packet type as the packet UID otherwise we're not guaranteed with uniqueness as we could have: Same rollapp id, same status, same proof height same sequence (as it refers to the source chain) and same channel. Example would be, both rollapp and hub have channel-0 and we have at the same proof height of the rollapp AckPacket with sequence 1 (originated on the hub) and OnRecvPacket with sequence 1 (originated on the rollapp). Adding the packet type guarantees uniqueness as the type differentiate the source.

Types

type PacketUID

type PacketUID struct {
	Type              RollappPacket_Type
	RollappHubPort    string
	RollappHubChannel string
	Sequence          uint64
}

PacketUID is a unique identifier for an Rollapp IBC packet on the hub

func NewPacketUID

func NewPacketUID(packetType RollappPacket_Type, hubPort string, hubChannel string, sequence uint64) PacketUID

NewPacketUID creates a new PacketUID with the provided details.

func (PacketUID) String

func (p PacketUID) String() string

String returns a string representation of the PacketUID

type RollappPacket

type RollappPacket struct {
	RollappId       string             `protobuf:"bytes,1,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"`
	Packet          *types.Packet      `protobuf:"bytes,2,opt,name=packet,proto3" json:"packet,omitempty"`
	Acknowledgement []byte             `protobuf:"bytes,3,opt,name=acknowledgement,proto3" json:"acknowledgement,omitempty"`
	Status          Status             `protobuf:"varint,4,opt,name=status,proto3,enum=dymensionxyz.dymension.common.Status" json:"status,omitempty"`
	ProofHeight     uint64             `protobuf:"varint,5,opt,name=ProofHeight,proto3" json:"ProofHeight,omitempty"`
	Relayer         []byte             `protobuf:"bytes,6,opt,name=relayer,proto3" json:"relayer,omitempty"`
	Type            RollappPacket_Type `protobuf:"varint,7,opt,name=type,proto3,enum=dymensionxyz.dymension.common.RollappPacket_Type" json:"type,omitempty"`
	// stores the result of onAck, onTimeout or onRecv/writeAck
	Error string `protobuf:"bytes,8,opt,name=error,proto3" json:"error,omitempty"`
	// who was the original person who gets the money (recipient of ics20 transfer) of the packet?
	OriginalTransferTarget string `` /* 129-byte string literal not displayed */
}

func (*RollappPacket) Descriptor

func (*RollappPacket) Descriptor() ([]byte, []int)

func (*RollappPacket) GetAcknowledgement

func (m *RollappPacket) GetAcknowledgement() []byte

func (*RollappPacket) GetError

func (m *RollappPacket) GetError() string

func (RollappPacket) GetEvents

func (r RollappPacket) GetEvents() []sdk.Attribute

func (*RollappPacket) GetOriginalTransferTarget

func (m *RollappPacket) GetOriginalTransferTarget() string

func (*RollappPacket) GetPacket

func (m *RollappPacket) GetPacket() *types.Packet

func (*RollappPacket) GetProofHeight

func (m *RollappPacket) GetProofHeight() uint64

func (*RollappPacket) GetRelayer

func (m *RollappPacket) GetRelayer() []byte

func (*RollappPacket) GetRollappId

func (m *RollappPacket) GetRollappId() string

func (*RollappPacket) GetStatus

func (m *RollappPacket) GetStatus() Status

func (RollappPacket) GetTransferPacketData

func (r RollappPacket) GetTransferPacketData() (transfertypes.FungibleTokenPacketData, error)

func (*RollappPacket) GetType

func (m *RollappPacket) GetType() RollappPacket_Type

func (*RollappPacket) Marshal

func (m *RollappPacket) Marshal() (dAtA []byte, err error)

func (*RollappPacket) MarshalTo

func (m *RollappPacket) MarshalTo(dAtA []byte) (int, error)

func (*RollappPacket) MarshalToSizedBuffer

func (m *RollappPacket) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RollappPacket) ProtoMessage

func (*RollappPacket) ProtoMessage()

func (*RollappPacket) Reset

func (m *RollappPacket) Reset()

func (RollappPacket) RestoreOriginalTransferTarget

func (r RollappPacket) RestoreOriginalTransferTarget() (RollappPacket, error)

func (*RollappPacket) Size

func (m *RollappPacket) Size() (n int)

func (*RollappPacket) String

func (m *RollappPacket) String() string

func (*RollappPacket) Unmarshal

func (m *RollappPacket) Unmarshal(dAtA []byte) error

func (*RollappPacket) XXX_DiscardUnknown

func (m *RollappPacket) XXX_DiscardUnknown()

func (*RollappPacket) XXX_Marshal

func (m *RollappPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RollappPacket) XXX_Merge

func (m *RollappPacket) XXX_Merge(src proto.Message)

func (*RollappPacket) XXX_Size

func (m *RollappPacket) XXX_Size() int

func (*RollappPacket) XXX_Unmarshal

func (m *RollappPacket) XXX_Unmarshal(b []byte) error

type RollappPacket_Type

type RollappPacket_Type int32
const (
	RollappPacket_ON_RECV    RollappPacket_Type = 0
	RollappPacket_ON_ACK     RollappPacket_Type = 1
	RollappPacket_ON_TIMEOUT RollappPacket_Type = 2
)

func (RollappPacket_Type) EnumDescriptor

func (RollappPacket_Type) EnumDescriptor() ([]byte, []int)

func (RollappPacket_Type) String

func (x RollappPacket_Type) String() string

type Status

type Status int32
const (
	Status_PENDING   Status = 0
	Status_FINALIZED Status = 1
	Status_REVERTED  Status = 3
)

func (Status) EnumDescriptor

func (Status) EnumDescriptor() ([]byte, []int)

func (Status) String

func (x Status) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL