This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Prevent building invalid blocks #430
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2fe1989
Commit extrinsics changes
arkpar 2f1e269
Removed panic=abort
arkpar cd0539f
Commit when needed
arkpar acf23ca
Resotre default hook for the native call
arkpar c8b1335
Revert test
arkpar 0e17e47
Proper test
arkpar ce87d85
Sorted errors and fixed wasm build
arkpar 8421312
Merge branch 'master' into ark-block-builder-fix
arkpar 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,5 +64,6 @@ fn panic_hook(info: &PanicInfo) { | |
| ); | ||
|
|
||
| let _ = writeln!(stderr, "{}", ABOUT_PANIC); | ||
| ::std::process::exit(1); | ||
| } | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| use std; | ||
| use state_machine; | ||
| use primitives::hexdisplay::HexDisplay; | ||
| use runtime_primitives::ApplyError; | ||
|
|
||
| error_chain! { | ||
| errors { | ||
|
|
@@ -34,6 +35,12 @@ error_chain! { | |
| display("UnknownBlock: {}", &*h), | ||
| } | ||
|
|
||
| /// Extrinsic error. | ||
| Runtime(e: ApplyError) { | ||
| description("Extrinsic error"), | ||
| display("Extrinsic error: {:?}", e), | ||
| } | ||
|
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. Should we rename this to something more extrinsic-related. We could use |
||
|
|
||
| /// Execution error. | ||
| Execution(e: Box<state_machine::Error>) { | ||
| description("execution error"), | ||
|
|
@@ -111,6 +118,12 @@ error_chain! { | |
| description("remote fetch failed"), | ||
| display("Remote data fetch has been failed"), | ||
| } | ||
|
|
||
| /// Error decoding extrinsic outcome. | ||
| ApplyExtinsicFailed { | ||
|
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.
|
||
| description("Error decoding extrinsic outcome"), | ||
| display("Error decoding extrinsic outcome."), | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -139,4 +152,4 @@ impl Error { | |
| } | ||
| } | ||
|
|
||
| impl state_machine::Error for Error {} | ||
| impl state_machine::Error for Error {} | ||
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
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
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.
Even though
panic=unwindis the default, I'd rather specify it explicitly with a comment for documentation purposes.