Documentation ¶
Index ¶
- Constants
- Variables
- func CreateClientFile(ctx context.Context, client api.FullNode, rseed int) (*api.ImportRes, []byte, error)
- func MakeDeal(t *testing.T, ctx context.Context, rseed int, client api.FullNode, ...)
- func MineUntilBlock(ctx context.Context, t *testing.T, fn TestNode, sn TestStorageNode, ...)
- func SendFunds(ctx context.Context, t *testing.T, sender TestNode, addr address.Address, ...)
- func TestApis(t *testing.T, b APIBuilder)
- func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration)
- func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration)
- func TestDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, carExport, fastRet bool, ...)
- func TestDealMining(t *testing.T, b APIBuilder, blocktime time.Duration, carExport bool)
- func TestDoubleDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch)
- func TestFastRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch)
- func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration)
- func TestPledgeSector(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int)
- func TestPublishDealsBatching(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch)
- func TestSDRUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration)
- func TestSecondDealRetrieval(t *testing.T, b APIBuilder, blocktime time.Duration)
- func TestTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration)
- func TestTerminate(t *testing.T, b APIBuilder, blocktime time.Duration)
- func TestWindowPost(t *testing.T, b APIBuilder, blocktime time.Duration, nSectors int)
- func TestWindowPostDispute(t *testing.T, b APIBuilder, blocktime time.Duration)
- func TestWindowPostDisputeFails(t *testing.T, b APIBuilder, blocktime time.Duration)
- func TestZeroPricePerByteRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch)
- type APIBuilder
- type BlockMiner
- type FullNodeOpts
- type OptionGenerator
- type StorageBuilder
- type StorageMiner
- type TestNode
- type TestStorageNode
Constants ¶
const GenesisPreseals = 2
const TestSpt = abi.RegisteredSealProof_StackedDrg2KiBV1_1
Variables ¶
var FullNodeWithActorsV4At = func(upgradeHeight abi.ChainEpoch) FullNodeOpts { if upgradeHeight == -1 { upgradeHeight = 3 } return FullNodeOpts{ Opts: func(nodes []TestNode) node.Option { return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{ Network: network.Version9, Height: 1, Migration: stmgr.UpgradeActorsV2, }, { Network: network.Version10, Height: 2, Migration: stmgr.UpgradeActorsV3, }, { Network: network.Version12, Height: upgradeHeight, Migration: stmgr.UpgradeActorsV4, }}) }, } }
var FullNodeWithSDRAt = func(calico, persian abi.ChainEpoch) FullNodeOpts { return FullNodeOpts{ Opts: func(nodes []TestNode) node.Option { return node.Override(new(stmgr.UpgradeSchedule), stmgr.UpgradeSchedule{{ Network: network.Version6, Height: 1, Migration: stmgr.UpgradeActorsV2, }, { Network: network.Version7, Height: calico, Migration: stmgr.UpgradeCalico, }, { Network: network.Version8, Height: persian, }}) }, } }
var MineNext = miner.MineReq{ InjectNulls: 0, Done: func(bool, abi.ChainEpoch, error) {}, }
var OneFull = DefaultFullOpts(1)
var OneMiner = []StorageMiner{{Full: 0, Preseal: PresealGenesis}}
var PresealGenesis = -1
var TwoFull = DefaultFullOpts(2)
Functions ¶
func CreateClientFile ¶ added in v1.1.1
func MineUntilBlock ¶ added in v0.5.5
func MineUntilBlock(ctx context.Context, t *testing.T, fn TestNode, sn TestStorageNode, cb func(abi.ChainEpoch))
func TestApis ¶
func TestApis(t *testing.T, b APIBuilder)
TestApis is the entry point to API test suite
func TestCCUpgrade ¶ added in v0.5.0
func TestCCUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration)
func TestDeadlineToggling ¶ added in v1.8.0
func TestDeadlineToggling(t *testing.T, b APIBuilder, blocktime time.Duration)
TestDeadlineToggling: * spins up a v3 network (miner A) * creates an inactive miner (miner B) * creates another miner, pledges a sector, waits for power (miner C)
* goes through v4 upgrade * goes through PP * creates minerD, minerE * makes sure that miner B/D are inactive, A/C still are * pledges sectors on miner B/D * precommits a sector on minerE * disables post on miner C * goes through PP 0.5PP * asserts that minerE is active * goes through rest of PP (1.5) * asserts that miner C loses power * asserts that miner B/D is active and has power * asserts that minerE is inactive * disables post on miner B * terminates sectors on miner D * goes through another PP * asserts that miner B loses power * asserts that miner D loses power, is inactive
func TestDealFlow ¶
func TestDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, carExport, fastRet bool, startEpoch abi.ChainEpoch)
func TestDealMining ¶ added in v0.3.0
func TestDoubleDealFlow ¶ added in v0.3.0
func TestDoubleDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch)
func TestFastRetrievalDealFlow ¶ added in v0.5.0
func TestFastRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch)
func TestPaymentChannels ¶ added in v0.5.0
func TestPaymentChannels(t *testing.T, b APIBuilder, blocktime time.Duration)
func TestPledgeSector ¶ added in v0.3.1
func TestPublishDealsBatching ¶ added in v1.4.2
func TestPublishDealsBatching(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch)
func TestSDRUpgrade ¶ added in v1.2.0
func TestSDRUpgrade(t *testing.T, b APIBuilder, blocktime time.Duration)
func TestSecondDealRetrieval ¶ added in v1.2.2
func TestSecondDealRetrieval(t *testing.T, b APIBuilder, blocktime time.Duration)
func TestTapeFix ¶ added in v0.10.1
func TestTapeFix(t *testing.T, b APIBuilder, blocktime time.Duration)
func TestTerminate ¶ added in v1.4.1
func TestTerminate(t *testing.T, b APIBuilder, blocktime time.Duration)
func TestWindowPost ¶ added in v0.3.1
func TestWindowPostDispute ¶ added in v1.4.2
func TestWindowPostDispute(t *testing.T, b APIBuilder, blocktime time.Duration)
func TestWindowPostDisputeFails ¶ added in v1.4.2
func TestWindowPostDisputeFails(t *testing.T, b APIBuilder, blocktime time.Duration)
func TestZeroPricePerByteRetrievalDealFlow ¶ added in v1.4.2
func TestZeroPricePerByteRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch)
Types ¶
type APIBuilder ¶
type APIBuilder func(t *testing.T, full []FullNodeOpts, storage []StorageMiner) ([]TestNode, []TestStorageNode)
APIBuilder is a function which is invoked in test suite to provide test nodes and networks
fullOpts array defines options for each full node storage array defines storage nodes, numbers in the array specify full node index the storage node 'belongs' to
type BlockMiner ¶ added in v0.5.0
type BlockMiner struct {
// contains filtered or unexported fields
}
func NewBlockMiner ¶ added in v0.5.0
func NewBlockMiner(ctx context.Context, t *testing.T, miner TestStorageNode, blocktime time.Duration) *BlockMiner
func (*BlockMiner) MineBlocks ¶ added in v0.5.0
func (bm *BlockMiner) MineBlocks()
func (*BlockMiner) Stop ¶ added in v0.5.0
func (bm *BlockMiner) Stop()
type FullNodeOpts ¶ added in v0.9.1
type FullNodeOpts struct { Lite bool // run node in "lite" mode Opts OptionGenerator // generate dependency injection options }
Options for setting up a mock full node
func DefaultFullOpts ¶ added in v0.9.1
func DefaultFullOpts(nFull int) []FullNodeOpts
type OptionGenerator ¶ added in v0.9.1
type StorageBuilder ¶ added in v1.8.0
type StorageBuilder func(context.Context, *testing.T, abi.RegisteredSealProof, address.Address) TestStorageNode
type StorageMiner ¶ added in v0.3.0
Options for setting up a mock storage miner
type TestNode ¶
type TestNode struct { api.FullNode // ListenAddr is the address on which an API server is listening, if an // API server is created for this Node ListenAddr multiaddr.Multiaddr Stb StorageBuilder }