Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Remove unused code (#7027)
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Chu <[email protected]>
  • Loading branch information
Jimmy Chu authored Sep 9, 2020
1 parent 3bceace commit 35a667a
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions frame/example-offchain-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ decl_storage! {
decl_event!(
/// Events generated by the module.
pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
/// Event generated when new price is accepted to contribute to the average.
/// Event generated when new price is accepted to contribute to the average.
/// [price, who]
NewPrice(u32, AccountId),
}
Expand Down Expand Up @@ -461,16 +461,6 @@ impl<T: Trait> Module<T> {
// Note this call will block until response is received.
let price = Self::fetch_price().map_err(|_| "Failed to fetch price")?;

// Received price is wrapped into a call to `submit_price_unsigned` public function of this
// pallet. This means that the transaction, when executed, will simply call that function
// passing `price` as an argument.
let call = Call::submit_price_unsigned(block_number, price);

// Now let's create a transaction out of this call and submit it to the pool.
// Here we showcase two ways to send an unsigned transaction with a signed payload
SubmitTransaction::<T, Call<T>>::submit_unsigned_transaction(call.into())
.map_err(|()| "Unable to submit unsigned transaction.")?;

// -- Sign using any account
let (_, result) = Signer::<T, T::AuthorityId>::any_account().send_unsigned_transaction(
|account| PricePayload {
Expand Down Expand Up @@ -500,16 +490,6 @@ impl<T: Trait> Module<T> {
// Note this call will block until response is received.
let price = Self::fetch_price().map_err(|_| "Failed to fetch price")?;

// Received price is wrapped into a call to `submit_price_unsigned` public function of this
// pallet. This means that the transaction, when executed, will simply call that function
// passing `price` as an argument.
let call = Call::submit_price_unsigned(block_number, price);

// Now let's create a transaction out of this call and submit it to the pool.
// Here we showcase two ways to send an unsigned transaction with a signed payload
SubmitTransaction::<T, Call<T>>::submit_unsigned_transaction(call.into())
.map_err(|()| "Unable to submit unsigned transaction.")?;

// -- Sign using all accounts
let transaction_results = Signer::<T, T::AuthorityId>::all_accounts()
.send_unsigned_transaction(
Expand Down

0 comments on commit 35a667a

Please sign in to comment.