moacchainTransaction

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SmallTag       byte = 0xC0
	LargeTag       byte = 0xF7
	ChainIDMainnet byte = 99
	ChainIDTestnet byte = 101
)

Variables

This section is empty.

Functions

func CreateEmptyRawTransactionAndHash

func CreateEmptyRawTransactionAndHash(to string, nonce uint64, amount, gasLimit, gasPrice *big.Int, isTestNet bool) (string, string, error)

func MoacSignature added in v1.0.38

func MoacSignature(prikey []byte, hash []byte) ([]byte, uint16)

@function:ETH signature @paramter[in]prikey pointer to private key @paramter[in]hash pointer to the hash of message(Transaction txt) @parameter[out]the first part is signature(r||s||v,total 65 byte); the second part

func SignRawTransaction

func SignRawTransaction(hash string, privateKey []byte) ([]byte, error)

func VerifyAndCombineRawTransaction

func VerifyAndCombineRawTransaction(emptyTrans, signature, publicKey string, isTestNet bool) (bool, string)

Types

type TxStruct

type TxStruct struct {
	Head           []byte
	Nonce          []byte
	SystemContract []byte
	GasPrice       []byte
	GasLimit       []byte
	Recipient      []byte
	Amount         []byte
	Payload        []byte
	ShardingFlag   []byte
	Via            []byte
	ChainID        []byte
	R              []byte
	S              []byte
}

func NewTxStruct

func NewTxStruct(to string, nonce uint64, amount, gasLimit, gasPrice *big.Int, signature []byte, isTestNet bool) (*TxStruct, error)

func (*TxStruct) ToBytes

func (tx *TxStruct) ToBytes() []byte

Jump to

Keyboard shortcuts

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