-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1573 from encointer/cl/merge-v1.11.3-to-fdroid
Merge11.3 into fdroid
- Loading branch information
Showing
133 changed files
with
4,629 additions
and
1,685 deletions.
There are no files selected for viewing
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,29 +1,9 @@ | ||
import { unsubscribe } from '../utils/unsubscribe.js'; | ||
|
||
/** | ||
* Mainly debug method introduced to test subscriptions. Subscribes to the timestamp of the last block | ||
* @param msgChannel channel that the message handler uses on the dart side | ||
* @returns {Promise<void>} | ||
*/ | ||
export async function subscribeTimestamp (msgChannel) { | ||
await api.query.timestamp.now((moment) => { | ||
send(msgChannel, moment); | ||
}).then((unsub) => unsubscribe(unsub, msgChannel)); | ||
} | ||
|
||
export async function subscribeNewHeads (msgChannel) { | ||
await api.rpc.chain.subscribeNewHeads((lastHeader) => { | ||
send(msgChannel, lastHeader); | ||
}).then((unsub) => unsubscribe(unsub, msgChannel)); | ||
} | ||
|
||
export async function getFinalizedHeader () { | ||
const hash = await api.rpc.chain.getFinalizedHead(); | ||
return api.rpc.chain.getHeader(hash); | ||
} | ||
|
||
export default { | ||
subscribeTimestamp, | ||
subscribeNewHeads, | ||
getFinalizedHeader, | ||
}; |
Oops, something went wrong.