lotus/retrievaladapter/provider.go
hannahhoward 5b74a71dd3 feat(retrievalmarket): extract skeleton interfaces
Define all types to spec, modify interfaces, wrap old code

fix(builder): use client blockstore for retrieval

feat(retrieval): add node implementations

add node adapters for client & provider so that retrieval can be extracted
2020-01-08 12:45:43 -08:00

24 lines
816 B
Go

package retrievaladapter
import (
"context"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/go-address"
retrievalmarket "github.com/filecoin-project/lotus/retrieval"
)
type retrievalProviderNode struct {
full api.FullNode
}
// NewRetrievalProviderNode returns a new node adapter for a retrieval provider that talks to the
// Lotus Node
func NewRetrievalProviderNode(full api.FullNode) retrievalmarket.RetrievalProviderNode {
return &retrievalProviderNode{full}
}
func (rpn *retrievalProviderNode) SavePaymentVoucher(ctx context.Context, paymentChannel address.Address, voucher *retrievalmarket.SignedVoucher, proof []byte, expectedAmount retrievalmarket.BigInt) (retrievalmarket.BigInt, error) {
return rpn.full.PaychVoucherAdd(ctx, paymentChannel, voucher, proof, expectedAmount)
}