Merge pull request #6345 from paritytech/networkid
Rename network_id to chain_id where applicable.
This commit is contained in:
@@ -1720,8 +1720,8 @@ impl BlockChainClient for Client {
|
||||
}
|
||||
}
|
||||
|
||||
fn signing_network_id(&self) -> Option<u64> {
|
||||
self.engine.signing_network_id(&self.latest_env_info())
|
||||
fn signing_chain_id(&self) -> Option<u64> {
|
||||
self.engine.signing_chain_id(&self.latest_env_info())
|
||||
}
|
||||
|
||||
fn block_extra_info(&self, id: BlockId) -> Option<BTreeMap<String, String>> {
|
||||
@@ -1760,9 +1760,9 @@ impl BlockChainClient for Client {
|
||||
value: U256::zero(),
|
||||
data: data,
|
||||
};
|
||||
let network_id = self.engine.signing_network_id(&self.latest_env_info());
|
||||
let signature = self.engine.sign(transaction.hash(network_id))?;
|
||||
let signed = SignedTransaction::new(transaction.with_signature(signature, network_id))?;
|
||||
let chain_id = self.engine.signing_chain_id(&self.latest_env_info());
|
||||
let signature = self.engine.sign(transaction.hash(chain_id))?;
|
||||
let signed = SignedTransaction::new(transaction.with_signature(signature, chain_id))?;
|
||||
self.miner.import_own_transaction(self, signed.into())
|
||||
}
|
||||
|
||||
|
||||
@@ -734,7 +734,7 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
self.miner.ready_transactions(info.best_block_number, info.best_block_timestamp)
|
||||
}
|
||||
|
||||
fn signing_network_id(&self) -> Option<u64> { None }
|
||||
fn signing_chain_id(&self) -> Option<u64> { None }
|
||||
|
||||
fn mode(&self) -> Mode { Mode::Active }
|
||||
|
||||
@@ -765,9 +765,9 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
value: U256::default(),
|
||||
data: data,
|
||||
};
|
||||
let network_id = Some(self.spec.params().network_id);
|
||||
let sig = self.spec.engine.sign(transaction.hash(network_id)).unwrap();
|
||||
let signed = SignedTransaction::new(transaction.with_signature(sig, network_id)).unwrap();
|
||||
let chain_id = Some(self.spec.chain_id());
|
||||
let sig = self.spec.engine.sign(transaction.hash(chain_id)).unwrap();
|
||||
let signed = SignedTransaction::new(transaction.with_signature(sig, chain_id)).unwrap();
|
||||
self.miner.import_own_transaction(self, signed.into())
|
||||
}
|
||||
|
||||
|
||||
@@ -240,8 +240,8 @@ pub trait BlockChainClient : Sync + Send {
|
||||
corpus.into()
|
||||
}
|
||||
|
||||
/// Get the preferred network ID to sign on
|
||||
fn signing_network_id(&self) -> Option<u64>;
|
||||
/// Get the preferred chain ID to sign on
|
||||
fn signing_chain_id(&self) -> Option<u64>;
|
||||
|
||||
/// Get the mode.
|
||||
fn mode(&self) -> Mode;
|
||||
|
||||
Reference in New Issue
Block a user