Documentation ¶
Index ¶
Constants ¶
View Source
const ( EthTxType = "et" ContractTxType = "ct" SuicideTxType = "st" )
View Source
const ( LKTxType = "lk" LKRawTxType = "tx" LKValidatorType = "val" // del )
View Source
const (
ServiceName = "lk"
)
Variables ¶
Functions ¶
func CheckTxSign ¶
func CheckTxSign(tx *LKTransaction, pub string) error
Types ¶
type ContractTransaction ¶
type ContractTransaction struct { TxHash common.Hash `json:"tx_hash"` From common.Address `json:"from"` To common.Address `json:"address"` Value *big.Int `json:"value"` Index int `json:"index"` BlockNum *big.Int `json:"block_num"` // contains filtered or unexported fields }
func (*ContractTransaction) Hash ¶
func (tx *ContractTransaction) Hash() common.Hash
func (*ContractTransaction) String ¶
func (tx *ContractTransaction) String() string
type EthTransaction ¶
type EthTransaction struct { Tx *types.Transaction `json:"tx"` GasUsed *big.Int `json:"gas_used"` // Result: 0(success), others(fail, details come with Errmsg field) Ret int `json:"ret"` Errmsg string `json:"errmsg"` }
func (*EthTransaction) Hash ¶
func (tx *EthTransaction) Hash() common.Hash
func (*EthTransaction) String ¶
func (tx *EthTransaction) String() string
func (*EthTransaction) TxHash ¶
func (tx *EthTransaction) TxHash() common.Hash
type LKBlock ¶
type LKTransaction ¶
type LKTransaction struct { Type string `json:"type"` ETx *EthTransaction `json:"etx"` CTx *ContractTransaction `json:"ctx"` STx *SuicideTransaction `json:"stx"` Sign string `json:"sign"` }
func FromEtherTx ¶
func FromEtherTx(txHexBytes string) (*LKTransaction, error)
func SignTx ¶
func SignTx(tx *LKTransaction, prv string) (*LKTransaction, error)
SignTx signs the transaction using the given private key
func (*LKTransaction) BlockNum ¶
func (d *LKTransaction) BlockNum() *big.Int
func (*LKTransaction) Decode ¶
func (tx *LKTransaction) Decode(s string) error
func (*LKTransaction) Encode ¶
func (tx *LKTransaction) Encode() string
func (*LKTransaction) Hash ¶
func (tx *LKTransaction) Hash() common.Hash
func (*LKTransaction) String ¶
func (d *LKTransaction) String() string
func (*LKTransaction) TxHash ¶
func (tx *LKTransaction) TxHash() common.Hash
type SuicideTransaction ¶
type SuicideTransaction struct { TxHash common.Hash `json:"tx_hash"` From common.Address `json:"from"` To common.Address `json:"to"` Target common.Address `json:"target"` Index int `json:"index"` Value *big.Int `json:"value"` BlockNum *big.Int `json:"block_num"` // contains filtered or unexported fields }
func (*SuicideTransaction) Hash ¶
func (tx *SuicideTransaction) Hash() common.Hash
func (*SuicideTransaction) String ¶
func (tx *SuicideTransaction) String() string
type TxRecordReq ¶
type WrappedLKTransaction ¶
type WrappedLKTransaction struct { LKx *LKTransaction `json:"lkx"` BlockNum *big.Int `json:"block_num"` }
func (*WrappedLKTransaction) String ¶
func (w *WrappedLKTransaction) String() string
Click to show internal directories.
Click to hide internal directories.