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 -3
View File
@@ -23,7 +23,7 @@ mod tests;
use client::{self, Client};
use primitives::relay::block;
use primitives::contract::{CallData, StorageKey, StorageData};
use primitives::contract::{StorageKey, StorageData};
use state_machine;
use self::error::Result;
@@ -37,7 +37,7 @@ build_rpc_trait! {
/// Call a contract.
#[rpc(name = "state_call")]
fn call(&self, String, CallData, block::HeaderHash) -> Result<Vec<u8>>;
fn call(&self, String, Vec<u8>, block::HeaderHash) -> Result<Vec<u8>>;
}
}
@@ -50,7 +50,7 @@ impl<B, E> StateApi for Client<B, E> where
Ok(self.storage(&block, &key)?)
}
fn call(&self, method: String, data: CallData, block: block::HeaderHash) -> Result<Vec<u8>> {
fn call(&self, method: String, data: Vec<u8>, block: block::HeaderHash) -> Result<Vec<u8>> {
Ok(self.call(&block, &method, &data)?.return_data)
}
}
+1 -1
View File
@@ -39,7 +39,7 @@ fn should_call_contract() {
let genesis_hash = "af65e54217fb213853703d57b80fc5b2bb834bf923046294d7a49bff62f0a8b2".into();
assert_matches!(
StateApi::call(&client, "balanceOf".into(), CallData(vec![1,2,3]), genesis_hash),
StateApi::call(&client, "balanceOf".into(), vec![1,2,3], genesis_hash),
Err(Error(ErrorKind::Client(client::error::ErrorKind::Execution(_)), _))
)
}