stateChange

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: GPL-3.0 Imports: 10 Imported by: 3 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// NoChange is the default value for account changes
	NoChange = uint32(0)
	// NonceChanged is the location of the bit that represents the NonceChanged change
	NonceChanged = uint32(1)
	// BalanceChanged is the location of the bit that represents the BalanceChanged change
	BalanceChanged = uint32(2)
	// CodeHashChanged is the location of the bit that represents the CodeHashChanged change
	CodeHashChanged = uint32(4)
	// RootHashChanged is the location of the bit that represents the RootHashChanged change
	RootHashChanged = uint32(8)
	// DeveloperRewardChanged is the location of the bit that represents the DeveloperRewardChanged change
	DeveloperRewardChanged = uint32(16)
	// OwnerAddressChanged is the location of the bit that represents the OwnerAddressChanged change
	OwnerAddressChanged = uint32(32)
	// UserNameChanged is the location of the bit that represents the UserNameChanged change
	UserNameChanged = uint32(64)
	// CodeMetadataChanged is the location of the bit that represents the CodeMetadataChanged change
	CodeMetadataChanged = uint32(128)
)
View Source
const (
	// NotSet is the default value for state access operation
	NotSet = uint32(0)
	// GetCode is the location of the bit that represents the GetCode operation
	GetCode = uint32(1)
	// SaveAccount is the location of the bit that represents the SaveAccount operation
	SaveAccount = uint32(2)
	// GetAccount is the location of the bit that represents the GetAccount operation
	GetAccount = uint32(4)
	// WriteCode is the location of the bit that represents the WriteCode operation
	WriteCode = uint32(8)
	// RemoveDataTrie is the location of the bit that represents the RemoveDataTrie operation
	RemoveDataTrie = uint32(16)
	// GetDataTrieValue is the location of the bit that represents the GetDataTrieValue operation
	GetDataTrieValue = uint32(32)
)
View Source
const (
	// NotSetString is the string representation of the NotSet operation
	NotSetString = "NotSet"
	// GetCodeString is the string representation of the GetCode operation
	GetCodeString = "GetCode"
	// SaveAccountString is the string representation of the SaveAccount operation
	SaveAccountString = "SaveAccount"
	// GetAccountString is the string representation of the GetAccount operation
	GetAccountString = "GetAccount"
	// WriteCodeString is the string representation of the WriteCode operation
	WriteCodeString = "WriteCode"
	// RemoveDataTrieString is the string representation of the RemoveDataTrie operation
	RemoveDataTrieString = "RemoveDataTrie"
	// GetDataTrieValueString is the string representation of the GetDataTrieValue operation
	GetDataTrieValueString = "GetDataTrieValue"
)

Variables

