Remove CallData/OutData.

This commit is contained in:
Gav
2018-02-07 13:02:57 +01:00
parent a5195dfce6
commit 26b4b56402
19 changed files with 197 additions and 103 deletions
+3 -4
View File
@@ -48,7 +48,6 @@ mod tests {
use substrate_executor::executor;
use primitives::relay::{AccountId, Hash, BlockNumber, Header, Digest, UncheckedTransaction,
Transaction, Function};
use primitives::contract::CallData;
use ed25519::Pair;
fn secret_for(who: &AccountId) -> Option<Pair> {
@@ -88,7 +87,7 @@ mod tests {
&mut overlay,
&executor(),
"execute_transaction",
&CallData(vec![].join(&header).join(tx))
&vec![].join(&header).join(tx)
).unwrap();
header = Header::from_slice(&mut &ret_data[..]).unwrap();
}
@@ -98,7 +97,7 @@ mod tests {
&mut overlay,
&executor(),
"finalise_block",
&CallData(vec![].join(&header))
&vec![].join(&header)
).unwrap();
header = Header::from_slice(&mut &ret_data[..]).unwrap();
@@ -137,7 +136,7 @@ mod tests {
&mut overlay,
&executor(),
"execute_block",
&CallData(b1data)
&b1data
).unwrap();
}
}
+2 -2
View File
@@ -48,7 +48,7 @@ pub use blockchain::Info as ChainInfo;
pub use blockchain::BlockId;
use primitives::relay::block;
use primitives::contract::{CallData, StorageKey, StorageData};
use primitives::contract::{StorageKey, StorageData};
use blockchain::Backend as BlockchainBackend;
use backend::BlockImportOperation;
@@ -156,7 +156,7 @@ impl<B, E> Client<B, E> where
/// Execute a call to a contract on top of state in a block of given hash.
///
/// No changes are made.
pub fn call(&self, hash: &block::HeaderHash, method: &str, call_data: &CallData) -> error::Result<CallResult> {
pub fn call(&self, hash: &block::HeaderHash, method: &str, call_data: &[u8]) -> error::Result<CallResult> {
let state = self.state_at(hash)?;
let mut changes = state_machine::OverlayedChanges::default();