Skip to content

Commit 11ccaa0

Browse files
authored
set chain-dependent max provider collateral (#132)
1 parent e275a0e commit 11ccaa0

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

cmd/boost/dummydeal.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

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

policy/policy.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build !debug
2+
// +build !debug
3+
4+
package policy
5+
6+
import "github.com/filecoin-project/go-state-types/abi"
7+
8+
var (
9+
MaxProviderCollateral = abi.NewTokenAmount(162546066071935)
10+
)

policy/policy_debug.go

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build debug
2+
// +build debug
3+
4+
package policy
5+
6+
import "github.com/filecoin-project/go-state-types/abi"
7+
8+
var (
9+
MaxProviderCollateral = abi.NewTokenAmount(0)
10+
)

0 commit comments

Comments
 (0)