Undo breaking rpc removal of getSignatureConfirmation (#9247)
This commit is contained in:
@ -398,6 +398,25 @@ impl JsonRpcRequestProcessor {
|
|||||||
.unwrap_or(None))
|
.unwrap_or(None))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_signature_confirmation_status(
|
||||||
|
&self,
|
||||||
|
signature: Signature,
|
||||||
|
commitment: Option<CommitmentConfig>,
|
||||||
|
) -> Option<RpcSignatureConfirmation> {
|
||||||
|
self.bank(commitment)
|
||||||
|
.get_signature_confirmation_status(&signature)
|
||||||
|
.map(
|
||||||
|
|SignatureConfirmationStatus {
|
||||||
|
confirmations,
|
||||||
|
status,
|
||||||
|
..
|
||||||
|
}| RpcSignatureConfirmation {
|
||||||
|
confirmations,
|
||||||
|
status,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get_signature_status(
|
pub fn get_signature_status(
|
||||||
&self,
|
&self,
|
||||||
signature: Signature,
|
signature: Signature,
|
||||||
@ -560,6 +579,14 @@ pub trait RpcSol {
|
|||||||
#[rpc(meta, name = "getFeeRateGovernor")]
|
#[rpc(meta, name = "getFeeRateGovernor")]
|
||||||
fn get_fee_rate_governor(&self, meta: Self::Metadata) -> RpcResponse<RpcFeeRateGovernor>;
|
fn get_fee_rate_governor(&self, meta: Self::Metadata) -> RpcResponse<RpcFeeRateGovernor>;
|
||||||
|
|
||||||
|
#[rpc(meta, name = "getSignatureConfirmation")]
|
||||||
|
fn get_signature_confirmation(
|
||||||
|
&self,
|
||||||
|
meta: Self::Metadata,
|
||||||
|
signature_str: String,
|
||||||
|
commitment: Option<CommitmentConfig>,
|
||||||
|
) -> Result<Option<RpcSignatureConfirmation>>;
|
||||||
|
|
||||||
#[rpc(meta, name = "getSignatureStatus")]
|
#[rpc(meta, name = "getSignatureStatus")]
|
||||||
fn get_signature_status(
|
fn get_signature_status(
|
||||||
&self,
|
&self,
|
||||||
@ -899,6 +926,24 @@ impl RpcSol for RpcSolImpl {
|
|||||||
.get_fee_rate_governor()
|
.get_fee_rate_governor()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_signature_confirmation(
|
||||||
|
&self,
|
||||||
|
meta: Self::Metadata,
|
||||||
|
signature_str: String,
|
||||||
|
commitment: Option<CommitmentConfig>,
|
||||||
|
) -> Result<Option<RpcSignatureConfirmation>> {
|
||||||
|
debug!(
|
||||||
|
"get_signature_confirmation rpc request received: {:?}",
|
||||||
|
signature_str
|
||||||
|
);
|
||||||
|
let signature = verify_signature(&signature_str)?;
|
||||||
|
Ok(meta
|
||||||
|
.request_processor
|
||||||
|
.read()
|
||||||
|
.unwrap()
|
||||||
|
.get_signature_confirmation_status(signature, commitment))
|
||||||
|
}
|
||||||
|
|
||||||
fn get_signature_status(
|
fn get_signature_status(
|
||||||
&self,
|
&self,
|
||||||
meta: Self::Metadata,
|
meta: Self::Metadata,
|
||||||
|
Reference in New Issue
Block a user