View Source
var (
	ErrInvalidLengthStateChange        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStateChange          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupStateChange = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ActionType_name = map[int32]string{
	0: "Read",
	1: "Write",
}
View Source
var ActionType_value = map[string]int32{
	"Read":  0,
	"Write": 1,
}

Functions

func AddAccountChange

func AddAccountChange(changes uint32, change uint32) uint32

AddAccountChange adds a change to the current changes and returns the updated changes

func GetOperationFromString

func GetOperationFromString(operation string) uint32

GetOperationFromString converts a string representation of an operation to its corresponding uint32 value.

func GetOperationString

func GetOperationString(operation uint32) string

GetOperationString converts a uint32 operation to its string representation.

func MergeOperations

func MergeOperations(operation1, operation2 uint32) uint32

MergeOperations combines two uint32 operations using a bitwise OR and returns the resulting value.

Types

type ActionType

type ActionType int32
const (
	Read  ActionType = 0
	Write ActionType = 1
)

func (ActionType) EnumDescriptor

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

func (ActionType) String

func (x ActionType) String() string

type DataTrieChange

type DataTrieChange struct {
	Type      ActionType `protobuf:"varint,1,opt,name=Type,proto3,enum=proto.ActionType" json:"type"`
	Key       []byte     `protobuf:"bytes,2,opt,name=Key,proto3" json:"key"`
	Val       []byte     `protobuf:"bytes,3,opt,name=Val,proto3" json:"val"`
	Version   uint32     `protobuf:"varint,4,opt,name=Version,proto3" json:"version"`
	Operation uint32     `protobuf:"varint,5,opt,name=Operation,proto3" json:"operation"`
}

func MergeDataTrieChanges

func MergeDataTrieChanges(oldDataTrieChanges, newDataTrieChanges []*DataTrieChange) []*DataTrieChange

MergeDataTrieChanges combines two lists of DataTrieChange items into a single list, merging changes with overlapping keys.

func (*DataTrieChange) Descriptor

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

func (*DataTrieChange) Equal

func (this *DataTrieChange) Equal(that interface{}) bool

func (*DataTrieChange) GetKey

func (m *DataTrieChange) GetKey() []byte

func (*DataTrieChange) GetOperation

func (m *DataTrieChange) GetOperation() uint32

func (*DataTrieChange) GetType

func (m *DataTrieChange) GetType() ActionType

func (*DataTrieChange) GetVal

func (m *DataTrieChange) GetVal() []byte

func (*DataTrieChange) GetVersion

func (m *DataTrieChange) GetVersion() uint32

func (*DataTrieChange) GoString

func (this *DataTrieChange) GoString() string

func (*DataTrieChange) Marshal

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

func (*DataTrieChange) MarshalTo

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

func (*DataTrieChange) MarshalToSizedBuffer

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

func (*DataTrieChange) ProtoMessage

func (*DataTrieChange) ProtoMessage()

func (*DataTrieChange) Reset

func (m *DataTrieChange) Reset()

func (*DataTrieChange) Size

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

func (*DataTrieChange) String

func (this *DataTrieChange) String() string

func (*DataTrieChange) Unmarshal

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

func (*DataTrieChange) XXX_DiscardUnknown

func (m *DataTrieChange) XXX_DiscardUnknown()

func (*DataTrieChange) XXX_Marshal

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

func (*DataTrieChange) XXX_Merge

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

func (*DataTrieChange) XXX_Size

func (m *DataTrieChange) XXX_Size() int

func (*DataTrieChange) XXX_Unmarshal

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

type DataTrieOperation

type DataTrieOperation uint32

DataTrieOperation represents the type for data trie operations

const (
	// NotSpecified is the default value for data trie operation
	NotSpecified DataTrieOperation = 0
	// Delete is the value for delete operation on data trie
	Delete DataTrieOperation = 1
)

type StateAccess

type StateAccess struct {
	Type            ActionType        `protobuf:"varint,1,opt,name=Type,proto3,enum=proto.ActionType" json:"type"`
	Index           int32             `protobuf:"varint,2,opt,name=Index,proto3" json:"index"`
	TxHash          []byte            `protobuf:"bytes,3,opt,name=TxHash,proto3" json:"txHash"`
	MainTrieKey     []byte            `protobuf:"bytes,4,opt,name=MainTrieKey,proto3" json:"mainTrieKey"`
	MainTrieVal     []byte            `protobuf:"bytes,5,opt,name=MainTrieVal,proto3" json:"mainTrieVal"`
	Operation       uint32            `protobuf:"varint,6,opt,name=Operation,proto3" json:"operation"`
	DataTrieChanges []*DataTrieChange `protobuf:"bytes,7,rep,name=DataTrieChanges,proto3" json:"dataTrieChanges,omitempty"`
	AccountChanges  uint32            `protobuf:"varint,8,opt,name=AccountChanges,proto3" json:"accountChanges"`
}

func (*StateAccess) Descriptor

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

func (*StateAccess) Equal

func (this *StateAccess) Equal(that interface{}) bool

func (*StateAccess) GetAccountChanges

func (m *StateAccess) GetAccountChanges() uint32

func (*StateAccess) GetDataTrieChanges

func (m *StateAccess) GetDataTrieChanges() []*DataTrieChange

func (*StateAccess) GetIndex

func (m *StateAccess) GetIndex() int32

func (*StateAccess) GetMainTrieKey

func (m *StateAccess) GetMainTrieKey() []byte

func (*StateAccess) GetMainTrieVal

func (m *StateAccess) GetMainTrieVal() []byte

func (*StateAccess) GetOperation

func (m *StateAccess) GetOperation() uint32

func (*StateAccess) GetTxHash

func (m *StateAccess) GetTxHash() []byte

func (*StateAccess) GetType

func (m *StateAccess) GetType() ActionType

func (*StateAccess) GoString

func (this *StateAccess) GoString() string

func (*StateAccess) Marshal

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

func (*StateAccess) MarshalTo

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

func (*StateAccess) MarshalToSizedBuffer

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

func (*StateAccess) ProtoMessage

func (*StateAccess) ProtoMessage()

func (*StateAccess) Reset

func (m *StateAccess) Reset()

func (*StateAccess) Size

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

func (*StateAccess) String

func (this *StateAccess) String() string

func (*StateAccess) Unmarshal

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

func (*StateAccess) XXX_DiscardUnknown

func (m *StateAccess) XXX_DiscardUnknown()

func (*StateAccess) XXX_Marshal

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

func (*StateAccess) XXX_Merge

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

func (*StateAccess) XXX_Size

func (m *StateAccess) XXX_Size() int

func (*StateAccess) XXX_Unmarshal

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

type StateAccesses

type StateAccesses struct {
	StateAccess []*StateAccess `protobuf:"bytes,1,rep,name=StateAccess,proto3" json:"stateAccess"`
}

func (*StateAccesses) Descriptor

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

func (*StateAccesses) Equal

func (this *StateAccesses) Equal(that interface{}) bool

func (*StateAccesses) GetStateAccess

func (m *StateAccesses) GetStateAccess() []*StateAccess

func (*StateAccesses) GoString

func (this *StateAccesses) GoString() string

func (*StateAccesses) Marshal

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

func (*StateAccesses) MarshalTo

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

func (*StateAccesses) MarshalToSizedBuffer

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

func (*StateAccesses) ProtoMessage

func (*StateAccesses) ProtoMessage()

func (*StateAccesses) Reset

func (m *StateAccesses) Reset()

func (*StateAccesses) Size

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

func (*StateAccesses) String

func (this *StateAccesses) String() string

func (*StateAccesses) Unmarshal

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

func (*StateAccesses) XXX_DiscardUnknown

func (m *StateAccesses) XXX_DiscardUnknown()

func (*StateAccesses) XXX_Marshal

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

func (*StateAccesses) XXX_Merge

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

func (*StateAccesses) XXX_Size

func (m *StateAccesses) XXX_Size() int

func (*StateAccesses) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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