sendTransaction rpc: expect transaction as base58 string (#7913)

This commit is contained in:
Tyera Eulberg
2020-01-21 22:16:07 -07:00
committed by GitHub
parent 7a132eabb4
commit 65f5885bce
4 changed files with 11 additions and 11 deletions

View File

@@ -100,10 +100,10 @@ impl RpcClient {
}
pub fn send_transaction(&self, transaction: &Transaction) -> Result<String, ClientError> {
let serialized = serialize(transaction).unwrap();
let signature = self
.client
.send(&RpcRequest::SendTransaction, json!([serialized]), 5)?;
let serialized_encoded = bs58::encode(serialize(transaction).unwrap()).into_string();
let signature =
self.client
.send(&RpcRequest::SendTransaction, json!([serialized_encoded]), 5)?;
if signature.as_str().is_none() {
Err(io::Error::new(
io::ErrorKind::Other,