-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
89 additions
and
182 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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 |
---|---|---|
|
@@ -178,4 +178,3 @@ pub mod pallet { | |
} | ||
} | ||
} | ||
|
File renamed without changes.
File renamed without changes.
This file contains 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
2 changes: 0 additions & 2 deletions
2
crates/skw-blockchain-pallets/pallet-secrets/src/benchmarking.rs
This file contains 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
//! Benchmarking setup for pallet-template | ||
use super::*; | ||
|
||
use frame_system::RawOrigin; | ||
|
This file contains 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 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 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 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 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 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 |
---|---|---|
@@ -1,16 +1,18 @@ | ||
// Copyright 2021-2022 @skyekiwi/s-contract authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { ApiPromise } from '@polkadot/api'; | ||
|
||
import { getLogger } from '@skyekiwi/util'; | ||
|
||
/* eslint-disable sort-keys, camelcase, @typescript-eslint/ban-ts-comment */ | ||
export class Subscriber { | ||
public async subscribeNewBlock ( | ||
api: ApiPromise, | ||
newBlockHook: (blockNumber: number) => Promise<void>, | ||
): Promise<void> { | ||
await api.rpc.chain.subscribeNewHeads(async (latestHeader) => { | ||
await newBlockHook(latestHeader.number.toNumber()); | ||
}); | ||
} | ||
public async subscribeNewBlock ( | ||
api: ApiPromise, | ||
newBlockHook: (blockNumber: number) => Promise<void>, | ||
): Promise<void> { | ||
const logger = getLogger('subscriber'); | ||
logger.info("Subscribing to new blocks"); | ||
await api.rpc.chain.subscribeNewHeads(async (latestHeader) => { | ||
logger.info(`new block received ${latestHeader.number.toNumber()}`); | ||
await newBlockHook(latestHeader.number.toNumber()); | ||
}); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.