attack

package
v0.0.0-...-94114ed Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SendTxs = iota
	SendBlock
	Sleep
	Exit
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Key     hexutil.Bytes
	Balance uint64
	Code    hexutil.Bytes
	Salt    hexutil.Bytes
}

type Attack

type Attack struct {
	Initialization
	Routines []Routine
}

func (*Attack) Accounts

func (a *Attack) Accounts() map[common.Address]Account

func (*Attack) Load

func (a *Attack) Load(s string) error

func (*Attack) NewRunner

func (a *Attack) NewRunner(bc *core.BlockChain, c chan Routine) (*Runner, error)

func (*Attack) SignAndAssemble

func (a *Attack) SignAndAssemble(bc *core.BlockChain) error

type Initialization

type Initialization struct {
	Height   uint64
	Accounts map[common.Address]Account
}

type Routine

type Routine struct {
	Ty                 int
	Transactions       []*Transaction
	SignedTransactions types.Transactions
	SignedBlock        *types.Block
	SleepDuration      time.Duration `yaml:"sleep-duration"`
}

type Runner

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

func (*Runner) Run

func (r *Runner) Run() error

type Transaction

type Transaction struct {
	To       common.Address
	From     common.Address
	Nonce    uint64
	Data     hexutil.Bytes
	Amount   uint64
	GasPrice uint64 `yaml:"gas-price"`
	GasLimit uint64 `yaml:"gas-limit"`
}

Jump to

Keyboard shortcuts

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