Use new go-state-types accessors

This commit is contained in:
Aayush
2022-05-17 15:21:27 -04:00
parent ee11018780
commit 8cca9b1970
253 changed files with 3727 additions and 4283 deletions
+10 -10
View File
@@ -10,8 +10,8 @@ import (
"github.com/filecoin-project/go-address"
paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/paychmgr"
)
@@ -83,10 +83,10 @@ func (a *PaychAPI) PaychNewPayment(ctx context.Context, from, to address.Address
return nil, err
}
svs := make([]*paych.SignedVoucher, len(vouchers))
svs := make([]*paychtypes.SignedVoucher, len(vouchers))
for i, v := range vouchers {
sv, err := a.PaychMgr.CreateVoucher(ctx, ch.Channel, paych.SignedVoucher{
sv, err := a.PaychMgr.CreateVoucher(ctx, ch.Channel, paychtypes.SignedVoucher{
Amount: v.Amount,
Lane: lane,
@@ -135,15 +135,15 @@ func (a *PaychAPI) PaychCollect(ctx context.Context, addr address.Address) (cid.
return a.PaychMgr.Collect(ctx, addr)
}
func (a *PaychAPI) PaychVoucherCheckValid(ctx context.Context, ch address.Address, sv *paych.SignedVoucher) error {
func (a *PaychAPI) PaychVoucherCheckValid(ctx context.Context, ch address.Address, sv *paychtypes.SignedVoucher) error {
return a.PaychMgr.CheckVoucherValid(ctx, ch, sv)
}
func (a *PaychAPI) PaychVoucherCheckSpendable(ctx context.Context, ch address.Address, sv *paych.SignedVoucher, secret []byte, proof []byte) (bool, error) {
func (a *PaychAPI) PaychVoucherCheckSpendable(ctx context.Context, ch address.Address, sv *paychtypes.SignedVoucher, secret []byte, proof []byte) (bool, error) {
return a.PaychMgr.CheckVoucherSpendable(ctx, ch, sv, secret, proof)
}
func (a *PaychAPI) PaychVoucherAdd(ctx context.Context, ch address.Address, sv *paych.SignedVoucher, proof []byte, minDelta types.BigInt) (types.BigInt, error) {
func (a *PaychAPI) PaychVoucherAdd(ctx context.Context, ch address.Address, sv *paychtypes.SignedVoucher, proof []byte, minDelta types.BigInt) (types.BigInt, error) {
return a.PaychMgr.AddVoucherInbound(ctx, ch, sv, proof, minDelta)
}
@@ -155,16 +155,16 @@ func (a *PaychAPI) PaychVoucherAdd(ctx context.Context, ch address.Address, sv *
// If there are insufficient funds in the channel to create the voucher,
// returns a nil voucher and the shortfall.
func (a *PaychAPI) PaychVoucherCreate(ctx context.Context, pch address.Address, amt types.BigInt, lane uint64) (*api.VoucherCreateResult, error) {
return a.PaychMgr.CreateVoucher(ctx, pch, paych.SignedVoucher{Amount: amt, Lane: lane})
return a.PaychMgr.CreateVoucher(ctx, pch, paychtypes.SignedVoucher{Amount: amt, Lane: lane})
}
func (a *PaychAPI) PaychVoucherList(ctx context.Context, pch address.Address) ([]*paych.SignedVoucher, error) {
func (a *PaychAPI) PaychVoucherList(ctx context.Context, pch address.Address) ([]*paychtypes.SignedVoucher, error) {
vi, err := a.PaychMgr.ListVouchers(ctx, pch)
if err != nil {
return nil, err
}
out := make([]*paych.SignedVoucher, len(vi))
out := make([]*paychtypes.SignedVoucher, len(vi))
for k, v := range vi {
out[k] = v.Voucher
}
@@ -172,6 +172,6 @@ func (a *PaychAPI) PaychVoucherList(ctx context.Context, pch address.Address) ([
return out, nil
}
func (a *PaychAPI) PaychVoucherSubmit(ctx context.Context, ch address.Address, sv *paych.SignedVoucher, secret []byte, proof []byte) (cid.Cid, error) {
func (a *PaychAPI) PaychVoucherSubmit(ctx context.Context, ch address.Address, sv *paychtypes.SignedVoucher, secret []byte, proof []byte) (cid.Cid, error) {
return a.PaychMgr.SubmitVoucher(ctx, ch, sv, secret, proof)
}