tx_generic

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

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateSumOutputsWithFee

func CalculateSumOutputsWithFee(outputCoins []coin.Coin, fee uint64) *operation.Point

func EstimateProofSizeV2

func EstimateProofSizeV2(numIn, numOut uint64) uint64

func EstimateTxSize

func EstimateTxSize(estimateTxSizeParam *EstimateTxSizeParam) uint64

EstimateTxSize returns the estimated size of the tx in kilobyte

func EstimateTxSizeOfInitTokenSalary

func EstimateTxSizeOfInitTokenSalary(version int, publicKey []byte, amount uint64, coinName string, coinID *common.Hash) uint64

func EstimateTxSizeV2

func EstimateTxSizeV2(estimateTxSizeParam *EstimateTxSizeParam) uint64

func GetOTADeclarationsFromTx

func GetOTADeclarationsFromTx(tx metadataGetter) []metadata.OTADeclaration

GetOTADeclarations can be called on TxVersion2 or TxTokenVersion2 to get the OTAs-to-mint from their metadata

func GetTxActualSizeInBytes

func GetTxActualSizeInBytes(tx metadata.Transaction) uint64

func GetTxBurnData

func GetTxBurnData(tx metadata.Transaction) (bool, privacy.Coin, *common.Hash, error)

func GetTxInfo

func GetTxInfo(paramInfo []byte) ([]byte, error)

func GetTxMintData

func GetTxMintData(tx metadata.Transaction, tokenID *common.Hash) (bool, privacy.Coin, *common.Hash, error)

func GetTxVersionFromCoins

func GetTxVersionFromCoins(inputCoins []privacy.PlainCoin) (int8, error)

func MdValidate

func MdValidate(tx metadata.Transaction, hasPrivacy bool, transactionStateDB *statedb.StateDB, bridgeStateDB *statedb.StateDB, shardID byte) (bool, error)

func MdValidateSanity

func MdValidateSanity(tx metadata.Transaction, chainRetriever metadata.ChainRetriever, shardViewRetriever metadata.ShardViewRetriever, beaconViewRetriever metadata.BeaconViewRetriever, beaconHeight uint64) (bool, error)

func MdValidateWithBlockChain

func MdValidateWithBlockChain(tx metadata.Transaction, chainRetriever metadata.ChainRetriever, shardViewRetriever metadata.ShardViewRetriever, beaconViewRetriever metadata.BeaconViewRetriever, shardID byte, stateDB *statedb.StateDB) error

func ParseTokenID

func ParseTokenID(tokenID *common.Hash) (*common.Hash, error)

func RandomCommitmentsProcess

func RandomCommitmentsProcess(param *RandomCommitmentsProcessParam) (commitmentIndexs []uint64, myCommitmentIndexs []uint64, commitments [][]byte)

RandomCommitmentsProcess - process list commitments and useable tx to create a list commitment random which be used to create a proof for new tx result contains commitmentIndexs = [{1,2,3,4,myindex1,6,7,8}{9,10,11,12,13,myindex2,15,16}...] myCommitmentIndexs = [4, 13, ...]

func SignNoPrivacy

func SignNoPrivacy(privKey *privacy.PrivateKey, hashedMessage []byte) (signatureBytes []byte, sigPubKey []byte, err error)

func ValidateSanity

func ValidateSanity(tx metadata.Transaction, chainRetriever metadata.ChainRetriever, shardViewRetriever metadata.ShardViewRetriever, beaconViewRetriever metadata.BeaconViewRetriever, beaconHeight uint64) (bool, error)

func ValidateTxParams

func ValidateTxParams(params *TxPrivacyInitParams) error

func VerifySigNoPrivacy

func VerifySigNoPrivacy(sig []byte, sigPubKey []byte, hashedMessage []byte) (bool, error)

func VerifyTxCreatedByMiner

func VerifyTxCreatedByMiner(tx metadata.Transaction, mintdata *metadata.MintData, shardID byte, bcr metadata.ChainRetriever, accumulatedValues *metadata.AccumulatedValues, retriever metadata.ShardViewRetriever, viewRetriever metadata.BeaconViewRetriever) (bool, error)

Types

type EstimateTxSizeParam

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

func NewEstimateTxSizeParam

func NewEstimateTxSizeParam(version, numInputCoins, numPayments int,
	hasPrivacy bool, metadata metadata.Metadata,
	privacyCustomTokenParams *TokenParam,
	limitFee uint64) *EstimateTxSizeParam

type RandomCommitmentsProcessParam

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

func NewRandomCommitmentsProcessParam

func NewRandomCommitmentsProcessParam(usableInputCoins []coin.PlainCoin, randNum int, stateDB *statedb.StateDB, shardID byte, tokenID *common.Hash) *RandomCommitmentsProcessParam

type TokenParam

type TokenParam struct {
	PropertyID     string                 `json:"TokenID"`
	PropertyName   string                 `json:"TokenName"`
	PropertySymbol string                 `json:"TokenSymbol"`
	Amount         uint64                 `json:"TokenAmount"`
	TokenTxType    int                    `json:"TokenTxType"`
	Receiver       []*privacy.PaymentInfo `json:"TokenReceiver"`
	TokenInput     []privacy.PlainCoin    `json:"TokenInput"`
	Mintable       bool                   `json:"TokenMintable"`
	Fee            uint64                 `json:"TokenFee"`
}

CustomTokenParamTx - use for rpc request json body

type TransactionToken

type TransactionToken interface {
	// GET/SET FUNCTION
	GetVersion() int8
	SetVersion(int8)
	GetMetadataType() int
	GetType() string
	SetType(string)
	GetLockTime() int64
	SetLockTime(int64)
	GetSenderAddrLastByte() byte
	SetGetSenderAddrLastByte(byte)
	GetTxFee() uint64
	SetTxFee(uint64)
	GetTxFeeToken() uint64
	GetInfo() []byte
	SetInfo([]byte)
	GetSigPubKey() []byte
	SetSigPubKey([]byte)
	GetSig() []byte
	SetSig([]byte)
	GetProof() privacy.Proof
	SetProof(privacy.Proof)
	GetTokenID() *common.Hash
	GetMetadata() metadata.Metadata
	SetMetadata(metadata.Metadata)

	GetTxTokenData() TxTokenData
	SetTxTokenData(TxTokenData) error
	GetTxBase() metadata.Transaction
	SetTxBase(metadata.Transaction) error
	GetTxNormal() metadata.Transaction
	SetTxNormal(metadata.Transaction) error

	// =================== FUNCTIONS THAT GET STUFF AND REQUIRE SOME CODING ===================
	GetTxActualSize() uint64
	GetReceivers() ([][]byte, []uint64)
	GetTransferData() (bool, []byte, uint64, *common.Hash)

	GetReceiverData() ([]privacy.Coin, error)
	GetTxMintData() (bool, privacy.Coin, *common.Hash, error)
	GetTxBurnData() (bool, privacy.Coin, *common.Hash, error)
	ListOTAHashH() []common.Hash
	GetTxFullBurnData() (bool, privacy.Coin, privacy.Coin, *common.Hash, error)
	ListSerialNumbersHashH() []common.Hash
	String() string
	Hash() *common.Hash
	HashWithoutMetadataSig() *common.Hash
	CalculateTxValue() uint64

	// =================== FUNCTION THAT CHECK STUFFS  ===================
	CheckTxVersion(int8) bool
	IsSalaryTx() bool
	IsPrivacy() bool
	IsCoinsBurning(metadata.ChainRetriever, metadata.ShardViewRetriever, metadata.BeaconViewRetriever, uint64) bool

	// =================== FUNCTIONS THAT VALIDATE STUFFS ===================
	ValidateTxSalary(*statedb.StateDB) (bool, error)
	ValidateTxWithCurrentMempool(metadata.MempoolRetriever) error
	ValidateSanityData(metadata.ChainRetriever, metadata.ShardViewRetriever, metadata.BeaconViewRetriever, uint64) (bool, error)
	ValidateTxWithBlockChain(chainRetriever metadata.ChainRetriever, shardViewRetriever metadata.ShardViewRetriever, beaconViewRetriever metadata.BeaconViewRetriever, shardID byte, stateDB *statedb.StateDB) error
	ValidateDoubleSpendWithBlockchain(byte, *statedb.StateDB, *common.Hash) error
	ValidateTxByItself(map[string]bool, *statedb.StateDB, *statedb.StateDB, metadata.ChainRetriever, byte, metadata.ShardViewRetriever, metadata.BeaconViewRetriever) (bool, error)
	ValidateType() bool
	ValidateTransaction(map[string]bool, *statedb.StateDB, *statedb.StateDB, byte, *common.Hash) (bool, []privacy.Proof, error)
	VerifyMinerCreatedTxBeforeGettingInBlock(*metadata.MintData, byte, metadata.ChainRetriever, *metadata.AccumulatedValues, metadata.ShardViewRetriever, metadata.BeaconViewRetriever) (bool, error)

	// Init Transaction, the input should be params such as: TxPrivacyInitParams
	Init(interface{}) error
	// Verify the init function above, which verify zero knowledge proof and signatures
	Verify(map[string]bool, *statedb.StateDB, *statedb.StateDB, byte, *common.Hash) (bool, error)

	GetValidationEnv() metadata.ValidationEnviroment
	SetValidationEnv(metadata.ValidationEnviroment)
	UnmarshalJSON(data []byte) error

	// VerifySigTx() (bool, error)
	ValidateSanityDataByItSelf() (bool, error)
	ValidateTxCorrectness(*statedb.StateDB) (bool, error)
	LoadData(db *statedb.StateDB) error
	CheckData(db *statedb.StateDB) error
	ValidateSanityDataWithBlockchain(
		chainRetriever metadata.ChainRetriever,
		shardViewRetriever metadata.ShardViewRetriever,
		beaconViewRetriever metadata.BeaconViewRetriever,
		beaconHeight uint64,
	) (
		bool,
		error,
	)
}

