Documentation ¶
Index ¶
- Variables
- func GetAccount[T protocol.Account](sim *Simulator, accountUrl *url.URL) T
- func GetTxnState[V any, T interface{ ... }](sim *Simulator, txid *url.TxID, state func(*database.Transaction) T) V
- type FakeNode
- func (n *FakeNode) Assert() *assert.Assertions
- func (n *FakeNode) Execute(inBlock func(func(*messaging.Envelope))) (sigHashes, txnHashes [][32]byte, err error)
- func (n *FakeNode) GetADI(s string) *protocol.ADI
- func (n *FakeNode) GetDataAccount(s string) *protocol.DataAccount
- func (n *FakeNode) GetDataEntry(s string, q *api.DataQuery) protocol.DataEntry
- func (n *FakeNode) GetDirectory(s string) []string
- func (n *FakeNode) GetKeyBook(s string) *protocol.KeyBook
- func (n *FakeNode) GetKeyPage(s string) *protocol.KeyPage
- func (n *FakeNode) GetLiteDataAccount(s string) *protocol.LiteDataAccount
- func (n *FakeNode) GetLiteIdentity(s string) *protocol.LiteIdentity
- func (n *FakeNode) GetLiteTokenAccount(s string) *protocol.LiteTokenAccount
- func (n *FakeNode) GetOraclePrice() uint64
- func (n *FakeNode) GetTokenAccount(s string) *protocol.TokenAccount
- func (n *FakeNode) GetTokenIssuer(s string) *protocol.TokenIssuer
- func (n *FakeNode) MustExecute(inBlock func(func(*messaging.Envelope))) (sigHashes, txnHashes [][32]byte)
- func (n *FakeNode) MustExecuteAndWait(inBlock func(func(*messaging.Envelope))) [][32]byte
- func (n *FakeNode) QueryAccountAs(s string, result any)
- func (n *FakeNode) QueryTx(txid []byte, wait time.Duration, ignorePending bool) *api.TransactionRecord
- func (n *FakeNode) Require() *require.Assertions
- func (n *FakeNode) T() testing.TB
- func (n *FakeNode) Update(fn func(batch *database.Batch))
- func (n *FakeNode) View(fn func(batch *database.Batch))
- type Partition
- type Simulator
- func (s *Simulator) CreateAccount(account protocol.Account)
- func (s *Simulator) CreateIdentity(identityUrl *url.URL, pubKey ...[]byte)
- func (s *Simulator) CreateKeyBook(bookUrl *url.URL, pubKey ...[]byte)
- func (s *Simulator) CreateKeyPage(bookUrl *url.URL, pubKey ...[]byte)
- func (s *Simulator) CreateLiteTokenAccount(key []byte, token *url.URL, credits, tokens uint64) *url.URL
- func (s *Simulator) ExecuteBlock(interface{ ... })
- func (s *Simulator) ExecuteBlocks(n int)
- func (s *Simulator) Init(from simulator.SnapshotFunc)
- func (s *Simulator) InitFromGenesis()
- func (s *Simulator) InitFromGenesisWith(values *core.GlobalValues)
- func (s *Simulator) InitFromSnapshot(filename func(string) string)
- func (s *Simulator) MustSubmitAndExecuteBlock(envelopes ...*messaging.Envelope) []*messaging.Envelope
- func (s *Simulator) Partition(part string) *Partition
- func (s *Simulator) PartitionFor(u *url.URL) *Partition
- func (s *Simulator) Router() routing.Router
- func (s *Simulator) SetRouteFor(u *url.URL, p string)
- func (sim *Simulator) Setup(opts SimulatorOptions)
- func (s *Simulator) Submit(envelopes ...*messaging.Envelope) ([]*messaging.Envelope, error)
- func (s *Simulator) SubmitAndExecuteBlock(envelopes ...*messaging.Envelope) ([]*protocol.TransactionStatus, error)
- func (s *Simulator) UpdateAccount(accountUrl *url.URL, fn func(account protocol.Account))
- func (s *Simulator) WaitForTransaction(statusCheck func(*protocol.TransactionStatus) bool, txnHash []byte, n int) (*protocol.Transaction, *protocol.TransactionStatus, []*url.TxID)
- func (s *Simulator) WaitForTransactionFlow(statusCheck func(*protocol.TransactionStatus) bool, txnHash []byte) ([]*protocol.TransactionStatus, []*protocol.Transaction)
- func (s *Simulator) WaitForTransactions(status func(*protocol.TransactionStatus) bool, ...) ([]*protocol.TransactionStatus, []*protocol.Transaction)
- type SimulatorOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var GenesisTime = time.Date(2022, 7, 1, 0, 0, 0, 0, time.UTC)
Functions ¶
func GetTxnState ¶
Types ¶
type FakeNode ¶
FakeNode is a compatibility shim for tests based on abci_test.FakeNode.
func (*FakeNode) Assert ¶
func (n *FakeNode) Assert() *assert.Assertions
func (*FakeNode) GetDataAccount ¶
func (n *FakeNode) GetDataAccount(s string) *protocol.DataAccount
func (*FakeNode) GetDataEntry ¶
func (*FakeNode) GetDirectory ¶
func (*FakeNode) GetLiteDataAccount ¶
func (n *FakeNode) GetLiteDataAccount(s string) *protocol.LiteDataAccount
func (*FakeNode) GetLiteIdentity ¶
func (n *FakeNode) GetLiteIdentity(s string) *protocol.LiteIdentity
func (*FakeNode) GetLiteTokenAccount ¶
func (n *FakeNode) GetLiteTokenAccount(s string) *protocol.LiteTokenAccount
func (*FakeNode) GetOraclePrice ¶
func (*FakeNode) GetTokenAccount ¶
func (n *FakeNode) GetTokenAccount(s string) *protocol.TokenAccount
func (*FakeNode) GetTokenIssuer ¶
func (n *FakeNode) GetTokenIssuer(s string) *protocol.TokenIssuer
func (*FakeNode) MustExecute ¶
func (*FakeNode) MustExecuteAndWait ¶
func (*FakeNode) QueryAccountAs ¶
func (*FakeNode) Require ¶
func (n *FakeNode) Require() *require.Assertions
type Partition ¶
type Partition struct { ID string Database database.Beginner API *client.Client Executor struct { Key []byte Describe config.Describe } database.Beginner // contains filtered or unexported fields }
func (*Partition) Globals ¶
func (p *Partition) Globals() *core.GlobalValues
type Simulator ¶
type Simulator struct { S *simulator.Simulator H *harness.Sim // setup TB testing.TB // contains filtered or unexported fields }
func (*Simulator) CreateAccount ¶
func (*Simulator) CreateIdentity ¶
func (*Simulator) CreateKeyBook ¶
func (*Simulator) CreateKeyPage ¶
func (*Simulator) CreateLiteTokenAccount ¶
func (*Simulator) ExecuteBlock ¶
func (s *Simulator) ExecuteBlock(interface{ x() })
func (*Simulator) ExecuteBlocks ¶
func (*Simulator) Init ¶
func (s *Simulator) Init(from simulator.SnapshotFunc)
func (*Simulator) InitFromGenesis ¶
func (s *Simulator) InitFromGenesis()
func (*Simulator) InitFromGenesisWith ¶
func (s *Simulator) InitFromGenesisWith(values *core.GlobalValues)
func (*Simulator) InitFromSnapshot ¶
func (*Simulator) MustSubmitAndExecuteBlock ¶
func (*Simulator) Setup ¶
func (sim *Simulator) Setup(opts SimulatorOptions)
func (*Simulator) SubmitAndExecuteBlock ¶
func (*Simulator) UpdateAccount ¶
func (*Simulator) WaitForTransaction ¶
func (s *Simulator) WaitForTransaction(statusCheck func(*protocol.TransactionStatus) bool, txnHash []byte, n int) (*protocol.Transaction, *protocol.TransactionStatus, []*url.TxID)
func (*Simulator) WaitForTransactionFlow ¶
func (s *Simulator) WaitForTransactionFlow(statusCheck func(*protocol.TransactionStatus) bool, txnHash []byte) ([]*protocol.TransactionStatus, []*protocol.Transaction)
func (*Simulator) WaitForTransactions ¶
func (s *Simulator) WaitForTransactions(status func(*protocol.TransactionStatus) bool, envelopes ...*messaging.Envelope) ([]*protocol.TransactionStatus, []*protocol.Transaction)
type SimulatorOptions ¶
type SimulatorOptions struct { BvnCount int LogLevels string OpenDB simulator.OpenDatabaseFunc Snapshots []func() (ioutil2.SectionReader, error) }
Click to show internal directories.
Click to hide internal directories.