Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create parent-child inscriptions with ord wallet #2388

Merged
merged 23 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ mime = "0.3.16"
mime_guess = "2.0.4"
miniscript = "10.0.0"
mp4 = "0.14.0"
ord-bitcoincore-rpc = "0.17.0"
ord-bitcoincore-rpc = "0.17.1"
redb = "1.0.5"
regex = "1.6.0"
rss = "2.0.1"
Expand Down
2 changes: 1 addition & 1 deletion src/fee_rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl TryFrom<f64> for FeeRate {
}

impl FeeRate {
pub(crate) fn fee(&self, vsize: usize) -> Amount {
pub fn fee(&self, vsize: usize) -> Amount {
#[allow(clippy::cast_possible_truncation)]
#[allow(clippy::cast_sign_loss)]
Amount::from_sat((self.0 * vsize as f64).round() as u64)
Expand Down
10 changes: 7 additions & 3 deletions src/inscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ impl Inscription {
result
}

pub(crate) fn from_file(chain: Chain, path: impl AsRef<Path>) -> Result<Self, Error> {
pub(crate) fn from_file(
chain: Chain,
path: impl AsRef<Path>,
parent: Option<InscriptionId>,
) -> Result<Self, Error> {
let path = path.as_ref();

let body = fs::read(path).with_context(|| format!("io error reading {}", path.display()))?;
Expand All @@ -90,7 +94,7 @@ impl Inscription {
Ok(Self {
body: Some(body),
content_type: Some(content_type.into()),
parent: None,
parent: parent.map(|id| id.parent_value()),
unrecognized_even_field: false,
})
}
Expand Down Expand Up @@ -830,8 +834,8 @@ mod tests {
Ok(vec![Inscription {
content_type: None,
body: None,
unrecognized_even_field: true,
parent: None,
unrecognized_even_field: true,
}]),
);
}
Expand Down
1 change: 0 additions & 1 deletion src/inscription_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pub struct InscriptionId {
}

impl InscriptionId {
#[cfg(test)]
pub(crate) fn parent_value(self) -> Vec<u8> {
let index = self.index.to_le_bytes();
let mut index_slice = index.as_slice();
Expand Down
1 change: 1 addition & 0 deletions src/subcommand/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ impl Preview {
dry_run: false,
no_limit: false,
destination: None,
parent: None,
postage: Some(TransactionBuilder::TARGET_POSTAGE),
},
)),
Expand Down
Loading
Loading