Interface for Transaction Transfer Token

type Tx

type Tx = metadata.Transaction

type TxBase

type TxBase struct {
	Version  int8   `json:"Version"`
	Type     string `json:"Type"` // Transaction type
	LockTime int64  `json:"LockTime"`
	Fee      uint64 `json:"Fee"` // Fee applies: always consant
	Info     []byte // 512 bytes
	// Sign and Privacy proof, required
	SigPubKey            []byte `json:"SigPubKey"` // 33 bytes
	Sig                  []byte `json:"Sig"`       //
	Proof                privacy.Proof
	PubKeyLastByteSender byte
	// Metadata, optional
	Metadata metadata.Metadata
	// contains filtered or unexported fields
}

func (TxBase) CalculateTxValue

func (tx TxBase) CalculateTxValue() uint64

func (TxBase) CheckTxVersion

func (tx TxBase) CheckTxVersion(maxTxVersion int8) bool

func (TxBase) GetCachedActualSize

func (tx TxBase) GetCachedActualSize() *uint64

func (TxBase) GetCachedHash

func (tx TxBase) GetCachedHash() *common.Hash

func (TxBase) GetInfo

func (tx TxBase) GetInfo() []byte

func (TxBase) GetLockTime

func (tx TxBase) GetLockTime() int64

func (TxBase) GetMetadata

func (tx TxBase) GetMetadata() metadata.Metadata

func (TxBase) GetMetadataType

func (tx TxBase) GetMetadataType() int

func (TxBase) GetPrivateKey

func (tx TxBase) GetPrivateKey() []byte

func (TxBase) GetProof

func (tx TxBase) GetProof() privacy.Proof

func (TxBase) GetReceivers

func (tx TxBase) GetReceivers() ([][]byte, []uint64)

func (TxBase) GetSenderAddrLastByte

func (tx TxBase) GetSenderAddrLastByte() byte

func (TxBase) GetSig

func (tx TxBase) GetSig() []byte

func (TxBase) GetSigPubKey

func (tx TxBase) GetSigPubKey() []byte

func (TxBase) GetTokenID

func (tx TxBase) GetTokenID() *common.Hash

func (TxBase) GetTransferData

func (tx TxBase) GetTransferData() (bool, []byte, uint64, *common.Hash)

func (TxBase) GetTxActualSize

func (tx TxBase) GetTxActualSize() uint64

func (TxBase) GetTxFee

func (tx TxBase) GetTxFee() uint64

func (TxBase) GetTxFeeToken

func (tx TxBase) GetTxFeeToken() uint64

func (TxBase) GetType

func (tx TxBase) GetType() string

func (*TxBase) GetValidationEnv

func (tx *TxBase) GetValidationEnv() metadata.ValidationEnviroment

func (TxBase) GetVersion

func (tx TxBase) GetVersion() int8

=================== GET/SET FUNCTIONS ===================

func (*TxBase) Hash

func (tx *TxBase) Hash() *common.Hash

func (*TxBase) HashWithoutMetadataSig

func (tx *TxBase) HashWithoutMetadataSig() *common.Hash

func (*TxBase) InitializeTxAndParams

func (tx *TxBase) InitializeTxAndParams(params *TxPrivacyInitParams) error

InitializeTxAndParams returns bool indicates whether we should continue "Init" function or not

func (TxBase) IsCoinsBurning

func (tx TxBase) IsCoinsBurning(bcr metadata.ChainRetriever, retriever metadata.ShardViewRetriever, viewRetriever metadata.BeaconViewRetriever, beaconHeight uint64) bool

func (*TxBase) IsNonPrivacyNonInput

func (tx *TxBase) IsNonPrivacyNonInput(params *TxPrivacyInitParams) (bool, error)

func (TxBase) IsPrivacy

func (tx TxBase) IsPrivacy() bool

func (TxBase) IsSalaryTx

func (tx TxBase) IsSalaryTx() bool

func (TxBase) ListOTAHashH

func (tx TxBase) ListOTAHashH() []common.Hash

func (TxBase) ListSerialNumbersHashH

func (tx TxBase) ListSerialNumbersHashH() []common.Hash

func (*TxBase) SetCachedActualSize

func (tx *TxBase) SetCachedActualSize(sz *uint64)

func (*TxBase) SetCachedHash

func (tx *TxBase) SetCachedHash(h *common.Hash)

func (*TxBase) SetGetSenderAddrLastByte

func (tx *TxBase) SetGetSenderAddrLastByte(b byte)

func (*TxBase) SetInfo

func (tx *TxBase) SetInfo(info []byte)

func (*TxBase) SetLockTime

func (tx *TxBase) SetLockTime(locktime int64)

func (*TxBase) SetMetadata

func (tx *TxBase) SetMetadata(meta metadata.Metadata)

func (*TxBase) SetPrivateKey

func (tx *TxBase) SetPrivateKey(sk []byte)

func (*TxBase) SetProof

func (tx *TxBase) SetProof(proof privacy.Proof)

func (*TxBase) SetSig

func (tx *TxBase) SetSig(sig []byte)

func (*TxBase) SetSigPubKey

func (tx *TxBase) SetSigPubKey(sigPubkey []byte)

func (*TxBase) SetTxFee

func (tx *TxBase) SetTxFee(fee uint64)

func (*TxBase) SetType

func (tx *TxBase) SetType(t string)

func (*TxBase) SetValidationEnv

func (tx *TxBase) SetValidationEnv(vEnv metadata.ValidationEnviroment)

func (*TxBase) SetVersion

func (tx *TxBase) SetVersion(version int8)

func (TxBase) String

func (tx TxBase) String() string

func (*TxBase) UnmarshalJSON

func (tx *TxBase) UnmarshalJSON(data []byte) error

func (*TxBase) ValidateDoubleSpendWithBlockchain

func (tx *TxBase) ValidateDoubleSpendWithBlockchain(shardID byte, stateDB *statedb.StateDB, tokenID *common.Hash) error

func (*TxBase) ValidateSanityDataByItSelf

func (tx *TxBase) ValidateSanityDataByItSelf() (bool, error)

func (*TxBase) ValidateSanityDataWithMetadata

func (tx *TxBase) ValidateSanityDataWithMetadata() (bool, error)

func (TxBase) ValidateTxWithCurrentMempool

func (tx TxBase) ValidateTxWithCurrentMempool(mr metadata.MempoolRetriever) error

func (TxBase) ValidateType

func (tx TxBase) ValidateType() bool

type TxPrivacyInitParams

type TxPrivacyInitParams struct {
	SenderSK    *privacy.PrivateKey
	PaymentInfo []*privacy.PaymentInfo
	InputCoins  []privacy.PlainCoin
	Fee         uint64
	HasPrivacy  bool
	StateDB     *statedb.StateDB
	TokenID     *common.Hash // default is nil -> use for prv coin
	MetaData    metadata.Metadata
	Info        []byte // 512 bytes
	Kvargs      map[string]interface{}
}

func NewTxPrivacyInitParams

func NewTxPrivacyInitParams(senderSK *privacy.PrivateKey,
	paymentInfo []*privacy.PaymentInfo,
	inputCoins []privacy.PlainCoin,
	fee uint64,
	hasPrivacy bool,
	stateDB *statedb.StateDB,
	tokenID *common.Hash,
	metaData metadata.Metadata,
	info []byte) *TxPrivacyInitParams

type TxTokenBase

type TxTokenBase struct {
	Tx
	TxTokenData TxTokenData `json:"TxTokenPrivacyData"`
	// contains filtered or unexported fields
}

func (TxTokenBase) CalculateTxValue

func (txToken TxTokenBase) CalculateTxValue() uint64

CalculateBurnAmount - get tx value for pToken

func (TxTokenBase) GetSigPubKey

func (txToken TxTokenBase) GetSigPubKey() []byte

Get SigPubKey of ptoken

func (TxTokenBase) GetTokenID

func (txToken TxTokenBase) GetTokenID() *common.Hash

func (TxTokenBase) GetTransferData

func (txToken TxTokenBase) GetTransferData() (bool, []byte, uint64, *common.Hash)

func (TxTokenBase) GetTxBase

func (txToken TxTokenBase) GetTxBase() metadata.Transaction

func (TxTokenBase) GetTxBurnData

func (txToken TxTokenBase) GetTxBurnData() (bool, privacy.Coin, *common.Hash, error)

func (TxTokenBase) GetTxFee

func (txToken TxTokenBase) GetTxFee() uint64

GetTxFee - return fee PRV of Tx which contain privacy token Tx

func (TxTokenBase) GetTxFeeToken

func (txToken TxTokenBase) GetTxFeeToken() uint64

GetTxFeeToken - return Token Fee use to pay for privacy token Tx

func (TxTokenBase) GetTxFullBurnData

func (txToken TxTokenBase) GetTxFullBurnData() (bool, privacy.Coin, privacy.Coin, *common.Hash, error)

func (TxTokenBase) GetTxMintData

func (txToken TxTokenBase) GetTxMintData() (bool, privacy.Coin, *common.Hash, error)

func (TxTokenBase) GetTxNormal

func (txToken TxTokenBase) GetTxNormal() metadata.Transaction

func (TxTokenBase) GetTxTokenData

func (txToken TxTokenBase) GetTxTokenData() TxTokenData

func (*TxTokenBase) Hash

func (txToken *TxTokenBase) Hash() *common.Hash

Hash returns the hash of all fields of the transaction

func (*TxTokenBase) HashWithoutMetadataSig

func (txToken *TxTokenBase) HashWithoutMetadataSig() *common.Hash

func (TxTokenBase) IsCoinsBurning

func (txToken TxTokenBase) IsCoinsBurning(bcr metadata.ChainRetriever, retriever metadata.ShardViewRetriever, viewRetriever metadata.BeaconViewRetriever, beaconHeight uint64) bool

IsCoinsBurning - checking this is a burning pToken

func (TxTokenBase) IsSalaryTx

func (txToken TxTokenBase) IsSalaryTx() bool

func (TxTokenBase) JSONString

func (txToken TxTokenBase) JSONString() string

func (TxTokenBase) ListSerialNumbersHashH

func (txToken TxTokenBase) ListSerialNumbersHashH() []common.Hash

func (TxTokenBase) MarshalJSON

func (txToken TxTokenBase) MarshalJSON() ([]byte, error)

func (*TxTokenBase) SetTxBase

func (txToken *TxTokenBase) SetTxBase(tx metadata.Transaction) error

func (*TxTokenBase) SetTxNormal

func (txToken *TxTokenBase) SetTxNormal(tx metadata.Transaction) error

func (*TxTokenBase) SetTxTokenData

func (txToken *TxTokenBase) SetTxTokenData(data TxTokenData) error

func (TxTokenBase) String

func (txToken TxTokenBase) String() string

func (*TxTokenBase) ValidateSanityDataWithMetadata

func (tx *TxTokenBase) ValidateSanityDataWithMetadata() (bool, error)

func (TxTokenBase) ValidateTxWithBlockChain

func (txToken TxTokenBase) ValidateTxWithBlockChain(chainRetriever metadata.ChainRetriever, shardViewRetriever metadata.ShardViewRetriever, beaconViewRetriever metadata.BeaconViewRetriever, shardID byte, stateDB *statedb.StateDB) error

func (TxTokenBase) ValidateTxWithCurrentMempool

func (txToken TxTokenBase) ValidateTxWithCurrentMempool(mr metadata.MempoolRetriever) error

func (TxTokenBase) ValidateType

func (txToken TxTokenBase) ValidateType() bool

func (TxTokenBase) VerifyMinerCreatedTxBeforeGettingInBlock

func (txToken TxTokenBase) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *metadata.MintData, shardID byte, bcr metadata.ChainRetriever, accumulatedValues *metadata.AccumulatedValues, retriever metadata.ShardViewRetriever, viewRetriever metadata.BeaconViewRetriever) (bool, error)

VerifyMinerCreatedTxBeforeGettingInBlock

type TxTokenData

type TxTokenData struct {
	// TxNormal is the normal transaction, it will never be token transaction
	TxNormal       metadata.Transaction
	PropertyID     common.Hash // = hash of TxCustomTokenprivacy data
	PropertyName   string
	PropertySymbol string

	Type     int    // action type
	Mintable bool   // default false
	Amount   uint64 // init amount
}

func (TxTokenData) GetAmount

func (txData TxTokenData) GetAmount() uint64

func (TxTokenData) GetPropertyID

func (txData TxTokenData) GetPropertyID() common.Hash

func (TxTokenData) GetPropertyName

func (txData TxTokenData) GetPropertyName() string

func (TxTokenData) GetPropertySymbol

func (txData TxTokenData) GetPropertySymbol() string

func (TxTokenData) GetType

func (txData TxTokenData) GetType() int

func (TxTokenData) Hash

func (txData TxTokenData) Hash() (*common.Hash, error)

func (TxTokenData) IsMintable

func (txData TxTokenData) IsMintable() bool

func (*TxTokenData) SetAmount

func (txData *TxTokenData) SetAmount(amount uint64)

func (*TxTokenData) SetMintable

func (txData *TxTokenData) SetMintable(mintable bool)

func (*TxTokenData) SetPropertyID

func (txData *TxTokenData) SetPropertyID(propID common.Hash)

func (*TxTokenData) SetPropertyName

func (txData *TxTokenData) SetPropertyName(propertyName string)

func (*TxTokenData) SetPropertySymbol

func (txData *TxTokenData) SetPropertySymbol(propertySymbol string)

func (*TxTokenData) SetType

