Transaction permissioning (#6441)

This commit is contained in:
Arkadiy Paronyan
2017-09-05 11:39:50 +02:00
committed by Gav Wood
parent 2df61d0a8c
commit eed0e8b03a
15 changed files with 307 additions and 3 deletions

View File

@@ -454,6 +454,13 @@ impl BlockChainClient for TestBlockChainClient {
}
}
fn code_hash(&self, address: &Address, id: BlockId) -> Option<H256> {
match id {
BlockId::Latest | BlockId::Pending => self.code.read().get(address).map(|c| keccak(&c)),
_ => None,
}
}
fn balance(&self, address: &Address, id: BlockId) -> Option<U256> {
match id {
BlockId::Latest | BlockId::Pending => Some(self.balances.read().get(address).cloned().unwrap_or_else(U256::zero)),