Documentation ¶
Index ¶
- func CompareBatches(t *testing.T, want, got *voucher.Batch)
- func CompareChainState(t *testing.T, want, got *voucher.ChainState)
- func MustNewAddress() []byte
- func MustNewBatch(opts ...BatchOption) *voucher.Batch
- func MustNewBatchStamp(batch []byte) *voucher.Stamp
- func MustNewID() []byte
- func MustNewSignature() []byte
- func MustNewStamp() *voucher.Stamp
- func NewBigInt() *big.Int
- func NewChainState() *voucher.ChainState
- type BatchOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareBatches ¶
CompareBatches is a testing helper that compares two batches and fails the test if all fields are not equal. Fails on first different value and prints the comparison.
func CompareChainState ¶
func CompareChainState(t *testing.T, want, got *voucher.ChainState)
CompareChainState is a test helper that compares two ChainStates and fails the test if they are not exactly equal. Fails on first difference and returns a descriptive comparison.
func MustNewAddress ¶
func MustNewAddress() []byte
MustNewAddress will generate a new random address (20 byte slice). Panics on errors.
func MustNewBatch ¶
func MustNewBatch(opts ...BatchOption) *voucher.Batch
MustNewBatch will create a new test batch. Fields that are not supplied will be filled with random data. Panics on errors.
func MustNewBatchStamp ¶
MustNewBatchStamp will generate a voucher stamp with the provided batch ID and assign random data to other fields. Panics on error
func MustNewID ¶
func MustNewID() []byte
MustNewID will generate a new random ID (32 byte slice). Panics on errors.
func MustNewSignature ¶
func MustNewSignature() []byte
MustNewSignature will create a new random signature (65 byte slice). Panics on errors.
func MustNewStamp ¶
MustNewStamp will generate a voucher stamp with random data. Panics on errors.
func NewChainState ¶
func NewChainState() *voucher.ChainState
NewChainState will create a new ChainState with random values.
Types ¶
type BatchOption ¶
BatchOption is an optional parameter for NewBatch
func WithDepth ¶
func WithDepth(depth uint8) BatchOption
WithDepth will set the batch Depth to the given depth.
func WithOwner ¶
func WithOwner(owner []byte) BatchOption
WithOwner will set the batch owner on a randomized batch.
func WithStart ¶
func WithStart(start uint64) BatchOption
WithStart will set the batch Start to the given start.
func WithValue ¶
func WithValue(value int64) BatchOption
WithValue will set the batch Value to the given value.