repl

package
v0.0.0-...-404ccd1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestMode = false

TestMode variable used for check if unit test is running

Functions

func Start

func Start(c Client)

Start starts REPL.

Types

type Client

type Client interface {
	CreateAccount(alias string) *accounts.Account
	CurrentAccount() *accounts.Account
	SetCurrentAccount(a *accounts.Account)
	AccountInfo(address string) (*accounts.AccountInfo, error)
	NodeInfo() (*client.NodeInfo, error)
	Sanity() error
	Transfer(recipient address.Address, nonce, amount, gasPrice, gasLimit uint64, key ed25519.PrivateKey) (string, error)
	ListAccounts() []string
	GetAccount(name string) (*accounts.Account, error)
	StoreAccounts() error
	NodeURL() string
	Rebel(datadir string, space uint, coinbase string) error
	ListTxs(address string) ([]string, error)
	SetCoinbase(coinbase string) error
}

Client interface to REPL clients.

type Mock

type Mock struct{}

Mock struct created temporarily while node doesn't implement the methods.

func (Mock) AccountInfo

func (Mock) AccountInfo(id string)

AccountInfo prints accountInfo info.

func (Mock) CreateAccount

func (Mock) CreateAccount(generatePassphrase bool, accountInfo string) error

CreateAccount creates accountInfo.

func (Mock) GetVariable

func (Mock) GetVariable(key string) string

GetVariable gets variable in node by key

func (Mock) IsAccountUnLock

func (Mock) IsAccountUnLock(id string) bool

IsAccountUnLock checks if the accountInfo with id is unlock.

func (Mock) LocalAccount

func (Mock) LocalAccount() *accounts.Account

CurrentAccount returns local accountInfo.

func (Mock) Lock

func (Mock) Lock(passphrase string) error

Lock locks local accountInfo or the accountInfo by passphrase.

func (Mock) NeedRestartNode

func (Mock) NeedRestartNode(params, flags []string) bool

NeedRestartNode checks if the params and flags that will be set need restart the node.

func (Mock) Restart

func (Mock) Restart(params, flags []string) error

Restart restarts node.

func (Mock) SetVariables

func (Mock) SetVariables(params, flags []string) error

SetVariables sets params or CLI flags values.

func (Mock) Setup

func (Mock) Setup(allocation string) error

Setup setup POST.

func (Mock) Transfer

func (Mock) Transfer(from, to, amount, passphrase string) error

Transfer transfers the amount from an accountInfo to the other.

func (Mock) Unlock

func (Mock) Unlock(passphrase string) error

Unlock unlock local accountInfo or the accountInfo by passphrase.

Jump to

Keyboard shortcuts

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