treenode

package
v0.0.0-...-7c2dc49 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_CALL_EX_TREE_SIZE = 1000000
	MAX_CALLED_FUNCTIONS  = 255
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TreeNode

type TreeNode struct {
	// contains filtered or unexported fields
}

TreeNode is a node in the execution tree. It represents a function execution at a specific contract in a specific chain.

func NewTreeNode

func NewTreeNode(chainID *big.Int, contractAddr common.Address, callData []byte) (*TreeNode, error)

NewTreeNode creates a new tree node with empty children.

func (*TreeNode) AddChild

func (n *TreeNode) AddChild(child *TreeNode) error

AddChild adds a child to this node. Error occurs if the child has same chain id as this node. TODO:

Do we need to check if the whole tree does not have two executions having access to the same lockable contract?
We can have Lock & RLock in the lockable storage and so only multiple reads if permitted.

func (*TreeNode) CallData

func (n *TreeNode) CallData() []byte

CallData gets the call data of the tree node.

func (*TreeNode) ChainID

func (n *TreeNode) ChainID() *big.Int

ChainID gets the chain id of the tree node.

func (*TreeNode) Children

func (n *TreeNode) Children() []*TreeNode

Children gets a list of children nodes.

func (*TreeNode) ContractAddr

func (n *TreeNode) ContractAddr() common.Address

ContractAddr gets the contract addr of the tree node.

func (*TreeNode) Encode

func (n *TreeNode) Encode() []byte

Encode encodes this tree node to bytes.

Jump to

Keyboard shortcuts

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