allow optional casting of engine client to full client
This commit is contained in:
@@ -1960,13 +1960,7 @@ impl super::traits::EngineClient for Client {
|
||||
BlockChainClient::chain_info(self)
|
||||
}
|
||||
|
||||
fn call_contract(&self, id: BlockId, address: Address, data: Bytes) -> Result<Bytes, String> {
|
||||
BlockChainClient::call_contract(self, id, address, data)
|
||||
}
|
||||
|
||||
fn transact_contract(&self, address: Address, data: Bytes) -> Result<TransactionImportResult, EthcoreError> {
|
||||
BlockChainClient::transact_contract(self, address, data)
|
||||
}
|
||||
fn as_full_client(&self) -> Option<&BlockChainClient> { Some(self) }
|
||||
|
||||
fn block_number(&self, id: BlockId) -> Option<BlockNumber> {
|
||||
BlockChainClient::block_number(self, id)
|
||||
|
||||
@@ -828,13 +828,7 @@ impl super::traits::EngineClient for TestBlockChainClient {
|
||||
BlockChainClient::chain_info(self)
|
||||
}
|
||||
|
||||
fn call_contract(&self, id: BlockId, address: Address, data: Bytes) -> Result<Bytes, String> {
|
||||
BlockChainClient::call_contract(self, id, address, data)
|
||||
}
|
||||
|
||||
fn transact_contract(&self, address: Address, data: Bytes) -> Result<TransactionImportResult, EthcoreError> {
|
||||
BlockChainClient::transact_contract(self, address, data)
|
||||
}
|
||||
fn as_full_client(&self) -> Option<&BlockChainClient> { Some(self) }
|
||||
|
||||
fn block_number(&self, id: BlockId) -> Option<BlockNumber> {
|
||||
BlockChainClient::block_number(self, id)
|
||||
|
||||
@@ -337,12 +337,10 @@ pub trait EngineClient: Sync + Send {
|
||||
/// Get block chain info.
|
||||
fn chain_info(&self) -> BlockChainInfo;
|
||||
|
||||
/// Like `call`, but with various defaults. Designed to be used for calling contracts.
|
||||
fn call_contract(&self, id: BlockId, address: Address, data: Bytes) -> Result<Bytes, String>;
|
||||
|
||||
/// Import a transaction: used for misbehaviour reporting.
|
||||
fn transact_contract(&self, address: Address, data: Bytes) -> Result<TransactionImportResult, EthcoreError>;
|
||||
/// Attempt to cast the engine client to a full client.
|
||||
fn as_full_client(&self) -> Option<&BlockChainClient>;
|
||||
|
||||
/// Get a block number by ID.
|
||||
fn block_number(&self, id: BlockId) -> Option<BlockNumber>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user