utils

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxAcceptanceAwait = 90 * time.Second
	AwaitInterval      = 1 * time.Second

	AwaitCommitmentInterval = 10 * time.Second
)

Variables

This section is empty.

Functions

func AwaitAddressUnspentOutputToBeAccepted

func AwaitAddressUnspentOutputToBeAccepted(ctx context.Context, logger log.Logger, clt models.Client, addr iotago.Address) (outputID iotago.OutputID, output iotago.Output, err error)

AwaitAddressUnspentOutputToBeAccepted awaits for acceptance of an output created for an address, based on the status of the transaction.

func AwaitBlockAndPayloadAcceptance

func AwaitBlockAndPayloadAcceptance(ctx context.Context, logger log.Logger, clt models.Client, blockID iotago.BlockID) error

AwaitBlockAndPayloadAcceptance waits for the block and, if provided, tx to be accepted.

func AwaitBlockWithTransactionToBeAccepted

func AwaitBlockWithTransactionToBeAccepted(ctx context.Context, logger log.Logger, clt models.Client, txID iotago.TransactionID) error

AwaitBlockWithTransactionToBeAccepted awaits for acceptance of a single transaction.

func AwaitCommitment

func AwaitCommitment(ctx context.Context, logger log.Logger, clt models.Client, targetSlot iotago.SlotIndex) error

AwaitCommitment awaits for the commitment of a slot.

func AwaitOutputToBeAccepted

func AwaitOutputToBeAccepted(ctx context.Context, clt models.Client, outputID iotago.OutputID) error

AwaitOutputToBeAccepted awaits for output from a provided outputID is accepted. Timeout is waitFor. Useful when we have only an address and no transactionID, e.g. faucet funds request.

func DelegationEnd

func DelegationEnd(apiForSlot iotago.API, issuingSlot iotago.SlotIndex, commitmentSlot iotago.SlotIndex) iotago.EpochIndex

func DelegationRegistrationSlot

func DelegationRegistrationSlot(apiForSlot iotago.API, slot iotago.SlotIndex) iotago.SlotIndex

func GetAccountIssuerKeys

func GetAccountIssuerKeys(pubKey crypto.PublicKey) (iotago.BlockIssuerKeys, error)

func SplitBalanceEqually

func SplitBalanceEqually[T iotago.BaseToken | iotago.Mana](splitNumber int, balance T) []T

SplitBalanceEqually splits the balance equally between `splitNumber` outputs.

func SprintAccount

func SprintAccount(acc *iotago.AccountOutput) string

func SprintAvailableManaResult

func SprintAvailableManaResult(results *builder.AvailableManaResult) string

func SprintCommittee

func SprintCommittee(resp *api.CommitteeResponse) string

func SprintCommitteeMember

func SprintCommitteeMember(resp *api.CommitteeMemberResponse) string

func SprintTransaction

func SprintTransaction(api iotago.API, tx *iotago.SignedTransaction) string

func SprintValidator

func SprintValidator(resp *api.ValidatorResponse) string

func SprintValidators

func SprintValidators(resp *api.ValidatorsResponse) string

func SumOutputsBalance

func SumOutputsBalance(outputs []*models.OutputData) iotago.BaseToken

Types

This section is empty.

Jump to

Keyboard shortcuts

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