andespart

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndesMessenger

type AndesMessenger struct {
	common.Messenger
}

AndesMessenger is the messenger on Andes's part of the pipe

func NewAndesMessenger

func NewAndesMessenger(reader *os.File, writer *os.File, marshalizer marshaling.Marshalizer) *AndesMessenger

NewAndesMessenger creates a new messenger

func (*AndesMessenger) ReceiveNodeRequest

func (messenger *AndesMessenger) ReceiveNodeRequest() (common.MessageHandler, error)

ReceiveNodeRequest waits for a request from Node

func (*AndesMessenger) SendContractResponse

func (messenger *AndesMessenger) SendContractResponse(response common.MessageHandler) error

SendContractResponse sends a contract response to the Node

func (*AndesMessenger) SendHookCallRequest

func (messenger *AndesMessenger) SendHookCallRequest(request common.MessageHandler) (common.MessageHandler, error)

SendHookCallRequest makes a hook call (over the pipe) and waits for the response

type AndesPart

type AndesPart struct {
	Messenger *AndesMessenger
	VMHost    vmcommon.VMExecutionHandler
	Repliers  []common.MessageReplier
	Version   string
}

AndesPart is the endpoint that implements the message loop on Andes's side

func NewAndesPart

func NewAndesPart(
	version string,
	input *os.File,
	output *os.File,
	vmHostParameters *andes.VMHostParameters,
	marshalizer marshaling.Marshalizer,
) (*AndesPart, error)

NewAndesPart creates the Andes part

func (*AndesPart) StartLoop

func (part *AndesPart) StartLoop() error

StartLoop runs the main loop

type BlockchainHookGateway

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

BlockchainHookGateway forwards requests to the actual hook

func NewBlockchainHookGateway

func NewBlockchainHookGateway(messenger *AndesMessenger) *BlockchainHookGateway

NewBlockchainHookGateway creates a new gateway

func (*BlockchainHookGateway) ClearCompiledCodes

func (blockchain *BlockchainHookGateway) ClearCompiledCodes()

ClearCompiledCodes forwards a message to the actual hook

func (*BlockchainHookGateway) CurrentEpoch

func (blockchain *BlockchainHookGateway) CurrentEpoch() uint32

CurrentEpoch forwards a message to the actual hook

func (*BlockchainHookGateway) CurrentNonce

func (blockchain *BlockchainHookGateway) CurrentNonce() uint64

CurrentNonce forwards a message to the actual hook

func (*BlockchainHookGateway) CurrentRandomSeed

func (blockchain *BlockchainHookGateway) CurrentRandomSeed() []byte

CurrentRandomSeed forwards a message to the actual hook

func (*BlockchainHookGateway) CurrentRound

func (blockchain *BlockchainHookGateway) CurrentRound() uint64

CurrentRound forwards a message to the actual hook

func (*BlockchainHookGateway) CurrentTimeStamp

func (blockchain *BlockchainHookGateway) CurrentTimeStamp() uint64

CurrentTimeStamp forwards a message to the actual hook

func (*BlockchainHookGateway) GetAllState

func (blockchain *BlockchainHookGateway) GetAllState(address []byte) (map[string][]byte, error)

GetAllState forwards a message to the actual hook

func (*BlockchainHookGateway) GetBlockhash

func (blockchain *BlockchainHookGateway) GetBlockhash(nonce uint64) ([]byte, error)

GetBlockhash forwards a message to the actual hook

func (*BlockchainHookGateway) GetBuiltinFunctionNames

func (blockchain *BlockchainHookGateway) GetBuiltinFunctionNames() vmcommon.FunctionNames

GetBuiltinFunctionNames forwards a message to the actual hook

func (*BlockchainHookGateway) GetCode

func (blockchain *BlockchainHookGateway) GetCode(account vmcommon.UserAccountHandler) []byte

GetCode forwards a message to the actual hook

func (*BlockchainHookGateway) GetCompiledCode

func (blockchain *BlockchainHookGateway) GetCompiledCode(codeHash []byte) (bool, []byte)

GetCompiledCode forwards a message to the actual hook

func (*BlockchainHookGateway) GetMECTToken

func (blockchain *BlockchainHookGateway) GetMECTToken(address []byte, tokenID []byte, nonce uint64) (*mect.MECToken, error)

GetMECTToken forwards a message to the actual hook

func (*BlockchainHookGateway) GetShardOfAddress

func (blockchain *BlockchainHookGateway) GetShardOfAddress(address []byte) uint32

GetShardOfAddress forwards a message to the actual hook

func (*BlockchainHookGateway) GetSnapshot

func (blockchain *BlockchainHookGateway) GetSnapshot() int

GetSnapshot forwards a message to the actual hook

func (*BlockchainHookGateway) GetStateRootHash

