-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decompose consensus params #514
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
905441d
Break down ConsensusParameters
MitchTurner 0f25bc8
Remove ConsensusParameters from everywhere
MitchTurner a1b10c2
Use default for individual fields not for types
MitchTurner e42678a
Get tests compiling, but not passing
MitchTurner 6bdd9a0
Fix one test
MitchTurner 0554711
Fix bug in transactor default
MitchTurner 261b4cc
Fix bug in test helper
MitchTurner 3f30841
Fix fee test bug
MitchTurner 8171431
Include chain_id in tx builder to get chain_id to match
MitchTurner c17fd88
Get all tests passing
MitchTurner d412263
Partially appease Clippy-sama
MitchTurner 6de4203
Group params for into_checked
MitchTurner 35a6790
Create param for Interpreter init
MitchTurner d134584
Simplify MemoryClient signature
MitchTurner a655e12
Appease Clippy-sama
MitchTurner 52bcef5
Move ConsensusParams back to original file
MitchTurner 02b7572
Use ConsensusParams in more places
MitchTurner 5cf29da
Bump version, only use default `ChainId`
MitchTurner 2441d99
Make ConsensusParams hold values instead of refs
MitchTurner 8e90661
Consolidate ChainId and GasCosts into ConsensusParams
MitchTurner 1b44647
Collect Interpreter parameters inside struct
MitchTurner 9cf95c2
Fix tests
MitchTurner cbb56e4
Cleanup, appease Clippy-sama
MitchTurner 6466901
Simplify test setups
MitchTurner 415ab30
Merge branch 'master' into decompose-consensus-params
xgreenx 5021d87
Remove comment and TODO
MitchTurner 1d7350b
Rename `ConsensusParams` back to `ConsensusParameters`
MitchTurner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,7 @@ Cargo.lock | |
**/*.rs.bk | ||
|
||
.vscode/ | ||
|
||
.idea | ||
|
||
.history |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,45 @@ | ||
use fuel_tx::ConsensusParameters; | ||
use fuel_tx::{ | ||
ConsensusParameters, | ||
ContractParameters, | ||
FeeParameters, | ||
PredicateParameters, | ||
ScriptParameters, | ||
TxParameters, | ||
}; | ||
|
||
use fuel_types::ChainId; | ||
|
||
// override default settings to reduce testing overhead | ||
pub const PARAMS: ConsensusParameters = ConsensusParameters::DEFAULT | ||
.with_max_storage_slots(1024) | ||
pub const CONTRACT_PARAMS: ContractParameters = | ||
ContractParameters::DEFAULT.with_max_storage_slots(1024); | ||
|
||
pub const SCRIPT_PARAMS: ScriptParameters = ScriptParameters::DEFAULT | ||
.with_max_script_length(1024) | ||
.with_max_script_data_length(1024) | ||
.with_max_script_data_length(1024); | ||
|
||
pub const TX_PARAMS: TxParameters = TxParameters::DEFAULT | ||
.with_max_inputs(16) | ||
.with_max_outputs(16) | ||
.with_max_witnesses(16); | ||
|
||
pub const PREDICATE_PARAMS: PredicateParameters = PredicateParameters::DEFAULT; | ||
|
||
pub const FEE_PARAMS: FeeParameters = FeeParameters::DEFAULT; | ||
|
||
pub const CHAIN_ID: ChainId = ChainId::new(0); | ||
|
||
pub fn test_params() -> ConsensusParameters { | ||
ConsensusParameters::new( | ||
TX_PARAMS, | ||
PREDICATE_PARAMS, | ||
SCRIPT_PARAMS, | ||
CONTRACT_PARAMS, | ||
FEE_PARAMS, | ||
CHAIN_ID, | ||
Default::default(), | ||
) | ||
} | ||
|
||
mod input; | ||
mod output; | ||
mod transaction; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you can use
Default::default
like you did in other places=)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.