Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiloc committed Feb 5, 2025
1 parent 0f48319 commit c2bf0da
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
7 changes: 3 additions & 4 deletions docker/sbtc/signer/signer-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# [blocklist_client]
# endpoint = "http://127.0.0.1:8080"

# The delay, in milliseconds, for the retry after a blocklist client failure
# The delay, in milliseconds, for the retry after a blocklist client failure
#
# Required: false
# Environment: SIGNER_BLOCKLIST_CLIENT__RETRY_DELAY
Expand All @@ -35,11 +35,10 @@ endpoints = [
"http://testApiKey@emily-server:3031",
]

# The pagination timeout, in seconds, used to fetch deposits and withdrawals
# requests from Emily.
# The pagination timeout, in seconds, used to fetch deposits requests from Emily.
# Required: true
# Environment: SIGNER_EMILY__PAGINATION_TIMEOUT
pagination_timeout = 30
pagination_timeout = 15

# !! ==============================================================================
# !! Bitcoin Core Configuration
Expand Down
12 changes: 6 additions & 6 deletions emily/handler/tests/integration/deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ async fn get_deposits() {
}
}

let chunksize: u16 = 2;
let chunksize = 2;
// If the number of elements is an exact multiple of the chunk size the "final"
// query will still have a next token, and the next query will now have a next
// token and will return no additional data.
let expected_chunks: u16 = expected_deposit_infos.len() as u16 / chunksize + 1;
let expected_chunks = expected_deposit_infos.len() / chunksize + 1;

// Act.
// ----
Expand Down Expand Up @@ -349,13 +349,13 @@ async fn get_deposits() {

// Assert.
// -------
assert_eq!(expected_chunks, gotten_deposit_info_chunks.len() as u16);
assert_eq!(expected_chunks, gotten_deposit_info_chunks.len());
let max_chunk_size = gotten_deposit_info_chunks
.iter()
.map(|chunk| chunk.len())
.max()
.unwrap();
assert!(chunksize >= max_chunk_size as u16);
assert!(chunksize >= max_chunk_size);

let mut gotten_deposit_infos = gotten_deposit_info_chunks
.into_iter()
Expand Down Expand Up @@ -440,7 +440,7 @@ async fn get_deposits_for_recipient() {
}

// The size of the chunks to grab from the api.
let chunksize: u16 = 2;
let chunksize = 2;

// Act.
// ----
Expand All @@ -456,7 +456,7 @@ async fn get_deposits_for_recipient() {
&configuration,
recipient,
next_token.as_ref().and_then(|o| o.as_deref()),
Some(chunksize as u32),
Some(chunksize),
)
.await
.expect("Received an error after making a valid get deposits for recipient api call.");
Expand Down
8 changes: 4 additions & 4 deletions emily/handler/tests/integration/withdrawal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async fn get_withdrawals() {
// If the number of elements is an exact multiple of the chunk size the "final"
// query will still have a next token, and the next query will now have a next
// token and will return no additional data.
let expected_chunks = expected_withdrawal_infos.len() as u32 / chunksize + 1;
let expected_chunks = expected_withdrawal_infos.len() / chunksize + 1;

// Act.
// ----
Expand All @@ -157,7 +157,7 @@ async fn get_withdrawals() {
&configuration,
status,
next_token.as_ref().and_then(|o| o.as_deref()),
Some(chunksize),
Some(chunksize as u32),
)
.await
.expect("Received an error after making a valid get withdrawal api call.");
Expand All @@ -171,13 +171,13 @@ async fn get_withdrawals() {

// Assert.
// -------
assert_eq!(expected_chunks, gotten_withdrawal_info_chunks.len() as u32);
assert_eq!(expected_chunks, gotten_withdrawal_info_chunks.len());
let max_chunk_size = gotten_withdrawal_info_chunks
.iter()
.map(|chunk| chunk.len())
.max()
.unwrap();
assert!(chunksize >= max_chunk_size as u32);
assert!(chunksize >= max_chunk_size);

let mut gotten_withdrawal_infos = gotten_withdrawal_info_chunks
.into_iter()
Expand Down
13 changes: 10 additions & 3 deletions signer/src/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# [blocklist_client]
# endpoint = "http://127.0.0.1:8080"

# The delay, in milliseconds, for the retry after a blocklist client failure
# The delay, in milliseconds, for the retry after a blocklist client failure
#
# Required: false
# Environment: SIGNER_BLOCKLIST_CLIENT__RETRY_DELAY
Expand All @@ -38,8 +38,15 @@ endpoints = [
"http://testApiKey@localhost:3031",
]

# The pagination timeout, in seconds, used to fetch deposits and withdrawals
# requests from Emily.
# Maximum deposits returned per page. Responses will be limited to this
# many items. Regardless of the page_size setting, responses are always
# capped at 1 MB total size. If not set, only the 1 MB cap applies.
#
# Required: false
# Environment: SIGNER_EMILY__PAGE_SIZE
# page_size = 100

# The pagination timeout, in seconds, used to fetch deposits requests from Emily.
# Required: true
# Environment: SIGNER_EMILY__PAGINATION_TIMEOUT
pagination_timeout = 15
Expand Down

0 comments on commit c2bf0da

Please sign in to comment.