func (txData *TxTokenData) SetType(t int)

func (TxTokenData) String

func (txData TxTokenData) String() string

type TxTokenParams

type TxTokenParams struct {
	SenderKey          *privacy.PrivateKey
	PaymentInfo        []*privacy.PaymentInfo
	InputCoin          []privacy.PlainCoin
	FeeNativeCoin      uint64
	TokenParams        *TokenParam
	TransactionStateDB *statedb.StateDB
	BridgeStateDB      *statedb.StateDB
	MetaData           metadata.Metadata
	HasPrivacyCoin     bool
	HasPrivacyToken    bool
	ShardID            byte
	Info               []byte
}

func NewTxTokenParams

func NewTxTokenParams(senderKey *privacy.PrivateKey,
	paymentInfo []*privacy.PaymentInfo,
	inputCoin []privacy.PlainCoin,
	feeNativeCoin uint64,
	tokenParams *TokenParam,
	transactionStateDB *statedb.StateDB,
	metaData metadata.Metadata,
	hasPrivacyCoin bool,
	hasPrivacyToken bool,
	shardID byte,
	info []byte,
	bridgeStateDB *statedb.StateDB) *TxTokenParams

type ValidationEnv

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

func DefaultValEnv

func DefaultValEnv() *ValidationEnv

func NewValEnv

func NewValEnv(
	isPrivacyTx bool,
	txType string,
	sHeight uint64,
	bHeight uint64,
	sID int,
	confimedTime uint64,
	ver int,
	act int,
) *ValidationEnv

func WithBeaconHeight

func WithBeaconHeight(vE metadata.ValidationEnviroment, bcHeight uint64) *ValidationEnv

func WithCA

func WithConfirmedTime

func WithConfirmedTime(vE metadata.ValidationEnviroment, confirmedTime int64) *ValidationEnv

func WithDBData

func WithDBData(vE metadata.ValidationEnviroment, data [][]byte) *ValidationEnv

func WithShardHeight

func WithShardHeight(vE metadata.ValidationEnviroment, sHeight uint64) *ValidationEnv

func WithShardID

func WithShardID(vE metadata.ValidationEnviroment, sID int) *ValidationEnv

func WithSigPubkey

func WithSigPubkey(vE metadata.ValidationEnviroment, sigPubkey []byte) *ValidationEnv

func WithTokenID

func WithTokenID(vE metadata.ValidationEnviroment, tokenID common.Hash) *ValidationEnv

func WithVersion

func WithVersion(vE metadata.ValidationEnviroment, ver int8) *ValidationEnv

func (*ValidationEnv) BeaconHeight

func (vE *ValidationEnv) BeaconHeight() uint64

func (*ValidationEnv) Clone

func (vE *ValidationEnv) Clone() *ValidationEnv

func (*ValidationEnv) ConfirmedTime

func (vE *ValidationEnv) ConfirmedTime() int64

func (*ValidationEnv) DBData

func (vE *ValidationEnv) DBData() [][]byte

func (*ValidationEnv) HasCA

func (vE *ValidationEnv) HasCA() bool

func (*ValidationEnv) IsConfimed

func (vE *ValidationEnv) IsConfimed() bool

func (*ValidationEnv) IsPrivacy

func (vE *ValidationEnv) IsPrivacy() bool

func (*ValidationEnv) ShardHeight

func (vE *ValidationEnv) ShardHeight() uint64

func (*ValidationEnv) ShardID

func (vE *ValidationEnv) ShardID() int

func (*ValidationEnv) SigPubKey

func (vE *ValidationEnv) SigPubKey() []byte

func (*ValidationEnv) TokenID

func (vE *ValidationEnv) TokenID() common.Hash

func (*ValidationEnv) TxAction

func (vE *ValidationEnv) TxAction() int

func (*ValidationEnv) TxType

func (vE *ValidationEnv) TxType() string

func (*ValidationEnv) Version

func (vE *ValidationEnv) Version() int

Jump to

Keyboard shortcuts

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