mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +00:00
use externalities for chain_id
This commit is contained in:
@@ -73,4 +73,8 @@ impl<'a, B: 'a> Externalities for Ext<'a, B>
|
||||
fn set_storage(&mut self, key: Vec<u8>, value: Vec<u8>) {
|
||||
self.overlay.set_storage(key, value);
|
||||
}
|
||||
|
||||
fn chain_id(&self) -> u64 {
|
||||
42
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,10 @@ pub trait Externalities {
|
||||
/// Set storage of current contract being called (effective immediately).
|
||||
fn set_storage(&mut self, key: Vec<u8>, value: Vec<u8>);
|
||||
|
||||
/// Get the current set of authorities.
|
||||
/// Get the identity of the chain.
|
||||
fn chain_id(&self) -> u64 { 42 } // TODO: remove implementation and fix resulting errors.
|
||||
|
||||
/// Get the current set of authorities from storage.
|
||||
fn authorities(&self) -> Result<Vec<&[u8]>, Self::Error> {
|
||||
(0..self.storage(b"con\0aut\0len")?.into_iter()
|
||||
.rev()
|
||||
|
||||
Reference in New Issue
Block a user