Consolidate signature-status rpcs (#9069)

* getSignatureStatus: return confirmations for non-rooted transactions

* Remove getNumConfirmations.. rpc

* Remove getSignatureConfirmation

* Review comments

* More review comments
This commit is contained in:
Tyera Eulberg
2020-03-26 19:21:01 -06:00
committed by GitHub
parent 48031651a0
commit 4b97e58cba
6 changed files with 72 additions and 145 deletions

View File

@@ -101,9 +101,16 @@ impl GenericRpcClientRequest for MockRpcClientRequest {
let status = if self.url == "sig_not_found" {
None
} else {
Some(TransactionStatus { status, slot: 1 })
Some(TransactionStatus {
status,
slot: 1,
confirmations: Some(0),
})
};
serde_json::to_value(vec![status])?
serde_json::to_value(Response {
context: RpcResponseContext { slot: 1 },
value: vec![status],
})?
}
RpcRequest::GetTransactionCount => Value::Number(Number::from(1234)),
RpcRequest::GetSlot => Value::Number(Number::from(0)),