Skip to content

Commit

Permalink
set chain-dependent max provider collateral (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense authored Dec 8, 2021
1 parent e275a0e commit 11ccaa0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/boost/dummydeal.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

lcli "github.com/filecoin-project/boost/cli"
"github.com/filecoin-project/boost/gql"
"github.com/filecoin-project/boost/policy"
"github.com/filecoin-project/boost/storagemarket"
"github.com/filecoin-project/boost/storagemarket/types"
"github.com/filecoin-project/boost/testutil"
Expand Down Expand Up @@ -273,7 +274,7 @@ func dealProposal(ctx context.Context, fullNode v0api.FullNode, rootCid cid.Cid,
StartEpoch: startEpoch,
EndEpoch: endEpoch,
StoragePricePerEpoch: abi.NewTokenAmount(1),
ProviderCollateral: abi.NewTokenAmount(162546066071935), // TODO: where is this minimum value coming from?
ProviderCollateral: policy.MaxProviderCollateral, // this value is chain dependent and is 0 on devnet, and currently a multiple of 147276332 on mainnet
ClientCollateral: abi.NewTokenAmount(0),
}

Expand Down
10 changes: 10 additions & 0 deletions policy/policy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build !debug
// +build !debug

package policy

import "github.com/filecoin-project/go-state-types/abi"

var (
MaxProviderCollateral = abi.NewTokenAmount(162546066071935)
)
10 changes: 10 additions & 0 deletions policy/policy_debug.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build debug
// +build debug

package policy

import "github.com/filecoin-project/go-state-types/abi"

var (
MaxProviderCollateral = abi.NewTokenAmount(0)
)

0 comments on commit 11ccaa0

Please sign in to comment.