From f702ce331aeff3edfed3ae4920b7da38e1e0d10e Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Wed, 16 Sep 2020 17:29:37 +0200 Subject: [PATCH] enable paych tests (#255) * enable paych tests * use new APIs and values --- lotus-soup/main.go | 3 ++- lotus-soup/paych/{stress.god => stress.go} | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) rename lotus-soup/paych/{stress.god => stress.go} (98%) diff --git a/lotus-soup/main.go b/lotus-soup/main.go index c099c1744..cc8851bb0 100644 --- a/lotus-soup/main.go +++ b/lotus-soup/main.go @@ -1,6 +1,7 @@ package main import ( + "github.com/filecoin-project/oni/lotus-soup/paych" "github.com/filecoin-project/oni/lotus-soup/rfwp" "github.com/filecoin-project/oni/lotus-soup/testkit" @@ -13,7 +14,7 @@ var cases = map[string]interface{}{ "deals-stress": testkit.WrapTestEnvironment(dealsStress), "drand-halting": testkit.WrapTestEnvironment(dealsE2E), "drand-outage": testkit.WrapTestEnvironment(dealsE2E), - //"paych-stress": testkit.WrapTestEnvironment(paych.Stress), + "paych-stress": testkit.WrapTestEnvironment(paych.Stress), } func main() { diff --git a/lotus-soup/paych/stress.god b/lotus-soup/paych/stress.go similarity index 98% rename from lotus-soup/paych/stress.god rename to lotus-soup/paych/stress.go index 5167de6c1..f064bd352 100644 --- a/lotus-soup/paych/stress.god +++ b/lotus-soup/paych/stress.go @@ -8,10 +8,10 @@ import ( "github.com/ipfs/go-cid" + "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/specs-actors/actors/builtin/paych" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" "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 vouchersPerLane = t.IntParam("vouchers_per_lane") // 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 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 { 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) if err != nil {