providerutils

package
v0.0.0-...-f311442 Latest Latest
Warning

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

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

Documentation

Overview

Package providerutils provides utility functions for the storage provider & provider FSM

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadBlockLocations

func LoadBlockLocations(fs filestore.FileStore, metadataPath filestore.Path) (map[cid.Cid]piecestore.BlockLocation, error)

LoadBlockLocations loads a metadata file then converts it to a map of cid -> blockLocation

func SignMinerData

func SignMinerData(ctx context.Context, data interface{}, address address.Address, tok shared.TipSetToken, workerLookup WorkerLookupFunc, sign SignFunc) (*crypto.Signature, error)

SignMinerData signs the given data structure with a signature for the given address

func VerifyProposal

func VerifyProposal(ctx context.Context, sdp market.ClientDealProposal, tok shared.TipSetToken, verifier VerifyFunc) error

VerifyProposal verifies the signature on the given signed proposal matches the client addres for the proposal, using the given signature verification function

func VerifySignature

func VerifySignature(ctx context.Context, signature crypto.Signature, signer address.Address, buf []byte, tok shared.TipSetToken, verifier VerifyFunc) error

VerifySignature verifies the signature over the given bytes

Types

type SignFunc

type SignFunc func(context.Context, address.Address, []byte) (*crypto.Signature, error)

SignFunc is a function that can sign a set of bytes with a given address

type VerifyFunc

type VerifyFunc func(context.Context, crypto.Signature, address.Address, []byte, shared.TipSetToken) (bool, error)

VerifyFunc is a function that can validate a signature for a given address and bytes

type WorkerLookupFunc

type WorkerLookupFunc func(context.Context, address.Address, shared.TipSetToken) (address.Address, error)

WorkerLookupFunc is a function that can lookup a miner worker address from a storage miner actor

Jump to

Keyboard shortcuts

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