-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat(client): add async and blocking clients to submit txs package #114
base: master
Are you sure you want to change the base?
feat(client): add async and blocking clients to submit txs package #114
Conversation
src/api.rs
Outdated
|
||
#[derive(Deserialize, Debug)] | ||
pub struct MempoolFeesSubmitPackage { | ||
pub base: f64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is base
here?
Can you leave a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, let just some nits. can confirm that the calls match the endpoint added in my pr on esplora (Blockstream/electrs#119)
6a22216
to
01fb9c9
Compare
Pull Request Test Coverage Report for Build 12930470174Details
💛 - Coveralls |
Cargo.toml
Outdated
@@ -18,6 +18,7 @@ path = "src/lib.rs" | |||
|
|||
[dependencies] | |||
serde = { version = "1.0", features = ["derive"] } | |||
serde_json = "1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we disable default features here and only enable the features we actually need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/api.rs
Outdated
|
||
#[derive(Deserialize, Debug)] | ||
pub struct TxResult { | ||
pub txid: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's deserialize these into actual types, not String
everywhere (see https://github.com/rust-bitcoin/corepc/blob/b62e8c84e3271e57b10849d27191c0357711660b/types/src/model/raw_transactions.rs#L17-L58 for examples).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated. I also added the same comments on the fields as the ones in rust-bitcoin
src/async.rs
Outdated
/// if `maxburnamount` is provided, any transaction | ||
/// with higher provably unspendable outputs amount | ||
/// will be rejected | ||
pub async fn broadcast_package( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets call this submit_package
to avoid introducing a new separate terminology?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
01fb9c9
to
a5322c6
Compare
pub struct SubmitPackageResult { | ||
/// The transaction package result message. "success" indicates all transactions were accepted | ||
/// into or are already in the mempool. | ||
pub package_msg: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know if the variants here are finite? Do we see a chance to parse this into an enum
?
Counterpart PR for Blockstream/electrs#119 to enable submitpackage API