testutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateInitialBillTransferTx

func CreateInitialBillTransferTx(accountKey *account.AccountKey, billID, fcrID types.UnitID, billValue uint64, timeout uint64, backlink []byte) (*types.TransactionOrder, error)

func MoneyGenesisState

func MoneyGenesisState(t *testing.T, config *MoneyGenesisConfig) *state.State

func NewMoneyBill added in v0.4.0

func NewMoneyBill(unitIDPart []byte, billData *money.BillData) *api.Bill

func NewMoneyFCR added in v0.4.0

func NewMoneyFCR(pubKeyHash []byte, fcrData *unit.FeeCreditRecord) *api.FeeCreditBill

Types

type MoneyGenesisConfig

type MoneyGenesisConfig struct {
	InitialBillID      types.UnitID
	InitialBillValue   uint64
	InitialBillOwner   types.PredicateBytes
	DCMoneySupplyValue uint64
	SDRs               []*genesis.SystemDescriptionRecord
}

type Option added in v0.4.0

type Option func(*Options)

func WithError added in v0.4.0

func WithError(err error) Option

func WithOwnerBill added in v0.4.0

func WithOwnerBill(bill *api.Bill) Option

func WithOwnerFeeCreditBill added in v0.4.0

func WithOwnerFeeCreditBill(fcb *api.FeeCreditBill) Option

func WithRoundNumber added in v0.4.0

func WithRoundNumber(roundNumber uint64) Option

func WithTxProof added in v0.4.0

func WithTxProof(txHash []byte, txProof *wallet.Proof) Option

type Options added in v0.4.0

type Options struct {
	Err            error
	RoundNumber    uint64
	TxProofs       map[string]*wallet.Proof
	Bills          map[string]*api.Bill
	FeeCreditBills map[string]*api.FeeCreditBill
	OwnerUnits     []types.UnitID
}

type RpcClientMock added in v0.4.0

type RpcClientMock struct {
	Err            error
	Bills          map[string]*api.Bill
	FeeCreditBills map[string]*api.FeeCreditBill
	OwnerUnits     []types.UnitID
	RoundNumber    uint64
	TxProofs       map[string]*wallet.Proof

	RecordedTxs []*types.TransactionOrder
}

func NewRpcClientMock added in v0.4.0

func NewRpcClientMock(opts ...Option) *RpcClientMock

func (*RpcClientMock) GetBill added in v0.4.0

func (c *RpcClientMock) GetBill(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*api.Bill, error)

func (*RpcClientMock) GetBlock added in v0.4.0

func (c *RpcClientMock) GetBlock(ctx context.Context, blockNumber uint64) (*types.Block, error)

func (*RpcClientMock) GetFeeCreditRecord added in v0.4.0

func (c *RpcClientMock) GetFeeCreditRecord(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*api.FeeCreditBill, error)

func (*RpcClientMock) GetRoundNumber added in v0.4.0

func (c *RpcClientMock) GetRoundNumber(ctx context.Context) (uint64, error)

func (*RpcClientMock) GetTransactionProof added in v0.4.0

func (c *RpcClientMock) GetTransactionProof(ctx context.Context, txHash types.Bytes) (*types.TransactionRecord, *types.TxProof, error)

func (*RpcClientMock) GetUnitsByOwnerID added in v0.4.0

func (c *RpcClientMock) GetUnitsByOwnerID(ctx context.Context, ownerID types.Bytes) ([]types.UnitID, error)

func (*RpcClientMock) SendTransaction added in v0.4.0

func (c *RpcClientMock) SendTransaction(ctx context.Context, tx *types.TransactionOrder) ([]byte, error)

Jump to

Keyboard shortcuts

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