Documentation ¶
Index ¶
- func CalculateSumOutputsWithFee(outputCoins []coin.Coin, fee uint64) *operation.Point
- func EstimateProofSizeV2(numIn, numOut uint64) uint64
- func EstimateTxSize(estimateTxSizeParam *EstimateTxSizeParam) uint64
- func EstimateTxSizeOfInitTokenSalary(version int, publicKey []byte, amount uint64, coinName string, ...) uint64
- func EstimateTxSizeV2(estimateTxSizeParam *EstimateTxSizeParam) uint64
- func GetOTADeclarationsFromTx(tx metadataGetter) []metadata.OTADeclaration
- func GetTxActualSizeInBytes(tx metadata.Transaction) uint64
- func GetTxBurnData(tx metadata.Transaction) (bool, privacy.Coin, *common.Hash, error)
- func GetTxInfo(paramInfo []byte) ([]byte, error)
- func GetTxMintData(tx metadata.Transaction, tokenID *common.Hash) (bool, privacy.Coin, *common.Hash, error)
- func GetTxVersionFromCoins(inputCoins []privacy.PlainCoin) (int8, error)
- func MdValidate(tx metadata.Transaction, hasPrivacy bool, transactionStateDB *statedb.StateDB, ...) (bool, error)
- func MdValidateSanity(tx metadata.Transaction, chainRetriever metadata.ChainRetriever, ...) (bool, error)
- func MdValidateWithBlockChain(tx metadata.Transaction, chainRetriever metadata.ChainRetriever, ...) error
- func ParseTokenID(tokenID *common.Hash) (*common.Hash, error)
- func RandomCommitmentsProcess(param *RandomCommitmentsProcessParam) (commitmentIndexs []uint64, myCommitmentIndexs []uint64, commitments [][]byte)
- func SignNoPrivacy(privKey *privacy.PrivateKey, hashedMessage []byte) (signatureBytes []byte, sigPubKey []byte, err error)
- func ValidateSanity(tx metadata.Transaction, chainRetriever metadata.ChainRetriever, ...) (bool, error)
- func ValidateTxParams(params *TxPrivacyInitParams) error
- func VerifySigNoPrivacy(sig []byte, sigPubKey []byte, hashedMessage []byte) (bool, error)
- func VerifyTxCreatedByMiner(tx metadata.Transaction, mintdata *metadata.MintData, shardID byte, ...) (bool, error)
- type EstimateTxSizeParam
- type RandomCommitmentsProcessParam
- type TokenParam
- type TransactionToken
- type Tx
- type TxBase
- func (tx TxBase) CalculateTxValue() uint64
- func (tx TxBase) CheckTxVersion(maxTxVersion int8) bool
- func (tx TxBase) GetCachedActualSize() *uint64
- func (tx TxBase) GetCachedHash() *common.Hash
- func (tx TxBase) GetInfo() []byte
- func (tx TxBase) GetLockTime() int64
- func (tx TxBase) GetMetadata() metadata.Metadata
- func (tx TxBase) GetMetadataType() int
- func (tx TxBase) GetPrivateKey() []byte
- func (tx TxBase) GetProof() privacy.Proof
- func (tx TxBase) GetReceivers() ([][]byte, []uint64)
- func (tx TxBase) GetSenderAddrLastByte() byte
- func (tx TxBase) GetSig() []byte
- func (tx TxBase) GetSigPubKey() []byte
- func (tx TxBase) GetTokenID() *common.Hash
- func (tx TxBase) GetTransferData() (bool, []byte, uint64, *common.Hash)
- func (tx TxBase) GetTxActualSize() uint64
- func (tx TxBase) GetTxFee() uint64
- func (tx TxBase) GetTxFeeToken() uint64
- func (tx TxBase) GetType() string
- func (tx *TxBase) GetValidationEnv() metadata.ValidationEnviroment
- func (tx TxBase) GetVersion() int8
- func (tx *TxBase) Hash() *common.Hash
- func (tx *TxBase) HashWithoutMetadataSig() *common.Hash
- func (tx *TxBase) InitializeTxAndParams(params *TxPrivacyInitParams) error
- func (tx TxBase) IsCoinsBurning(bcr metadata.ChainRetriever, retriever metadata.ShardViewRetriever, ...) bool
- func (tx *TxBase) IsNonPrivacyNonInput(params *TxPrivacyInitParams) (bool, error)
- func (tx TxBase) IsPrivacy() bool
- func (tx TxBase) IsSalaryTx() bool
- func (tx TxBase) ListOTAHashH() []common.Hash
- func (tx TxBase) ListSerialNumbersHashH() []common.Hash
- func (tx *TxBase) SetCachedActualSize(sz *uint64)
- func (tx *TxBase) SetCachedHash(h *common.Hash)
- func (tx *TxBase) SetGetSenderAddrLastByte(b byte)
- func (tx *TxBase) SetInfo(info []byte)
- func (tx *TxBase) SetLockTime(locktime int64)
- func (tx *TxBase) SetMetadata(meta metadata.Metadata)
- func (tx *TxBase) SetPrivateKey(sk []byte)
- func (tx *TxBase) SetProof(proof privacy.Proof)
- func (tx *TxBase) SetSig(sig []byte)
- func (tx *TxBase) SetSigPubKey(sigPubkey []byte)
- func (tx *TxBase) SetTxFee(fee uint64)
- func (tx *TxBase) SetType(t string)
- func (tx *TxBase) SetValidationEnv(vEnv metadata.ValidationEnviroment)
- func (tx *TxBase) SetVersion(version int8)
- func (tx TxBase) String() string
- func (tx *TxBase) UnmarshalJSON(data []byte) error
- func (tx *TxBase) ValidateDoubleSpendWithBlockchain(shardID byte, stateDB *statedb.StateDB, tokenID *common.Hash) error
- func (tx *TxBase) ValidateSanityDataByItSelf() (bool, error)
- func (tx *TxBase) ValidateSanityDataWithMetadata() (bool, error)
- func (tx TxBase) ValidateTxWithCurrentMempool(mr metadata.MempoolRetriever) error
- func (tx TxBase) ValidateType() bool
- type TxPrivacyInitParams
- type TxTokenBase
- func (txToken TxTokenBase) CalculateTxValue() uint64
- func (txToken TxTokenBase) GetSigPubKey() []byte
- func (txToken TxTokenBase) GetTokenID() *common.Hash
- func (txToken TxTokenBase) GetTransferData() (bool, []byte, uint64, *common.Hash)
- func (txToken TxTokenBase) GetTxBase() metadata.Transaction
- func (txToken TxTokenBase) GetTxBurnData() (bool, privacy.Coin, *common.Hash, error)
- func (txToken TxTokenBase) GetTxFee() uint64
- func (txToken TxTokenBase) GetTxFeeToken() uint64
- func (txToken TxTokenBase) GetTxFullBurnData() (bool, privacy.Coin, privacy.Coin, *common.Hash, error)
- func (txToken TxTokenBase) GetTxMintData() (bool, privacy.Coin, *common.Hash, error)
- func (txToken TxTokenBase) GetTxNormal() metadata.Transaction
- func (txToken TxTokenBase) GetTxTokenData() TxTokenData
- func (txToken *TxTokenBase) Hash() *common.Hash
- func (txToken *TxTokenBase) HashWithoutMetadataSig() *common.Hash
- func (txToken TxTokenBase) IsCoinsBurning(bcr metadata.ChainRetriever, retriever metadata.ShardViewRetriever, ...) bool
- func (txToken TxTokenBase) IsSalaryTx() bool
- func (txToken TxTokenBase) JSONString() string
- func (txToken TxTokenBase) ListSerialNumbersHashH() []common.Hash
- func (txToken TxTokenBase) MarshalJSON() ([]byte, error)
- func (txToken *TxTokenBase) SetTxBase(tx metadata.Transaction) error
- func (txToken *TxTokenBase) SetTxNormal(tx metadata.Transaction) error
- func (txToken *TxTokenBase) SetTxTokenData(data TxTokenData) error
- func (txToken TxTokenBase) String() string
- func (tx *TxTokenBase) ValidateSanityDataWithMetadata() (bool, error)
- func (txToken TxTokenBase) ValidateTxWithBlockChain(chainRetriever metadata.ChainRetriever, ...) error
- func (txToken TxTokenBase) ValidateTxWithCurrentMempool(mr metadata.MempoolRetriever) error
- func (txToken TxTokenBase) ValidateType() bool
- func (txToken TxTokenBase) VerifyMinerCreatedTxBeforeGettingInBlock(mintData *metadata.MintData, shardID byte, bcr metadata.ChainRetriever, ...) (bool, error)
- type TxTokenData
- func (txData TxTokenData) GetAmount() uint64
- func (txData TxTokenData) GetPropertyID() common.Hash
- func (txData TxTokenData) GetPropertyName() string
- func (txData TxTokenData) GetPropertySymbol() string
- func (txData TxTokenData) GetType() int
- func (txData TxTokenData) Hash() (*common.Hash, error)
- func (txData TxTokenData) IsMintable() bool
- func (txData *TxTokenData) SetAmount(amount uint64)
- func (txData *TxTokenData) SetMintable(mintable bool)
- func (txData *TxTokenData) SetPropertyID(propID common.Hash)
- func (txData *TxTokenData) SetPropertyName(propertyName string)
- func (txData *TxTokenData) SetPropertySymbol(propertySymbol string)
- func (txData *TxTokenData) SetType(t int)
- func (txData TxTokenData) String() string
- type TxTokenParams
- type ValidationEnv
- func DefaultValEnv() *ValidationEnv
- func NewValEnv(isPrivacyTx bool, txType string, sHeight uint64, bHeight uint64, sID int, ...) *ValidationEnv
- func WithAct(vE metadata.ValidationEnviroment, act int) *ValidationEnv
- func WithBeaconHeight(vE metadata.ValidationEnviroment, bcHeight uint64) *ValidationEnv
- func WithCA(vE metadata.ValidationEnviroment, hasCA bool) *ValidationEnv
- func WithConfirmedTime(vE metadata.ValidationEnviroment, confirmedTime int64) *ValidationEnv
- func WithDBData(vE metadata.ValidationEnviroment, data [][]byte) *ValidationEnv
- func WithNoPrivacy(vE metadata.ValidationEnviroment) *ValidationEnv
- func WithPrivacy(vE metadata.ValidationEnviroment) *ValidationEnv
- func WithShardHeight(vE metadata.ValidationEnviroment, sHeight uint64) *ValidationEnv
- func WithShardID(vE metadata.ValidationEnviroment, sID int) *ValidationEnv
- func WithSigPubkey(vE metadata.ValidationEnviroment, sigPubkey []byte) *ValidationEnv
- func WithTokenID(vE metadata.ValidationEnviroment, tokenID common.Hash) *ValidationEnv
- func WithType(vE metadata.ValidationEnviroment, t string) *ValidationEnv
- func WithVersion(vE metadata.ValidationEnviroment, ver int8) *ValidationEnv
- func (vE *ValidationEnv) BeaconHeight() uint64
- func (vE *ValidationEnv) Clone() *ValidationEnv
- func (vE *ValidationEnv) ConfirmedTime() int64
- func (vE *ValidationEnv) DBData() [][]byte
- func (vE *ValidationEnv) HasCA() bool
- func (vE *ValidationEnv) IsConfimed() bool
- func (vE *ValidationEnv) IsPrivacy() bool
- func (vE *ValidationEnv) ShardHeight() uint64
- func (vE *ValidationEnv) ShardID() int
- func (vE *ValidationEnv) SigPubKey() []byte
- func (vE *ValidationEnv) TokenID() common.Hash
- func (vE *ValidationEnv) TxAction() int
- func (vE *ValidationEnv) TxType() string
- func (vE *ValidationEnv) Version() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EstimateProofSizeV2 ¶
func EstimateTxSize ¶
func EstimateTxSize(estimateTxSizeParam *EstimateTxSizeParam) uint64
EstimateTxSize returns the estimated size of the tx in kilobyte
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 GetTxMintData ¶
func GetTxVersionFromCoins ¶
func MdValidate ¶
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 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 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 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
}
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 (TxBase) CheckTxVersion ¶
func (TxBase) GetCachedActualSize ¶
func (TxBase) GetCachedHash ¶
func (TxBase) GetLockTime ¶
func (TxBase) GetMetadata ¶
func (TxBase) GetMetadataType ¶
func (TxBase) GetPrivateKey ¶
func (TxBase) GetReceivers ¶
func (TxBase) GetSenderAddrLastByte ¶
func (TxBase) GetSigPubKey ¶
func (TxBase) GetTokenID ¶
func (TxBase) GetTransferData ¶
func (TxBase) GetTxActualSize ¶
func (TxBase) GetTxFeeToken ¶
func (*TxBase) GetValidationEnv ¶
func (tx *TxBase) GetValidationEnv() metadata.ValidationEnviroment
func (TxBase) GetVersion ¶
=================== GET/SET FUNCTIONS ===================
func (*TxBase) HashWithoutMetadataSig ¶
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) IsSalaryTx ¶
func (TxBase) ListOTAHashH ¶
func (TxBase) ListSerialNumbersHashH ¶
func (*TxBase) SetCachedActualSize ¶
func (*TxBase) SetCachedHash ¶
func (*TxBase) SetGetSenderAddrLastByte ¶
func (*TxBase) SetLockTime ¶
func (*TxBase) SetMetadata ¶
func (*TxBase) SetPrivateKey ¶
func (*TxBase) SetSigPubKey ¶
func (*TxBase) SetValidationEnv ¶
func (tx *TxBase) SetValidationEnv(vEnv metadata.ValidationEnviroment)
func (*TxBase) SetVersion ¶
func (*TxBase) UnmarshalJSON ¶
func (*TxBase) ValidateDoubleSpendWithBlockchain ¶
func (*TxBase) ValidateSanityDataByItSelf ¶
func (*TxBase) ValidateSanityDataWithMetadata ¶
func (TxBase) ValidateTxWithCurrentMempool ¶
func (tx TxBase) ValidateTxWithCurrentMempool(mr metadata.MempoolRetriever) error
func (TxBase) ValidateType ¶
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 ¶
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 (TxTokenBase) GetTxBase ¶
func (txToken TxTokenBase) GetTxBase() metadata.Transaction
func (TxTokenBase) GetTxBurnData ¶
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 (TxTokenBase) GetTxMintData ¶
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) 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 WithAct ¶
func WithAct(vE metadata.ValidationEnviroment, act int) *ValidationEnv
func WithBeaconHeight ¶
func WithBeaconHeight(vE metadata.ValidationEnviroment, bcHeight uint64) *ValidationEnv
func WithCA ¶
func WithCA(vE metadata.ValidationEnviroment, hasCA bool) *ValidationEnv
func WithConfirmedTime ¶
func WithConfirmedTime(vE metadata.ValidationEnviroment, confirmedTime int64) *ValidationEnv
func WithDBData ¶
func WithDBData(vE metadata.ValidationEnviroment, data [][]byte) *ValidationEnv
func WithNoPrivacy ¶
func WithNoPrivacy(vE metadata.ValidationEnviroment) *ValidationEnv
func WithPrivacy ¶
func WithPrivacy(vE metadata.ValidationEnviroment) *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 WithType ¶
func WithType(vE metadata.ValidationEnviroment, t string) *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