-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some actors policy setters for testing
Addresses: * https://github.com/filecoin-project/lotus/pull/3781/files/a307e4593a005888395db34e5af4691ee50d765d#r491966115 * https://github.com/filecoin-project/lotus/pull/3781/files/a307e4593a005888395db34e5af4691ee50d765d#r491966634
- Loading branch information
Showing
14 changed files
with
134 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package miner | ||
|
||
import ( | ||
"github.com/filecoin-project/go-state-types/abi" | ||
|
||
miner0 "github.com/filecoin-project/specs-actors/actors/builtin/miner" | ||
) | ||
|
||
// SetSupportedProofTypes sets supported proof types, across all actor versions. | ||
// This should only be used for testing. | ||
func SetSupportedProofTypes(types ...abi.RegisteredSealProof) { | ||
newTypes := make(map[abi.RegisteredSealProof]struct{}, len(types)) | ||
for _, t := range types { | ||
newTypes[t] = struct{}{} | ||
} | ||
// Set for all miner versions. | ||
miner0.SupportedProofTypes = newTypes | ||
} | ||
|
||
// AddSupportedProofTypes sets supported proof types, across all actor versions. | ||
// This should only be used for testing. | ||
func AddSupportedProofTypes(types ...abi.RegisteredSealProof) { | ||
newTypes := make(map[abi.RegisteredSealProof]struct{}, len(types)) | ||
for _, t := range types { | ||
newTypes[t] = struct{}{} | ||
} | ||
// Set for all miner versions. | ||
miner0.SupportedProofTypes = newTypes | ||
} | ||
|
||
// SetPreCommitChallengeDelay sets the pre-commit challenge delay across all | ||
// actors versions. Use for testing. | ||
func SetPreCommitChallengeDelay(delay abi.ChainEpoch) { | ||
// Set for all miner versions. | ||
miner0.PreCommitChallengeDelay = delay | ||
PreCommitChallengeDelay = delay | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package power | ||
|
||
import ( | ||
"github.com/filecoin-project/go-state-types/abi" | ||
|
||
power0 "github.com/filecoin-project/specs-actors/actors/builtin/power" | ||
) | ||
|
||
// SetConsensusMinerMinPower sets the minimum power of an individual miner must | ||
// meet for leader election, across all actor versions. This should only be used | ||
// for testing. | ||
func SetConsensusMinerMinPower(p abi.StoragePower) { | ||
power0.ConsensusMinerMinPower = p | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package verifreg | ||
|
||
import ( | ||
"github.com/filecoin-project/go-state-types/abi" | ||
|
||
verifreg0 "github.com/filecoin-project/specs-actors/actors/builtin/verifreg" | ||
) | ||
|
||
// SetMinVerifiedDealSize sets the minimum size of a verified deal. This should | ||
// only be used for testing. | ||
func SetMinVerifiedDealSize(size abi.StoragePower) { | ||
verifreg0.MinVerifiedDealSize = size | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.