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

Set fee #1150

Merged
merged 28 commits into from
Jan 12, 2023
Merged

Set fee #1150

merged 28 commits into from
Jan 12, 2023

Conversation

raphjaph
Copy link
Collaborator

@raphjaph raphjaph commented Jan 2, 2023

No description provided.

Copy link
Collaborator

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add a fee rate wrapper type:

struct FeeRate(u64);

impl FromStr for FeeRate {
   // parse an f64
   // check for bad values
   // Self((v * 1000.0).round() as u64)
}

impl FeeRate {
  fn fee(vbytes: u64) -> Amount {
   Amount::from_sat(((self.0 as f64) / 1000.0 * vbytes as f64).ceil() as u64)
  }
}

src/subcommand/wallet/inscribe.rs Outdated Show resolved Hide resolved
src/subcommand/wallet/inscribe.rs Outdated Show resolved Hide resolved
src/subcommand/wallet/inscribe.rs Outdated Show resolved Hide resolved
src/subcommand/wallet/inscribe.rs Outdated Show resolved Hide resolved
src/subcommand/wallet/inscribe.rs Outdated Show resolved Hide resolved
src/subcommand/wallet/transaction_builder.rs Outdated Show resolved Hide resolved
src/subcommand/wallet/transaction_builder.rs Outdated Show resolved Hide resolved
src/subcommand/wallet/transaction_builder.rs Outdated Show resolved Hide resolved
tests/wallet.rs Outdated Show resolved Hide resolved
tests/wallet.rs Outdated Show resolved Hide resolved
@raphjaph raphjaph marked this pull request as draft January 3, 2023 00:08
@raphjaph raphjaph marked this pull request as ready for review January 10, 2023 21:06
@raphjaph raphjaph requested a review from casey January 10, 2023 21:06
src/fee_rate.rs Outdated Show resolved Hide resolved
src/fee_rate.rs Outdated Show resolved Hide resolved
src/subcommand/wallet/inscribe.rs Show resolved Hide resolved
src/subcommand/wallet/inscribe.rs Outdated Show resolved Hide resolved
src/fee_rate.rs Outdated Show resolved Hide resolved
src/fee_rate.rs Show resolved Hide resolved
src/subcommand/wallet/transaction_builder.rs Outdated Show resolved Hide resolved
src/subcommand/wallet/transaction_builder.rs Outdated Show resolved Hide resolved
tests/wallet/inscribe.rs Show resolved Hide resolved
tests/wallet/send.rs Show resolved Hide resolved
@raphjaph raphjaph requested a review from casey January 12, 2023 18:53
src/fee_rate.rs Outdated Show resolved Hide resolved
src/fee_rate.rs Outdated Show resolved Hide resolved
src/fee_rate.rs Outdated Show resolved Hide resolved
test-bitcoincore-rpc/src/server.rs Outdated Show resolved Hide resolved
@casey casey enabled auto-merge (squash) January 12, 2023 19:00
@casey casey merged commit 2e108f9 into ordinals:master Jan 12, 2023
@raphjaph raphjaph deleted the set-fee branch May 1, 2023 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants