Beta backports (#4569)
* Fixing evmbin compilation and added standard build. (#4561) * Alias for personal_sendTransaction (#4554) * Fix console dapp (#4544) * Fixing linting issues. Better support for console as secure app * Fixing linting issues * Fix no data sent in TxQueue dapp (#4502) * Fix wrong PropType req for Embedded Signer * Fix wrong data for tx #4499
This commit is contained in:
@@ -117,4 +117,9 @@ impl<C: 'static, M: 'static> Personal for PersonalClient<C, M> where C: MiningBl
|
||||
dispatch::SignWith::Password(password)
|
||||
).map(|v| v.into_value().into())
|
||||
}
|
||||
|
||||
fn sign_and_send_transaction(&self, request: TransactionRequest, password: String) -> Result<RpcH256, Error> {
|
||||
warn!("Using deprecated personal_signAndSendTransaction, use personal_sendTransaction instead.");
|
||||
self.send_transaction(request, password)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,16 +112,25 @@ fn sign_and_send_transaction_with_invalid_password() {
|
||||
assert_eq!(tester.io.handle_request_sync(request.as_ref()), Some(response.into()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn send_transaction() {
|
||||
sign_and_send_test("personal_sendTransaction");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sign_and_send_transaction() {
|
||||
sign_and_send_test("personal_signAndSendTransaction");
|
||||
}
|
||||
|
||||
fn sign_and_send_test(method: &str) {
|
||||
let tester = setup();
|
||||
let address = tester.accounts.new_account("password123").unwrap();
|
||||
|
||||
let request = r#"{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "personal_sendTransaction",
|
||||
"method": ""#.to_owned() + method + r#"",
|
||||
"params": [{
|
||||
"from": ""#.to_owned() + format!("0x{:?}", address).as_ref() + r#"",
|
||||
"from": ""# + format!("0x{:?}", address).as_ref() + r#"",
|
||||
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
|
||||
"gas": "0x76c0",
|
||||
"gasPrice": "0x9184e72a000",
|
||||
|
||||
@@ -38,5 +38,9 @@ build_rpc_trait! {
|
||||
/// Sends transaction and signs it in single call. The account is not unlocked in such case.
|
||||
#[rpc(name = "personal_sendTransaction")]
|
||||
fn send_transaction(&self, TransactionRequest, String) -> Result<H256, Error>;
|
||||
|
||||
/// Deprecated alias for `personal_sendTransaction`.
|
||||
#[rpc(name = "personal_signAndSendTransaction")]
|
||||
fn sign_and_send_transaction(&self, TransactionRequest, String) -> Result<H256, Error>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user