mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 01:41:09 +00:00
Remove CallData/OutData.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(_)), _))
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user