mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-11 13:39:25 +00:00
Support arbitrary RPC providers in monero-serai
Sets a clean path for no-std premised RPCs (buffers to an external RPC impl)/ Tor-based RPCs/client-side load balancing/...
This commit is contained in:
@@ -33,7 +33,7 @@ use crate::{
|
||||
RctBase, RctPrunable, RctSignatures,
|
||||
},
|
||||
transaction::{Input, Output, Timelock, TransactionPrefix, Transaction},
|
||||
rpc::{Rpc, RpcError},
|
||||
rpc::{RpcError, RpcConnection, Rpc},
|
||||
wallet::{
|
||||
address::{Network, AddressSpec, MoneroAddress},
|
||||
ViewPair, SpendableOutput, Decoys, PaymentId, ExtraField, Extra, key_image_sort, uniqueness,
|
||||
@@ -147,9 +147,9 @@ pub enum TransactionError {
|
||||
FrostError(FrostError),
|
||||
}
|
||||
|
||||
async fn prepare_inputs<R: RngCore + CryptoRng>(
|
||||
async fn prepare_inputs<R: RngCore + CryptoRng, RPC: RpcConnection>(
|
||||
rng: &mut R,
|
||||
rpc: &Rpc,
|
||||
rpc: &Rpc<RPC>,
|
||||
ring_len: usize,
|
||||
inputs: &[SpendableOutput],
|
||||
spend: &Zeroizing<Scalar>,
|
||||
@@ -663,10 +663,10 @@ impl SignableTransaction {
|
||||
}
|
||||
|
||||
/// Sign this transaction.
|
||||
pub async fn sign<R: RngCore + CryptoRng>(
|
||||
pub async fn sign<R: RngCore + CryptoRng, RPC: RpcConnection>(
|
||||
mut self,
|
||||
rng: &mut R,
|
||||
rpc: &Rpc,
|
||||
rpc: &Rpc<RPC>,
|
||||
spend: &Zeroizing<Scalar>,
|
||||
) -> Result<Transaction, TransactionError> {
|
||||
let mut images = Vec::with_capacity(self.inputs.len());
|
||||
|
||||
@@ -30,7 +30,7 @@ use crate::{
|
||||
RctPrunable,
|
||||
},
|
||||
transaction::{Input, Transaction},
|
||||
rpc::Rpc,
|
||||
rpc::{RpcConnection, Rpc},
|
||||
wallet::{
|
||||
TransactionError, InternalPayment, SignableTransaction, Decoys, key_image_sort, uniqueness,
|
||||
},
|
||||
@@ -74,9 +74,9 @@ pub struct TransactionSignatureMachine {
|
||||
impl SignableTransaction {
|
||||
/// Create a FROST signing machine out of this signable transaction.
|
||||
/// The height is the Monero blockchain height to synchronize around.
|
||||
pub async fn multisig(
|
||||
pub async fn multisig<RPC: RpcConnection>(
|
||||
self,
|
||||
rpc: &Rpc,
|
||||
rpc: &Rpc<RPC>,
|
||||
keys: ThresholdKeys<Ed25519>,
|
||||
mut transcript: RecommendedTranscript,
|
||||
height: usize,
|
||||
|
||||
Reference in New Issue
Block a user