enable paych tests (#255)

* enable paych tests

* use new APIs and values
This commit is contained in:
Anton Evangelatov 2020-09-16 17:29:37 +02:00 committed by GitHub
parent 8b7e7d438c
commit f702ce331a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"github.com/filecoin-project/oni/lotus-soup/paych"
"github.com/filecoin-project/oni/lotus-soup/rfwp" "github.com/filecoin-project/oni/lotus-soup/rfwp"
"github.com/filecoin-project/oni/lotus-soup/testkit" "github.com/filecoin-project/oni/lotus-soup/testkit"
@ -13,7 +14,7 @@ var cases = map[string]interface{}{
"deals-stress": testkit.WrapTestEnvironment(dealsStress), "deals-stress": testkit.WrapTestEnvironment(dealsStress),
"drand-halting": testkit.WrapTestEnvironment(dealsE2E), "drand-halting": testkit.WrapTestEnvironment(dealsE2E),
"drand-outage": testkit.WrapTestEnvironment(dealsE2E), "drand-outage": testkit.WrapTestEnvironment(dealsE2E),
//"paych-stress": testkit.WrapTestEnvironment(paych.Stress), "paych-stress": testkit.WrapTestEnvironment(paych.Stress),
} }
func main() { func main() {

View File

@ -8,10 +8,10 @@ import (
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/specs-actors/actors/builtin/paych" "github.com/filecoin-project/specs-actors/actors/builtin/paych"
"github.com/filecoin-project/go-address" "github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/big"
"github.com/testground/sdk-go/sync" "github.com/testground/sdk-go/sync"
@ -103,7 +103,7 @@ func runSender(ctx context.Context, t *testkit.TestEnvironment, clients []*testk
// number of vouchers to send on each lane // number of vouchers to send on each lane
vouchersPerLane = t.IntParam("vouchers_per_lane") vouchersPerLane = t.IntParam("vouchers_per_lane")
// increments in which to send payment vouchers // increments in which to send payment vouchers
increments = big.Mul(big.NewInt(int64(t.IntParam("increments"))), abi.TokenPrecision) increments = big.Mul(big.NewInt(int64(t.IntParam("increments"))), big.NewInt(int64(build.FilecoinPrecision)))
// channel amount should be enough to cover all vouchers // channel amount should be enough to cover all vouchers
channelAmt = big.Mul(big.NewInt(int64(laneCount*vouchersPerLane)), increments) channelAmt = big.Mul(big.NewInt(int64(laneCount*vouchersPerLane)), increments)
) )
@ -179,7 +179,7 @@ func runSender(ctx context.Context, t *testkit.TestEnvironment, clients []*testk
if err != nil { if err != nil {
return fmt.Errorf("failed to create voucher: %w", err) return fmt.Errorf("failed to create voucher: %w", err)
} }
t.RecordMessage("payment voucher created; lane=%d, nonce=%d, amount=%d", voucher.Lane, voucher.Nonce, voucher.Amount) t.RecordMessage("payment voucher created; lane=%d, nonce=%d, amount=%d", voucher.Voucher.Lane, voucher.Voucher.Nonce, voucher.Voucher.Amount)
_, err = t.SyncClient.Publish(ctx, VoucherTopic, voucher) _, err = t.SyncClient.Publish(ctx, VoucherTopic, voucher)
if err != nil { if err != nil {