Drone now returns signed airdrop transactions

This commit is contained in:
Michael Vines
2018-11-14 18:57:34 -08:00
parent 3543a9a49f
commit e791d0f74d
11 changed files with 316 additions and 272 deletions

View File

@@ -56,7 +56,7 @@ impl RpcRequest {
"method": method,
});
if let Some(param_string) = params {
request["params"] = json!(vec![param_string]);
request["params"] = param_string;
}
request
}
@@ -99,18 +99,18 @@ mod tests {
let test_request = RpcRequest::GetAccountInfo;
let request = test_request.build_request_json(
1,
Some(json!("deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx")),
Some(json!(["deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx"])),
);
assert_eq!(request["method"], "getAccountInfo");
assert_eq!(
request["params"],
json!(vec!["deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx"])
json!(["deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx"])
);
let test_request = RpcRequest::GetBalance;
let request = test_request.build_request_json(
1,
Some(json!("deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx")),
Some(json!(["deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx"])),
);
assert_eq!(request["method"], "getBalance");
@@ -172,7 +172,7 @@ mod tests {
let balance = RpcRequest::GetBalance.make_rpc_request(
&rpc_addr,
1,
Some(json!("deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx")),
Some(json!(["deadbeefXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNHhx"])),
);
assert!(balance.is_ok());
assert_eq!(balance.unwrap().as_u64().unwrap(), 50);