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.7k
Add documentation to SubmitSignedTransaction and actually make it work #4200
Merged
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
bc28c60
Add documentation to signed transactions and actually make them work.
tomusdrw a645b90
Fix naming and bounds.
tomusdrw f8c9540
Forgotten import.
tomusdrw f85b890
Merge branch 'master' into td-signed-transactions
tomusdrw 3f38218
Merge branch 'master' into td-signed-transactions
tomusdrw d715f64
Remove warning.
tomusdrw 0c4c037
Make accounts optional, fix logic.
tomusdrw dc8d71c
Split the method to avoid confusing type error message.
tomusdrw 173cf6c
Move executor tests to integration.
tomusdrw 90a00fd
Add submit transactions tests.
tomusdrw 901dbdb
Merge branch 'master' into td-signed-transactions
tomusdrw d103fa1
Make `submit_transaction` tests compile
HCastano 99c54b7
Remove a file that was accidently committed
HCastano dbc81dd
Merge branch 'master' into td-signed-transactions
tomusdrw 9eb7a2e
Add can_sign helper function.
tomusdrw 0ccb951
Fix compilation.
tomusdrw 73a936c
Add a key to keystore.
tomusdrw d776d50
Fix the tests.
tomusdrw 0ac61d7
Remove env_logger.
tomusdrw 8755539
Fix sending multiple transactions.
tomusdrw fc6b5fe
Remove commented code.
tomusdrw af1782e
Bring back criterion.
tomusdrw 58673bf
Merge branch 'master' into td-signed-transactions
tomusdrw bacf48c
Remove stray debug log.
tomusdrw b3c8726
Merge branch 'master' into td-signed-transactions
gavofyork da816e2
Apply suggestions from code review
tomusdrw a2c6d09
Make sure to initialize block correctly.
tomusdrw af5724c
Initialize block for offchain workers.
tomusdrw 3eda535
Add test for transaction validity.
tomusdrw 765f96f
Merge branch 'master' into td-signed-transactions
tomusdrw 6bafaff
Fix tests.
tomusdrw 021f586
Review suggestions.
tomusdrw 3ac00ff
Remove redundant comment.
tomusdrw 7f38d4c
Make sure to use correct block number of authoring.
tomusdrw afb99f9
Change the runtime API.
tomusdrw a945a8c
Support both versions.
tomusdrw 4c66a45
Bump spec version, fix RPC test.
tomusdrw 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
Support both versions.
- Loading branch information
commit a945a8c39b961e179d2592c04931e7f9030a1d54
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 |
|---|---|---|
|
|
@@ -508,10 +508,9 @@ impl frame_system::offchain::CreateTransaction<Runtime, UncheckedExtrinsic> for | |
| .unwrap_or(2) as u64; | ||
| let current_block = System::block_number() | ||
| .saturated_into::<u64>() | ||
| // The `System::block_number` is initialized with `n+1`, so the actual block number is | ||
| // `n`, but in offchain worker context this block does not have correct `parent_hash` set, | ||
| // so we need to fall back to `n-1`. | ||
| .saturating_sub(2); | ||
| // The `System::block_number` is initialized with `n+1`, | ||
| // so the actual block number is `n`. | ||
| .saturating_sub(1); | ||
|
Member
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. Why not build on the current block? |
||
| let tip = 0; | ||
| let extra: SignedExtra = ( | ||
| frame_system::CheckVersion::<Runtime>::new(), | ||
|
|
||
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.
Just realized, you skip
initialize_blockwhen callingoffchain_worker. This means, thatblock_number()always returns0.