Improve solana deploy (#12621)
* Check program account before attempting to create it * Use last_valid_slot to timeout status checks * Include transaction history in RpcClient::get_signature_statuses requests * Improve solana-deploy send-transactions * Clippy * Improve mock deploy test * Review comments
This commit is contained in:
@ -94,9 +94,15 @@ impl RpcSender for MockSender {
|
||||
err,
|
||||
})
|
||||
};
|
||||
let statuses: Vec<Option<TransactionStatus>> = params.as_array().unwrap()[0]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.map(|_| status.clone())
|
||||
.collect();
|
||||
serde_json::to_value(Response {
|
||||
context: RpcResponseContext { slot: 1 },
|
||||
value: vec![status],
|
||||
value: statuses,
|
||||
})?
|
||||
}
|
||||
RpcRequest::GetTransactionCount => Value::Number(Number::from(1234)),
|
||||
|
@ -164,6 +164,19 @@ impl RpcClient {
|
||||
self.send(RpcRequest::GetSignatureStatuses, json!([signatures]))
|
||||
}
|
||||
|
||||
pub fn get_signature_statuses_with_history(
|
||||
&self,
|
||||
signatures: &[Signature],
|
||||
) -> RpcResult<Vec<Option<TransactionStatus>>> {
|
||||
let signatures: Vec<_> = signatures.iter().map(|s| s.to_string()).collect();
|
||||
self.send(
|
||||
RpcRequest::GetSignatureStatuses,
|
||||
json!([signatures, {
|
||||
"searchTransactionHistory": true
|
||||
}]),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_signature_status_with_commitment(
|
||||
&self,
|
||||
signature: &Signature,
|
||||
|
Reference in New Issue
Block a user