func (blockchain *BlockchainHookGateway) GetStateRootHash() []byte

GetStateRootHash forwards a message to the actual hook

func (*BlockchainHookGateway) GetStorageData

func (blockchain *BlockchainHookGateway) GetStorageData(accountAddress []byte, index []byte) ([]byte, error)

GetStorageData forwards a message to the actual hook

func (*BlockchainHookGateway) GetUserAccount

func (blockchain *BlockchainHookGateway) GetUserAccount(address []byte) (vmcommon.UserAccountHandler, error)

GetUserAccount forwards a message to the actual hook

func (*BlockchainHookGateway) IsInterfaceNil

func (blockchain *BlockchainHookGateway) IsInterfaceNil() bool

IsInterfaceNil forwards a message to the actual hook

func (*BlockchainHookGateway) IsLimitedTransfer

func (blockchain *BlockchainHookGateway) IsLimitedTransfer(_ []byte) bool

IsLimitedTransfer not used in v1.3

func (*BlockchainHookGateway) IsPaused

func (blockchain *BlockchainHookGateway) IsPaused(_ []byte) bool

IsPaused not used in v1.3

func (*BlockchainHookGateway) IsPayable

func (blockchain *BlockchainHookGateway) IsPayable(_, address []byte) (bool, error)

IsPayable forwards a message to the actual hook

func (*BlockchainHookGateway) IsSmartContract

func (blockchain *BlockchainHookGateway) IsSmartContract(address []byte) bool

IsSmartContract forwards a message to the actual hook

func (*BlockchainHookGateway) LastEpoch

func (blockchain *BlockchainHookGateway) LastEpoch() uint32

LastEpoch forwards a message to the actual hook

func (*BlockchainHookGateway) LastNonce

func (blockchain *BlockchainHookGateway) LastNonce() uint64

LastNonce forwards a message to the actual hook

func (*BlockchainHookGateway) LastRandomSeed

func (blockchain *BlockchainHookGateway) LastRandomSeed() []byte

LastRandomSeed forwards a message to the actual hook

func (*BlockchainHookGateway) LastRound

func (blockchain *BlockchainHookGateway) LastRound() uint64

LastRound forwards a message to the actual hook

func (*BlockchainHookGateway) LastTimeStamp

func (blockchain *BlockchainHookGateway) LastTimeStamp() uint64

LastTimeStamp forwards a message to the actual hook

func (*BlockchainHookGateway) NewAddress

func (blockchain *BlockchainHookGateway) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)

NewAddress forwards a message to the actual hook

func (*BlockchainHookGateway) ProcessBuiltInFunction

func (blockchain *BlockchainHookGateway) ProcessBuiltInFunction(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

ProcessBuiltInFunction forwards a message to the actual hook

func (*BlockchainHookGateway) RevertToSnapshot

func (blockchain *BlockchainHookGateway) RevertToSnapshot(snapshot int) error

RevertToSnapshot forwards a message to the actual hook

func (*BlockchainHookGateway) SaveCompiledCode

func (blockchain *BlockchainHookGateway) SaveCompiledCode(codeHash []byte, code []byte)

SaveCompiledCode forwards a message to the actual hook

type CryptoHookGateway

type CryptoHookGateway struct {
}

CryptoHookGateway is a copy of the CryptoHook implementation from the node TODO: Remove this implementation and reference MotherEarthNetwork/common/crypto when it becomes available

func NewCryptoHookGateway

func NewCryptoHookGateway() *CryptoHookGateway

NewCryptoHookGateway creates a new crypto hook gateway

func (*CryptoHookGateway) Ecrecover

func (hook *CryptoHookGateway) Ecrecover(_ []byte, _ []byte, _ []byte, _ []byte) ([]byte, error)

Ecrecover calculates the corresponding Ethereum address for the public key which created the given signature https://ewasm.readthedocs.io/en/mkdocs/system_contracts/

func (*CryptoHookGateway) IsInterfaceNil

func (hook *CryptoHookGateway) IsInterfaceNil() bool

IsInterfaceNil returns true if underlying implementation is nil

func (*CryptoHookGateway) Keccak256

func (hook *CryptoHookGateway) Keccak256(data []byte) ([]byte, error)

Keccak256 returns a keccak 256 hash of the input string. Should return in hex format

func (*CryptoHookGateway) Ripemd160

func (hook *CryptoHookGateway) Ripemd160(data []byte) ([]byte, error)

Ripemd160 is a legacy hash and should not be used for new applications

func (*CryptoHookGateway) Sha256

func (hook *CryptoHookGateway) Sha256(data []byte) ([]byte, error)

Sha256 returns a sha 256 hash of the input string. Should return in hex format

Jump to

Keyboard shortcuts

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