helpers

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenesisTime = time.Date(2022, 7, 1, 0, 0, 0, 0, time.UTC)

Functions

func CreditCredits

func CreditCredits(t testing.TB, db database.Updater, account *url.URL, amount uint64)

func CreditTokens

func CreditTokens(t testing.TB, db database.Updater, account *url.URL, amount *big.Int)

func GetAccount

func GetAccount[T protocol.Account](t testing.TB, db database.Viewer, account *url.URL) T

func MakeAccount

func MakeAccount(t testing.TB, db database.Updater, account ...protocol.Account)

MakeAccount writes the account's main state, adds a directory entry to the parent, and inherits the parent's authority if non is specified.

func MakeIdentity

func MakeIdentity(t testing.TB, db database.Updater, u *url.URL, pubKeys ...[]byte)

func MakeKeyBook

func MakeKeyBook(t testing.TB, db database.Updater, u *url.URL, pubKeys ...[]byte)

func MakeKeyPage

func MakeKeyPage(t testing.TB, db database.Updater, book *url.URL, pubKeys ...[]byte)

func MakeLiteTokenAccount

func MakeLiteTokenAccount(t testing.TB, db database.Updater, pubKey []byte, token *url.URL) *url.URL

func MustBuild

func MustBuild(t testing.TB, b interface {
	Done() (*protocol.Envelope, error)
}) *chain.Delivery

func PutAccount

func PutAccount(t testing.TB, db database.Updater, account protocol.Account)

PutAccount writes the account's main state.

func TryMakeAccount

func TryMakeAccount(t testing.TB, db database.Updater, account ...protocol.Account) error

TryMakeAccount writes the account's main state, adds a directory entry to the parent, and inherits the parent's authority if non is specified.

func Txn

func Txn(id *url.TxID) *condTxn

func Update

func Update(t testing.TB, db database.Updater, fn func(batch *database.Batch))

func UpdateAccount

func UpdateAccount[T protocol.Account](t testing.TB, db database.Updater, account *url.URL, fn func(T))

func View

func View(t testing.TB, db database.Viewer, fn func(batch *database.Batch))

Types

type Condition

type Condition func(sim *Sim) bool

type Sim

type Sim struct {
	*simulator.Simulator
	T testing.TB
}

func NewSim

func (*Sim) GetStatus

func (s *Sim) GetStatus(txid *url.TxID) *protocol.TransactionStatus

func (*Sim) Step

func (s *Sim) Step()

func (*Sim) StepN

func (s *Sim) StepN(n int)

func (*Sim) StepUntil

func (s *Sim) StepUntil(conditions ...Condition)

func (*Sim) Submit

func (s *Sim) Submit(delivery *chain.Delivery) *protocol.TransactionStatus

func (*Sim) SubmitSuccessfully

func (s *Sim) SubmitSuccessfully(delivery *chain.Delivery) *protocol.TransactionStatus

Jump to

Keyboard shortcuts

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