ffiwrapper

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSectorNotFound = errors.New("sector not found")
View Source
var ProofVerifier = proofVerifier{}

Functions

func GeneratePieceCIDFromFile

func GeneratePieceCIDFromFile(proofType abi.RegisteredSealProof, piece io.Reader, pieceSize abi.UnpaddedPieceSize) (cid.Cid, error)

func GenerateUnsealedCID

func GenerateUnsealedCID(proofType abi.RegisteredSealProof, pieces []abi.PieceInfo) (cid.Cid, error)

func GetRequiredPadding

func GetRequiredPadding(oldLength abi.PaddedPieceSize, newPieceLength abi.PaddedPieceSize) ([]abi.PaddedPieceSize, abi.PaddedPieceSize)

func SealProofTypeFromSectorSize

func SealProofTypeFromSectorSize(ssize abi.SectorSize, nv network.Version) (abi.RegisteredSealProof, error)

func ToReadableFile

func ToReadableFile(r io.Reader, n int64) (*os.File, func() error, error)

Types

type Config

type Config struct {
	SealProofType abi.RegisteredSealProof
	// contains filtered or unexported fields
}

type FakeVerifier

type FakeVerifier struct {
}

FakeVerifier is a simple mock Verifier for testing.

func (*FakeVerifier) GenerateWinningPoStSectorChallenge

func (f *FakeVerifier) GenerateWinningPoStSectorChallenge(context.Context, abi.RegisteredPoStProof, abi.ActorID, abi.PoStRandomness, uint64) ([]uint64, error)

func (*FakeVerifier) VerifySeal

func (f *FakeVerifier) VerifySeal(proof.SealVerifyInfo) (bool, error)

func (*FakeVerifier) VerifyWindowPoSt

func (f *FakeVerifier) VerifyWindowPoSt(context.Context, proof.WindowPoStVerifyInfo) (bool, error)

func (*FakeVerifier) VerifyWinningPoSt

func (f *FakeVerifier) VerifyWinningPoSt(context.Context, proof.WinningPoStVerifyInfo) (bool, error)

type PaddedByteIndex

type PaddedByteIndex uint64

type UnpaddedByteIndex

type UnpaddedByteIndex uint64

func (UnpaddedByteIndex) Padded

type Verifier

type Verifier interface {
	VerifySeal(proof2.SealVerifyInfo) (bool, error)
	VerifyWinningPoSt(ctx context.Context, info proof2.WinningPoStVerifyInfo) (bool, error)
	VerifyWindowPoSt(ctx context.Context, info proof2.WindowPoStVerifyInfo) (bool, error)

	GenerateWinningPoStSectorChallenge(context.Context, abi.RegisteredPoStProof, abi.ActorID, abi.PoStRandomness, uint64) ([]uint64, error)
}

Jump to

Keyboard shortcuts

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