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

feat: allow sending sat #3200

Merged
merged 22 commits into from
Mar 22, 2024
Merged

Conversation

bingryan
Copy link
Contributor

Description

add send sat

ord --index-sats wallet send --fee-rate 1 <ADDRESS> <SAT>

Related Issue

Related #3117

Code Review Request

use: let satpoint = wallet.find_sat_in_outputs(sat)?; input sat and get satpoint,
and then call create_unsigned_send_satpoint_transaction but with sending_inscription=true,

@bingryan
Copy link
Contributor Author

@casey @raphjaph code review, plz :)

Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

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

Looks good so far. This definitely needs an integration test in tests/wallet/send.rs

@@ -66,6 +66,14 @@ impl Send {
self.fee_rate,
false,
)?,
Outgoing::Sat(sat) => Self::create_unsigned_send_sat_transaction(
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could probably just use the send_satpoint function and call wallet.find_sat_in_outputs(sat)? directly in the function arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice tips

@bingryan
Copy link
Contributor Author

bingryan commented Mar 6, 2024

@raphjaph code review, plz ~

@bingryan bingryan requested a review from raphjaph March 6, 2024 21:09
tests/wallet/send.rs Outdated Show resolved Hide resolved
src/outgoing.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

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

Getting there, just some small points. Test is also still failing I think.

@bingryan
Copy link
Contributor Author

ord git:(feat/allow-send-sat) cargo test send_inscription_by_sat                                                                                            git:(feat/allow-send-sat|)
    Finished test [unoptimized + debuginfo] target(s) in 0.50s
     Running unittests src/lib.rs (target/debug/deps/ord-0d4fe9b518998753)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 666 filtered out; finished in 0.00s

     Running unittests src/bin/main.rs (target/debug/deps/ord-9e65a5af59a3acca)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/lib.rs (target/debug/deps/integration-93716b75a14687f2)

running 1 test
test wallet::send::send_inscription_by_sat ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 223 filtered out; finished in 0.78s

@raphjaph
Copy link
Collaborator

Could you merge in the latest changes?

Also try running all tests with cargo test --all

@bingryan
Copy link
Contributor Author

@raphjaph All checks have passed, sometime not pass is Fix flaky tests: #3133

@raphjaph raphjaph linked an issue Mar 18, 2024 that may be closed by this pull request
@raphjaph
Copy link
Collaborator

I think the tests are still failing for normal reasons, not flaky reasons

@bingryan
Copy link
Contributor Author

sc

@bingryan
Copy link
Contributor Author

@raphjaph I'm sorry. I made a mistake by using the first sat after sorting the results returned by "ord wallet sat" as the subscribed inscription's sat

Copy link
Collaborator

@raphjaph raphjaph left a comment

Choose a reason for hiding this comment

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

Looks good!

@raphjaph raphjaph merged commit b6620c2 into ordinals:master Mar 22, 2024
5 checks passed
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.

Allow sending sat
2 participants