-
Notifications
You must be signed in to change notification settings - Fork 18
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: create complete-deposit
sign requests
#615
Conversation
complete-deposit
transactions
complete-deposit
transactionscomplete-deposit
sign requests
// deposit requests, so we do not need to specify the signer set. | ||
let test_params = crate::testing::storage::model::Params { | ||
num_bitcoin_blocks: 10, | ||
num_stacks_blocks_per_bitcoin_block: 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.
nit/question: num_stacks_blocks_per_bitcoin_block: 0
was confusing at the beginning, then I saw that we always include at least one stacks block in test data generate_stacks_blocks
. To avoid surprises, should we validate num_stacks_blocks_per_bitcoin_block > 0
or avoid creating a stacks block if the param is zero?
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.
I think it creates zero stacks blocks. I might be missing something, why do you think it creates one block?
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.
sbtc/signer/src/testing/storage/model.rs
Line 309 in 5073358
let stacks_blocks = (1..num_stacks_blocks).fold(vec![stacks_block], |mut blocks, _| { |
It seems to always push at least one block
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.
Ahh, I believe (1..0)
is an empty range.
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.
it seems to be still considering the initial value though:
# dbg!((1..0).fold(vec![1], |a, _| a));
[src/main.rs:5:5] (1..0).fold(vec![1], |a, _| a) = [
1,
]
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.
Oh, right, well that settles it. My mistake!
Also, I did not take in the confusing part about this test, which is that I use Stacks blocks but ask for zero stacks blocks to be generated. I'll fix this in another PR.
To avoid surprises, should we validate
num_stacks_blocks_per_bitcoin_block > 0
or avoid creating a stacks block if the param is zero?
I would think that we should avoid creating Stacks blocks if we ask for zero. For this code, I should probably just update the number of stacks blocks that are needed to avoid confusion. I'll make sure that it is added in.
transaction object
transaction coordinator event loop
for missing bitcoin transactions
from the database
loading a wallet from the database.
are still more to remove but they need more prep
of information from the database
fields from the SweptDepositRequest struct
40100f8
to
70da07f
Compare
Created ticket to track the lack of integration tests here: #631 |
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.
Other than the mentioned issues in the PR description (and the two missing nits), LGTM.
About Properly construct a sign deposit request transaction.
mentioned in the testing information, what are you referring to?
I should change the wording here, I think the full sentence is something like: "test that we properly create a sign-deposit-request-transaction object" or something like that. |
Description
Closes #563.
Changes
TxSignerEventLoop
andTxCoordinatorEventLoop
. We can remove the private key field too but it's better to move that into the wallet so I left it as is for now.RotateKeysV1
transaction object.SignerWallet
from the database.There is still some outstanding work here:
Rename theDone.Fulfilled*Request
structs (the requests are only partly fulfilled). Name suggestions are welcome.Fix-up the documentation on theDone.Fulfilled*Request
structs.Any other name suggestions are welcome.No need, unless they're really really good.Testing Information
This PR has tests for the function that loads from the database, but is missing:
Edit: We have some tests for (2) now, but a full suite of tests require #585 and for us to modify the query included here.
Checklist: