mock

package
v0.0.0-...-484cccf Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0, MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MockProver = MockVerifier
View Source
var MockVerifier = mockVerifProver{
	// contains filtered or unexported fields
}

Functions

func AddOpFinish

func AddOpFinish(ctx context.Context) (context.Context, func())

func CommDR

func CommDR(in []byte) (out [32]byte)

func PreSeal

func PreSeal(spt abi.RegisteredSealProof, maddr address.Address, sectors int) (*genesis.Miner, *types.KeyInfo, error)

Types

type SectorMgr

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

func NewMockSectorMgr

func NewMockSectorMgr(genesisSectors []abi.SectorID) *SectorMgr

func (*SectorMgr) AcquireSectorNumber

func (mgr *SectorMgr) AcquireSectorNumber() (abi.SectorNumber, error)

func (*SectorMgr) AddPiece

func (mgr *SectorMgr) AddPiece(ctx context.Context, sectorID storiface.SectorRef, existingPieces []abi.UnpaddedPieceSize, size abi.UnpaddedPieceSize, r io.Reader) (abi.PieceInfo, error)

func (*SectorMgr) CheckProvable

func (*SectorMgr) DataCid

func (mgr *SectorMgr) DataCid(ctx context.Context, size abi.UnpaddedPieceSize, r io.Reader) (abi.PieceInfo, error)

func (*SectorMgr) DownloadSectorData

func (mgr *SectorMgr) DownloadSectorData(ctx context.Context, sector storiface.SectorRef, finalized bool, src map[storiface.SectorFileType]storiface.SectorLocation) error

func (*SectorMgr) Fail

func (mgr *SectorMgr) Fail()

func (*SectorMgr) FinalizeReplicaUpdate

func (mgr *SectorMgr) FinalizeReplicaUpdate(context.Context, storiface.SectorRef) error

func (*SectorMgr) FinalizeSector

func (mgr *SectorMgr) FinalizeSector(context.Context, storiface.SectorRef) error

func (*SectorMgr) ForceState

func (mgr *SectorMgr) ForceState(sid storiface.SectorRef, st int) error

func (*SectorMgr) GenerateSectorKeyFromData

func (mgr *SectorMgr) GenerateSectorKeyFromData(ctx context.Context, sector storiface.SectorRef, commD cid.Cid) error

func (*SectorMgr) GenerateWindowPoSt

func (mgr *SectorMgr) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, xSectorInfo []prooftypes.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]prooftypes.PoStProof, []abi.SectorID, error)

func (*SectorMgr) GenerateWindowPoStWithVanilla

func (mgr *SectorMgr) GenerateWindowPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte, partitionIdx int) (prooftypes.PoStProof, error)

func (*SectorMgr) GenerateWinningPoSt

func (mgr *SectorMgr) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, xSectorInfo []prooftypes.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]prooftypes.PoStProof, error)

func (*SectorMgr) GenerateWinningPoStWithVanilla

func (mgr *SectorMgr) GenerateWinningPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte) ([]prooftypes.PoStProof, error)

func (*SectorMgr) IsUnsealed

func (mgr *SectorMgr) IsUnsealed(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error)

func (*SectorMgr) MarkCorrupted

func (mgr *SectorMgr) MarkCorrupted(sid storiface.SectorRef, corrupted bool) error

func (*SectorMgr) MarkFailed

func (mgr *SectorMgr) MarkFailed(sid storiface.SectorRef, failed bool) error

func (*SectorMgr) NewSector

func (mgr *SectorMgr) NewSector(ctx context.Context, sector storiface.SectorRef) error

func (*SectorMgr) ProveReplicaUpdate1

func (mgr *SectorMgr) ProveReplicaUpdate1(ctx context.Context, sector storiface.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid) (storiface.ReplicaVanillaProofs, error)

func (*SectorMgr) ProveReplicaUpdate2

func (mgr *SectorMgr) ProveReplicaUpdate2(ctx context.Context, sector storiface.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid, vanillaProofs storiface.ReplicaVanillaProofs) (storiface.ReplicaUpdateProof, error)

func (*SectorMgr) ReadPiece

func (mgr *SectorMgr) ReadPiece(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (mount.Reader, bool, error)

func (*SectorMgr) ReleaseReplicaUpgrade

func (mgr *SectorMgr) ReleaseReplicaUpgrade(ctx context.Context, sector storiface.SectorRef) error

func (*SectorMgr) ReleaseSealed

func (mgr *SectorMgr) ReleaseSealed(ctx context.Context, sid storiface.SectorRef) error

func (*SectorMgr) ReleaseSectorKey

func (mgr *SectorMgr) ReleaseSectorKey(ctx context.Context, sector storiface.SectorRef) error

func (*SectorMgr) ReleaseUnsealed

func (mgr *SectorMgr) ReleaseUnsealed(ctx context.Context, sector storiface.SectorRef, keepUnsealed []storiface.Range) error

func (*SectorMgr) Remove

func (mgr *SectorMgr) Remove(ctx context.Context, sector storiface.SectorRef) error

func (*SectorMgr) ReplicaUpdate

func (mgr *SectorMgr) ReplicaUpdate(ctx context.Context, sid storiface.SectorRef, pieces []abi.PieceInfo) (storiface.ReplicaUpdateOut, error)

func (*SectorMgr) ReturnAddPiece

func (mgr *SectorMgr) ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error

func (*SectorMgr) ReturnDataCid

func (mgr *SectorMgr) ReturnDataCid(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error

func (*SectorMgr) ReturnDownloadSector

func (mgr *SectorMgr) ReturnDownloadSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error

func (*SectorMgr) ReturnFetch

func (mgr *SectorMgr) ReturnFetch(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error

func (*SectorMgr) ReturnFinalizeReplicaUpdate

func (mgr *SectorMgr) ReturnFinalizeReplicaUpdate(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error

func (*SectorMgr) ReturnFinalizeSector

func (mgr *SectorMgr) ReturnFinalizeSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error

func (*SectorMgr) ReturnGenerateSectorKeyFromData

func (mgr *SectorMgr) ReturnGenerateSectorKeyFromData(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error

func (*SectorMgr) ReturnMoveStorage

func (mgr *SectorMgr) ReturnMoveStorage(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error

func (*SectorMgr) ReturnProveReplicaUpdate1

func (mgr *SectorMgr) ReturnProveReplicaUpdate1(ctx context.Context, callID storiface.CallID, out storiface.ReplicaVanillaProofs, err *storiface.CallError) error

func (*SectorMgr) ReturnProveReplicaUpdate2

func (mgr *SectorMgr) ReturnProveReplicaUpdate2(ctx context.Context, callID storiface.CallID, out storiface.ReplicaUpdateProof, err *storiface.CallError) error

func (*SectorMgr) ReturnReadPiece

func (mgr *SectorMgr) ReturnReadPiece(ctx context.Context, callID storiface.CallID, ok bool, err *storiface.CallError) error

func (*SectorMgr) ReturnReleaseUnsealed

func (mgr *SectorMgr) ReturnReleaseUnsealed(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error

func (*SectorMgr) ReturnReplicaUpdate

func (mgr *SectorMgr) ReturnReplicaUpdate(ctx context.Context, callID storiface.CallID, out storiface.ReplicaUpdateOut, err *storiface.CallError) error

func (*SectorMgr) ReturnSealCommit1

func (mgr *SectorMgr) ReturnSealCommit1(ctx context.Context, callID storiface.CallID, out storiface.Commit1Out, err *storiface.CallError) error

func (*SectorMgr) ReturnSealCommit2

func (mgr *SectorMgr) ReturnSealCommit2(ctx context.Context, callID storiface.CallID, proof storiface.Proof, err *storiface.CallError) error

func (*SectorMgr) ReturnSealPreCommit1

func (mgr *SectorMgr) ReturnSealPreCommit1(ctx context.Context, callID storiface.CallID, p1o storiface.PreCommit1Out, err *storiface.CallError) error

func (*SectorMgr) ReturnSealPreCommit2

func (mgr *SectorMgr) ReturnSealPreCommit2(ctx context.Context, callID storiface.CallID, sealed storiface.SectorCids, err *storiface.CallError) error

func (*SectorMgr) ReturnUnsealPiece

func (mgr *SectorMgr) ReturnUnsealPiece(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error

func (*SectorMgr) SealCommit1

func (mgr *SectorMgr) SealCommit1(ctx context.Context, sid storiface.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storiface.SectorCids) (output storiface.Commit1Out, err error)

func (*SectorMgr) SealCommit2

func (mgr *SectorMgr) SealCommit2(ctx context.Context, sid storiface.SectorRef, phase1Out storiface.Commit1Out) (proof storiface.Proof, err error)

func (*SectorMgr) SealPreCommit1

func (mgr *SectorMgr) SealPreCommit1(ctx context.Context, sid storiface.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (out storiface.PreCommit1Out, err error)

func (*SectorMgr) SealPreCommit2

func (mgr *SectorMgr) SealPreCommit2(ctx context.Context, sid storiface.SectorRef, phase1Out storiface.PreCommit1Out) (cids storiface.SectorCids, err error)

func (*SectorMgr) SectorsUnsealPiece

func (mgr *SectorMgr) SectorsUnsealPiece(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd *cid.Cid) error

func (*SectorMgr) StageFakeData

func (mgr *SectorMgr) StageFakeData(mid abi.ActorID, spt abi.RegisteredSealProof) (storiface.SectorRef, []abi.PieceInfo, error)

Jump to

Keyboard shortcuts

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