-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implement Glueby::Wallet#tokens #196
Conversation
d6f1ac5
to
7b2e6f7
Compare
7b2e6f7
to
59aafc8
Compare
c74ce82
to
e63b484
Compare
1daf6e2
to
b5d8641
Compare
98fd968
to
74b74f4
Compare
|
||
before do | ||
allow(internal_wallet).to receive(:list_unspent).with(color_id, true) | ||
.and_return(unspents.select { |utxo| utxo[:color_id] == 'c150ad685ec8638543b2356cb1071cf834fb1c84f5fa3a71699c3ed7167dfcdbb3' }) |
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.
メモ
このテストでは、もともと list_unspent はスタブしていたが、今回のへ変更で list_unspent に color_id を指定することで、特定のcolor id の utxo だけを返すようにできるので、それを使用する想定でスタブの記述を上書きしたという事ですね。
少し理解に時間がかかったので他のレビュアーのためにメモとして残します。
@@ -261,7 +266,7 @@ def fill_uncolored_inputs( | |||
while current_amount - fee < target_amount | |||
sum, utxos = collect_uncolored_outputs( | |||
fee + target_amount - current_amount, | |||
nil, nil, true, true, | |||
nil, false, true, true, |
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.
only_finalized が nil になってたんですね、、nil でも false でも挙動は変わりませんが、boolean を想定している引数だと思うので、nil は変ですね。
This PR implements Glueby::Wallet#tokens to get token out_point(txid, index) and value.