Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
3d6d2954
Commit
3d6d2954
authored
2 years ago
by
Sacha Lansky
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix typos (#13616)
parent
33fd1706
Branches
gh-readonly-queue/master/pr-5442-b3c2a25b73bb4854f26204068f0aec3e8577196c
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/frame/examples/offchain-worker/src/lib.rs
+5
-5
5 additions, 5 deletions
substrate/frame/examples/offchain-worker/src/lib.rs
with
5 additions
and
5 deletions
substrate/frame/examples/offchain-worker/src/lib.rs
+
5
−
5
View file @
3d6d2954
...
...
@@ -166,7 +166,7 @@ pub mod pallet {
///
/// By implementing `fn offchain_worker` you declare a new offchain worker.
/// This function will be called when the node is fully synced and a new best block is
/// succesfuly imported.
/// succes
s
ful
l
y imported.
/// Note that it's not guaranteed for offchain workers to run on EVERY block, there might
/// be cases where some blocks are skipped, or for some the worker runs twice (re-orgs),
/// so the code should be able to handle that.
...
...
@@ -224,7 +224,7 @@ pub mod pallet {
/// The transaction needs to be signed (see `ensure_signed`) check, so that the caller
/// pays a fee to execute it.
/// This makes sure that it's not easy (or rather cheap) to attack the chain by submitting
/// excesive transactions, but note that it doesn't ensure the price oracle is actually
/// exces
s
ive transactions, but note that it doesn't ensure the price oracle is actually
/// working and receives (and provides) meaningful data.
/// This example is not focused on correctness of the oracle itself, but rather its
/// purpose is to showcase offchain worker capabilities.
...
...
@@ -336,7 +336,7 @@ pub mod pallet {
/// Defines the block when next unsigned transaction will be accepted.
///
/// To prevent spam of unsigned (and unpa
ye
d!) transactions on the network,
/// To prevent spam of unsigned (and unpa
i
d!) transactions on the network,
/// we only allow one transaction every `T::UnsignedInterval` blocks.
/// This storage entry defines when new transaction is going to be accepted.
#[pallet::storage]
...
...
@@ -570,12 +570,12 @@ impl<T: Config> Pallet<T> {
fn
fetch_price
()
->
Result
<
u32
,
http
::
Error
>
{
// We want to keep the offchain worker execution time reasonable, so we set a hard-coded
// deadline to 2s to complete the external call.
// You can also wait idefinitely for the response, however you may still get a timeout
// You can also wait i
n
definitely for the response, however you may still get a timeout
// coming from the host machine.
let
deadline
=
sp_io
::
offchain
::
timestamp
()
.add
(
Duration
::
from_millis
(
2_000
));
// Initiate an external HTTP GET request.
// This is using high-level wrappers from `sp_runtime`, for the low-level calls that
// you can find in `sp_io`. The API is trying to be similar to `req
w
est`, but
// you can find in `sp_io`. The API is trying to be similar to `req
u
est`, but
// since we are running in a custom WASM execution environment we can't simply
// import the library here.
let
request
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment