Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
RGB-20: Removed dust limit. Closes #55
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 10, 2020
1 parent 18cb0ac commit c8e95b0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 27 deletions.
3 changes: 0 additions & 3 deletions ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ struct IssueArgs {
precision: u8,
#[serde(default)]
prune_seals: Vec<SealSpec>,
#[serde(default)]
dust_limit: Option<Amount>,
}

fn _issue(runtime: &COpaqueStruct, json: *mut c_char) -> Result<(), String> {
Expand All @@ -208,7 +206,6 @@ fn _issue(runtime: &COpaqueStruct, json: *mut c_char) -> Result<(), String> {
data.allocations,
data.precision,
data.prune_seals,
data.dust_limit,
)
.map_err(|e| format!("{:?}", e))
}
Expand Down
6 changes: 1 addition & 5 deletions src/api/fungible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use serde::{Deserialize, Serialize};
use lnpbp::bitcoin::util::psbt::PartiallySignedTransaction;
use lnpbp::bitcoin::OutPoint;
use lnpbp::bp::blind::OutpointReveal;
use lnpbp::rgb::{Amount, Consignment, ContractId};
use lnpbp::rgb::{Consignment, ContractId};

use crate::fungible::{Outcoincealed, Outcoins};
use crate::util::SealSpec;
Expand Down Expand Up @@ -81,10 +81,6 @@ pub struct Issue {
#[clap(short, long, default_value = "0")]
pub precision: u8,

/// Dust limit for asset transfers; defaults to no limit
#[clap(short = 'D', long)]
pub dust_limit: Option<Amount>,

/// Asset allocation, in form of <amount>@<txid>:<vout>
#[clap(required = true)]
pub allocate: Vec<Outcoins>,
Expand Down
5 changes: 0 additions & 5 deletions src/contracts/fungible/data/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ pub struct Asset {
name: String,
description: Option<String>,
supply: Supply,
dust_limit: Coins,
#[serde(with = "serde_with::rust::display_fromstr")]
chain: bp::Chain,
fractional_bits: u8,
Expand Down Expand Up @@ -230,10 +229,6 @@ impl TryFrom<Genesis> for Asset {
fractional_bits,
)),
},
dust_limit: Coins::with_sats_precision(
genesis_meta.u64(*FieldType::DustLimit)?,
fractional_bits,
),
fractional_bits,
date: NaiveDateTime::from_timestamp(genesis_meta.i64(*FieldType::Timestamp)?, 0),
unspent_issue_txo: None,
Expand Down
14 changes: 6 additions & 8 deletions src/contracts/fungible/data/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ pub enum FieldType {
Ticker = 0,
Name = 1,
Description = 2,
TotalSupply = 3,
IssuedSupply = 4,
DustLimit = 5,
Precision = 6,
Timestamp = 7,
HistoryProof = 8,
HistoryProofFormat = 9,
Precision = 3,
TotalSupply = 4,
IssuedSupply = 5,
Timestamp = 6,
HistoryProof = 7,
HistoryProofFormat = 8,
}

#[derive(
Expand Down Expand Up @@ -199,7 +198,6 @@ pub fn schema() -> Schema {
FieldType::Description => Occurences::NoneOrOnce,
FieldType::TotalSupply => Occurences::Once,
FieldType::IssuedSupply => Occurences::Once,
FieldType::DustLimit => Occurences::NoneOrOnce,
FieldType::Precision => Occurences::Once,
FieldType::Timestamp => Occurences::Once
},
Expand Down
2 changes: 0 additions & 2 deletions src/contracts/fungible/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,12 @@ impl Processor {
allocations: Vec<Outcoins>,
precision: u8,
prune_seals: Vec<SealSpec>,
dust_limit: Option<Amount>,
) -> Result<(Asset, Genesis), ServiceErrorDomain> {
let now = Utc::now().timestamp();
let mut metadata = type_map! {
FieldType::Ticker => field!(String, ticker),
FieldType::Name => field!(String, name),
FieldType::Precision => field!(U8, precision),
FieldType::DustLimit => field!(U64, dust_limit.unwrap_or(0)),
FieldType::Timestamp => field!(I64, now)
};
if let Some(description) = description {
Expand Down
1 change: 0 additions & 1 deletion src/contracts/fungible/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ impl Runtime {
issue.allocate.clone(),
issue.precision,
vec![],
issue.dust_limit,
)?;

self.import_asset(asset, genesis).await?;
Expand Down
3 changes: 0 additions & 3 deletions src/i9n/fungible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use lnpbp::bitcoin::OutPoint;
use lnpbp::bp;
use lnpbp::lnp::presentation::Encode;
use lnpbp::lnp::Unmarshall;
use lnpbp::rgb::Amount;

use super::{Error, Runtime};
use crate::api::{fungible::Issue, fungible::Request, fungible::TransferApi, reply, Reply};
Expand Down Expand Up @@ -50,7 +49,6 @@ impl Runtime {
allocate: Vec<Outcoins>,
precision: u8,
_prune_seals: Vec<SealSpec>,
dust_limit: Option<Amount>,
) -> Result<(), Error> {
// TODO: Make sure we use the same network
let (supply, inflatable) = match issue_structure {
Expand All @@ -67,7 +65,6 @@ impl Runtime {
supply,
inflatable,
precision,
dust_limit,
allocate,
});
match &*self.command(command)? {
Expand Down

0 comments on commit c8e95b0

Please sign in to comment.