mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Support handling addresses from other networks
A type alias of MoneroAddress is provided to abstract away the generic. To keep the rest of the library sane, MoneroAddress is used everywhere. If someone wants to use this library with another coin, they *should* be able to parse a custom address and then recreate it as a Monero address. While that's annoying to them, better them than any person using this lib for Monero. Closes #152.
This commit is contained in:
@@ -12,7 +12,7 @@ use monero_serai::{
|
||||
rpc::Rpc,
|
||||
wallet::{
|
||||
ViewPair, Scanner,
|
||||
address::{Network, Address},
|
||||
address::{Network, MoneroAddress},
|
||||
Fee, SpendableOutput, SignableTransaction as MSignableTransaction, TransactionMachine,
|
||||
},
|
||||
};
|
||||
@@ -88,7 +88,7 @@ impl Monero {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn empty_address() -> Address {
|
||||
fn empty_address() -> MoneroAddress {
|
||||
Self::empty_scanner().address()
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ impl Coin for Monero {
|
||||
type SignableTransaction = SignableTransaction;
|
||||
type TransactionMachine = TransactionMachine;
|
||||
|
||||
type Address = Address;
|
||||
type Address = MoneroAddress;
|
||||
|
||||
const ID: &'static [u8] = b"Monero";
|
||||
const CONFIRMATIONS: usize = 10;
|
||||
@@ -161,7 +161,7 @@ impl Coin for Monero {
|
||||
transcript: RecommendedTranscript,
|
||||
block_number: usize,
|
||||
mut inputs: Vec<Output>,
|
||||
payments: &[(Address, u64)],
|
||||
payments: &[(MoneroAddress, u64)],
|
||||
fee: Fee,
|
||||
) -> Result<SignableTransaction, CoinError> {
|
||||
let spend = keys.group_key();
|
||||
|
||||
Reference in New Issue
Block a user