Skip to content

Commit

Permalink
feat: move LedgerKey to own module
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Ceccon <[email protected]>
  • Loading branch information
fracek committed Sep 25, 2020
1 parent 0071ea4 commit 39e39e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
12 changes: 12 additions & 0 deletions src/ledger.rs
Original file line number Diff line number Diff line change
@@ -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),
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 2 additions & 10 deletions src/operations/revoke_sponsorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<MuxedAccount>,
Expand Down Expand Up @@ -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};
Expand Down

0 comments on commit 39e39e8

Please sign in to comment.