-
Notifications
You must be signed in to change notification settings - Fork 36
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 #61 from nazar-pc/show-balance
Show balance of the reward address and farmed coins since last start
- Loading branch information
Showing
7 changed files
with
197 additions
and
65 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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use sp_core::storage::StorageKey; | ||
use sp_core::{blake2_128, twox_128}; | ||
use subspace_core_primitives::PublicKey; | ||
|
||
pub(super) fn account_storage_key(public_key: &PublicKey) -> StorageKey { | ||
let mut storage_key = Vec::new(); | ||
|
||
storage_key.extend_from_slice(&twox_128(b"System")); | ||
storage_key.extend_from_slice(&twox_128(b"Account")); | ||
// Next two lines are "blake2_128_concat" | ||
storage_key.extend_from_slice(&blake2_128(public_key.as_ref())); | ||
storage_key.extend_from_slice(public_key.as_ref()); | ||
|
||
StorageKey(storage_key) | ||
} |
Oops, something went wrong.