factory

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: LGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AliceAddrV = common.HexToAddress("0x00005586B883Ec6dd4f8c26063E18eb4Bd228e59c3E9")
View Source
var AlicePrivV = "289c2857d4598e37fb9647507e47a309d6133539bf21a8b9cb6df88fd5232031"
View Source
var BobAddrV = common.HexToAddress("0x0000970e8128aB834E8EAC17aB8E3812f010678CF791")
View Source
var BobPrivV = "289c2857d4598e37fb9647507e47a309d6133539bf21a8b9cb6df88fd5232032"

Functions

func CreatKeyV

func CreatKeyV() (*ecdsa.PrivateKey, *ecdsa.PrivateKey)

func CreatTestTxV

func CreatTestTxV() (*model.Transaction, *model.Transaction)

func CreateBlock

func CreateBlock(number uint64) *model.Block

func CreateBlock2

func CreateBlock2(diff common.Difficulty, number uint64) *model.Block

func CreateBlockByPH

func CreateBlockByPH(number uint64, preHash common.Hash) *model.Block

func CreateBlockBySeed

func CreateBlockBySeed(number uint64, preHash, seed common.Hash, proof, pubKey []byte) *model.Block

func CreateBlockV

func CreateBlockV() (*model.Block, *model.Block)

func CreateEmptyBlockByPH

func CreateEmptyBlockByPH(number uint64, preHash common.Hash) *model.Block

func CreateKey

func CreateKey() (*ecdsa.PrivateKey, *ecdsa.PrivateKey)

func CreateOneTxBlockByPH

func CreateOneTxBlockByPH(number uint64, preHash common.Hash, transaction *model.Transaction) *model.Block

func CreateSpecialBlock

func CreateSpecialBlock(number uint64) *model.Block

func CreateTestStateDBV

func CreateTestStateDBV() (state_processor.StateStorage, *state_processor.AccountStateDB, common.Hash)

func CreateTestTx

func CreateTestTx() (*model.Transaction, *model.Transaction)

func CreateTxsBlockByPH

func CreateTxsBlockByPH(number uint64, preHash common.Hash, transactions []*model.Transaction) *model.Block

func FactoryCreateTx

func FactoryCreateTx(senderPrk *ecdsa.PrivateKey, nonce uint64, toAddress common.Address,
	amount *big.Int, fee *big.Int, data []byte) *model.Transaction

func GetEnode

func GetEnode(str string) *enode.Node

func InitTestV

func InitTestV() (alice, bob *ecdsa.PrivateKey, fr *fakeChainReader)

func NewFakeReader

func NewFakeReader(block *model.Block) *fakeChainReader

ChainReader test set

Types

type FAddress

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

func NewFAddress

func NewFAddress(count int) *FAddress

func (*FAddress) Alloc

func (receiver *FAddress) Alloc() map[common.Address]*big.Int

func (*FAddress) GetAddress

func (receiver *FAddress) GetAddress(index int) common.Address

func (*FAddress) GetPrk

func (receiver *FAddress) GetPrk(index int) *ecdsa.PrivateKey

type FBlock

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

func NewFBlock

func NewFBlock(number uint64, perHash common.Hash, difficulty common.Difficulty, coinbase common.Address) *FBlock
func (receiver *FBlock) AddInterLink(il model.InterLink) *FBlock

func (*FBlock) AddTx

func (receiver *FBlock) AddTx(tx *model.Transaction) *FBlock

func (*FBlock) AddTxs

func (receiver *FBlock) AddTxs(txs []*model.Transaction) *FBlock

func (*FBlock) AddVers

func (receiver *FBlock) AddVers(vers []model.AbstractVerification) *FBlock

type FTx

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

func NewFTx

func NewFTx(prkStr *ecdsa.PrivateKey, nonce uint64) *FTx

func (*FTx) CreateTx

func (receiver *FTx) CreateTx(toAddress common.Address, amount *big.Int, fee *big.Int, data []byte) *FTx

func (*FTx) GetTxs

func (receiver *FTx) GetTxs() []*model.Transaction

Jump to

Keyboard shortcuts

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