builder

package
v1.10.17-rc.11 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package builder is a generated GoMock package.

Index

Constants

View Source
const MaxPageSize = 1024

Max number of items allowed in a page

Variables

View Source
var (
	ErrNoFunds = errors.New("no spendable funds were found")
)

Functions

This section is empty.

Types

type AtomicTxBuilder

type AtomicTxBuilder interface {
	// chainID: chain to import UTXOs from
	// to: address of recipient
	// keys: keys to import the funds
	// changeAddr: address to send change to, if there is any
	NewImportTx(
		chainID ids.ID,
		to ids.ShortID,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)

	// amount: amount of tokens to export
	// chainID: chain to send the UTXOs to
	// to: address of recipient
	// keys: keys to pay the fee and provide the tokens
	// changeAddr: address to send change to, if there is any
	NewExportTx(
		amount uint64,
		chainID ids.ID,
		to ids.ShortID,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)
}

type Builder added in v1.7.18

func New added in v1.7.18

func New(
	ctx *snow.Context,
	cfg *config.Config,
	clk *mockable.Clock,
	fx fx.Fx,
	state state.State,
	atomicUTXOManager avax.AtomicUTXOManager,
	utxoSpender utxo.Spender,
) Builder

type DecisionTxBuilder

type DecisionTxBuilder interface {
	// subnetID: ID of the subnet that validates the new chain
	// genesisData: byte repr. of genesis state of the new chain
	// vmID: ID of VM this chain runs
	// fxIDs: ids of features extensions this chain supports
	// chainName: name of the chain
	// keys: keys to sign the tx
	// changeAddr: address to send change to, if there is any
	NewCreateChainTx(
		subnetID ids.ID,
		genesisData []byte,
		vmID ids.ID,
		fxIDs []ids.ID,
		chainName string,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)

	// threshold: [threshold] of [ownerAddrs] needed to manage this subnet
	// ownerAddrs: control addresses for the new subnet
	// keys: keys to pay the fee
	// changeAddr: address to send change to, if there is any
	NewCreateSubnetTx(
		threshold uint32,
		ownerAddrs []ids.ShortID,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)

	// amount: amount the sender is sending
	// owner: recipient of the funds
	// keys: keys to sign the tx and pay the amount
	// changeAddr: address to send change to, if there is any
	NewBaseTx(
		amount uint64,
		owner secp256k1fx.OutputOwners,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)
}

type MockBuilder added in v1.8.0

type MockBuilder struct {
	// contains filtered or unexported fields
}

MockBuilder is a mock of Builder interface.

func NewMockBuilder added in v1.8.0

func NewMockBuilder(ctrl *gomock.Controller) *MockBuilder

NewMockBuilder creates a new mock instance.

func (*MockBuilder) EXPECT added in v1.8.0

func (m *MockBuilder) EXPECT() *MockBuilderMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBuilder) NewAddDelegatorTx added in v1.8.0

func (m *MockBuilder) NewAddDelegatorTx(arg0, arg1, arg2 uint64, arg3 ids.NodeID, arg4 ids.ShortID, arg5 []*secp256k1.PrivateKey, arg6 ids.ShortID) (*txs.Tx, error)

NewAddDelegatorTx mocks base method.

func (*MockBuilder) NewAddSubnetValidatorTx added in v1.8.0

func (m *MockBuilder) NewAddSubnetValidatorTx(arg0, arg1, arg2 uint64, arg3 ids.NodeID, arg4 ids.ID, arg5 []*secp256k1.PrivateKey, arg6 ids.ShortID) (*txs.Tx, error)

NewAddSubnetValidatorTx mocks base method.

func (*MockBuilder) NewAddValidatorTx added in v1.8.0

func (m *MockBuilder) NewAddValidatorTx(arg0, arg1, arg2 uint64, arg3 ids.NodeID, arg4 ids.ShortID, arg5 uint32, arg6 []*secp256k1.PrivateKey, arg7 ids.ShortID) (*txs.Tx, error)

NewAddValidatorTx mocks base method.

func (*MockBuilder) NewAdvanceTimeTx added in v1.8.0

func (m *MockBuilder) NewAdvanceTimeTx(arg0 time.Time) (*txs.Tx, error)

NewAdvanceTimeTx mocks base method.

func (*MockBuilder) NewBaseTx added in v1.10.15

func (m *MockBuilder) NewBaseTx(arg0 uint64, arg1 secp256k1fx.OutputOwners, arg2 []*secp256k1.PrivateKey, arg3 ids.ShortID) (*txs.Tx, error)

NewBaseTx mocks base method.

func (*MockBuilder) NewCreateChainTx added in v1.8.0

func (m *MockBuilder) NewCreateChainTx(arg0 ids.ID, arg1 []byte, arg2 ids.ID, arg3 []ids.ID, arg4 string, arg5 []*secp256k1.PrivateKey, arg6 ids.ShortID) (*txs.Tx, error)

NewCreateChainTx mocks base method.

func (*MockBuilder) NewCreateSubnetTx added in v1.8.0

func (m *MockBuilder) NewCreateSubnetTx(arg0 uint32, arg1 []ids.ShortID, arg2 []*secp256k1.PrivateKey, arg3 ids.ShortID) (*txs.Tx, error)

NewCreateSubnetTx mocks base method.

func (*MockBuilder) NewExportTx added in v1.8.0

func (m *MockBuilder) NewExportTx(arg0 uint64, arg1 ids.ID, arg2 ids.ShortID, arg3 []*secp256k1.PrivateKey, arg4 ids.ShortID) (*txs.Tx, error)

NewExportTx mocks base method.

func (*MockBuilder) NewImportTx added in v1.8.0

func (m *MockBuilder) NewImportTx(arg0 ids.ID, arg1 ids.ShortID, arg2 []*secp256k1.PrivateKey, arg3 ids.ShortID) (*txs.Tx, error)

NewImportTx mocks base method.

func (*MockBuilder) NewRemoveSubnetValidatorTx added in v1.8.0

func (m *MockBuilder) NewRemoveSubnetValidatorTx(arg0 ids.NodeID, arg1 ids.ID, arg2 []*secp256k1.PrivateKey, arg3 ids.ShortID) (*txs.Tx, error)

NewRemoveSubnetValidatorTx mocks base method.

func (*MockBuilder) NewRewardValidatorTx added in v1.8.0

func (m *MockBuilder) NewRewardValidatorTx(arg0 ids.ID) (*txs.Tx, error)

NewRewardValidatorTx mocks base method.

func (*MockBuilder) NewTransferSubnetOwnershipTx added in v1.10.14

func (m *MockBuilder) NewTransferSubnetOwnershipTx(arg0 ids.ID, arg1 uint32, arg2 []ids.ShortID, arg3 []*secp256k1.PrivateKey, arg4 ids.ShortID) (*txs.Tx, error)

NewTransferSubnetOwnershipTx mocks base method.

type MockBuilderMockRecorder added in v1.8.0

type MockBuilderMockRecorder struct {
	// contains filtered or unexported fields
}

MockBuilderMockRecorder is the mock recorder for MockBuilder.

func (*MockBuilderMockRecorder) NewAddDelegatorTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewAddDelegatorTx(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call

NewAddDelegatorTx indicates an expected call of NewAddDelegatorTx.

func (*MockBuilderMockRecorder) NewAddSubnetValidatorTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewAddSubnetValidatorTx(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call

NewAddSubnetValidatorTx indicates an expected call of NewAddSubnetValidatorTx.

func (*MockBuilderMockRecorder) NewAddValidatorTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewAddValidatorTx(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call

NewAddValidatorTx indicates an expected call of NewAddValidatorTx.

func (*MockBuilderMockRecorder) NewAdvanceTimeTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewAdvanceTimeTx(arg0 interface{}) *gomock.Call

NewAdvanceTimeTx indicates an expected call of NewAdvanceTimeTx.

func (*MockBuilderMockRecorder) NewBaseTx added in v1.10.15

func (mr *MockBuilderMockRecorder) NewBaseTx(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

NewBaseTx indicates an expected call of NewBaseTx.

func (*MockBuilderMockRecorder) NewCreateChainTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewCreateChainTx(arg0, arg1, arg2, arg3, arg4, arg5, arg6 interface{}) *gomock.Call

NewCreateChainTx indicates an expected call of NewCreateChainTx.

func (*MockBuilderMockRecorder) NewCreateSubnetTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewCreateSubnetTx(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

NewCreateSubnetTx indicates an expected call of NewCreateSubnetTx.

func (*MockBuilderMockRecorder) NewExportTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewExportTx(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

NewExportTx indicates an expected call of NewExportTx.

func (*MockBuilderMockRecorder) NewImportTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewImportTx(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

NewImportTx indicates an expected call of NewImportTx.

func (*MockBuilderMockRecorder) NewRemoveSubnetValidatorTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewRemoveSubnetValidatorTx(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

NewRemoveSubnetValidatorTx indicates an expected call of NewRemoveSubnetValidatorTx.

func (*MockBuilderMockRecorder) NewRewardValidatorTx added in v1.8.0

func (mr *MockBuilderMockRecorder) NewRewardValidatorTx(arg0 interface{}) *gomock.Call

NewRewardValidatorTx indicates an expected call of NewRewardValidatorTx.

func (*MockBuilderMockRecorder) NewTransferSubnetOwnershipTx added in v1.10.14

func (mr *MockBuilderMockRecorder) NewTransferSubnetOwnershipTx(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

NewTransferSubnetOwnershipTx indicates an expected call of NewTransferSubnetOwnershipTx.

type ProposalTxBuilder

type ProposalTxBuilder interface {
	// stakeAmount: amount the validator stakes
	// startTime: unix time they start validating
	// endTime: unix time they stop validating
	// nodeID: ID of the node we want to validate with
	// rewardAddress: address to send reward to, if applicable
	// shares: 10,000 times percentage of reward taken from delegators
	// keys: Keys providing the staked tokens
	// changeAddr: Address to send change to, if there is any
	NewAddValidatorTx(
		stakeAmount,
		startTime,
		endTime uint64,
		nodeID ids.NodeID,
		rewardAddress ids.ShortID,
		shares uint32,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)

	// stakeAmount: amount the delegator stakes
	// startTime: unix time they start delegating
	// endTime: unix time they stop delegating
	// nodeID: ID of the node we are delegating to
	// rewardAddress: address to send reward to, if applicable
	// keys: keys providing the staked tokens
	// changeAddr: address to send change to, if there is any
	NewAddDelegatorTx(
		stakeAmount,
		startTime,
		endTime uint64,
		nodeID ids.NodeID,
		rewardAddress ids.ShortID,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)

	// weight: sampling weight of the new validator
	// startTime: unix time they start delegating
	// endTime:  unix time they top delegating
	// nodeID: ID of the node validating
	// subnetID: ID of the subnet the validator will validate
	// keys: keys to use for adding the validator
	// changeAddr: address to send change to, if there is any
	NewAddSubnetValidatorTx(
		weight,
		startTime,
		endTime uint64,
		nodeID ids.NodeID,
		subnetID ids.ID,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)

	// Creates a transaction that removes [nodeID]
	// as a validator from [subnetID]
	// keys: keys to use for removing the validator
	// changeAddr: address to send change to, if there is any
	NewRemoveSubnetValidatorTx(
		nodeID ids.NodeID,
		subnetID ids.ID,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)

	// Creates a transaction that transfers ownership of [subnetID]
	// threshold: [threshold] of [ownerAddrs] needed to manage this subnet
	// ownerAddrs: control addresses for the new subnet
	// keys: keys to use for modifying the subnet
	// changeAddr: address to send change to, if there is any
	NewTransferSubnetOwnershipTx(
		subnetID ids.ID,
		threshold uint32,
		ownerAddrs []ids.ShortID,
		keys []*secp256k1.PrivateKey,
		changeAddr ids.ShortID,
	) (*txs.Tx, error)

	// newAdvanceTimeTx creates a new tx that, if it is accepted and followed by a
	// Commit block, will set the chain's timestamp to [timestamp].
	NewAdvanceTimeTx(timestamp time.Time) (*txs.Tx, error)

	// RewardStakerTx creates a new transaction that proposes to remove the staker
	// [validatorID] from the default validator set.
	NewRewardValidatorTx(txID ids.ID) (*txs.Tx, error)
}

Jump to

Keyboard shortcuts

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