-
Notifications
You must be signed in to change notification settings - Fork 21.6k
cmd/evm: add stdin support to blocktest command #32824
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2dfae90
cmd/evm: add stdin support to blocktest command
bshastry 94b4de0
Add end marker
bshastry 838ef5c
cmd/evm: remove superflous result struct
MariusVanDerWijden 8500134
cmd/evm: address PR feedback on blocktest stdin support
bshastry c86c5f3
cmd/evm: remove superflous result struct (again)
MariusVanDerWijden 3f54146
Apply suggestion from @MariusVanDerWijden
MariusVanDerWijden 477bb03
Fix typo in fuzz flag usage description
fjl 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -116,6 +116,15 @@ func (t *BlockTest) Run(snapshotter bool, scheme string, witness bool, tracer *t | |
| if !ok { | ||
| return UnsupportedForkError{t.json.Network} | ||
| } | ||
| return t.run(config, snapshotter, scheme, witness, tracer, postCheck) | ||
| } | ||
|
|
||
| // Network returns the network/fork name for this test. | ||
| func (t *BlockTest) Network() string { | ||
| return t.json.Network | ||
| } | ||
|
|
||
| func (t *BlockTest) run(config *params.ChainConfig, snapshotter bool, scheme string, witness bool, tracer *tracing.Hooks, postCheck func(error, *core.BlockChain)) (result error) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is only invoked in |
||
| // import pre accounts & construct test genesis block & state root | ||
| var ( | ||
| db = rawdb.NewMemoryDatabase() | ||
|
|
@@ -259,7 +268,7 @@ func (t *BlockTest) insertBlocks(blockchain *core.BlockChain) ([]btBlock, error) | |
| } | ||
| if b.BlockHeader == nil { | ||
| if data, err := json.MarshalIndent(cb.Header(), "", " "); err == nil { | ||
| fmt.Fprintf(os.Stderr, "block (index %d) insertion should have failed due to: %v:\n%v\n", | ||
| fmt.Fprintf(os.Stdout, "block (index %d) insertion should have failed due to: %v:\n%v\n", | ||
| bi, b.ExpectException, string(data)) | ||
| } | ||
| return nil, fmt.Errorf("block (index %d) insertion should have failed due to: %v", | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.