diff --git a/src/ledger.rs b/src/ledger.rs new file mode 100644 index 0000000..a016e98 --- /dev/null +++ b/src/ledger.rs @@ -0,0 +1,12 @@ +use crate::asset::Asset; +use crate::claim::ClaimableBalanceId; +use crate::crypto::PublicKey; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum LedgerKey { + Account(PublicKey), + Trustline(PublicKey, Asset), + Offer(PublicKey, i64), + Data(PublicKey, String), + ClaimableBalance(ClaimableBalanceId), +} diff --git a/src/lib.rs b/src/lib.rs index 0bc3a25..3649a36 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -80,6 +80,7 @@ pub mod asset; pub mod claim; pub mod crypto; pub mod error; +pub mod ledger; pub mod memo; pub mod network; pub mod operations; diff --git a/src/operations/revoke_sponsorship.rs b/src/operations/revoke_sponsorship.rs index 7f8ed9c..7fbc991 100644 --- a/src/operations/revoke_sponsorship.rs +++ b/src/operations/revoke_sponsorship.rs @@ -2,6 +2,7 @@ use crate::asset::Asset; use crate::claim::ClaimableBalanceId; use crate::crypto::{MuxedAccount, PublicKey}; use crate::error::{Error, Result}; +use crate::ledger::LedgerKey; use crate::operations::Operation; use crate::signature::SignerKey; use crate::xdr; @@ -25,15 +26,6 @@ pub struct RevokeSponsorshipSigner { signer_key: SignerKey, } -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum LedgerKey { - Account(PublicKey), - Trustline(PublicKey, Asset), - Offer(PublicKey, i64), - Data(PublicKey, String), - ClaimableBalance(ClaimableBalanceId), -} - #[derive(Debug, Default)] pub struct RevokeSponsorshipOperationBuilder { source_account: Option, @@ -306,8 +298,8 @@ mod tests { use crate::asset::Asset; use crate::claim::ClaimableBalanceId; use crate::crypto::KeyPair; + use crate::ledger::LedgerKey; use crate::network::Network; - use crate::operations::revoke_sponsorship::LedgerKey; use crate::operations::Operation; use crate::signature::SignerKey; use crate::transaction::{Transaction, TransactionEnvelope, MIN_BASE_FEE};