Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseAbram committed Oct 8, 2024
1 parent b39c69c commit aa1f1da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/threshold-signature-server/src/attestation/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub async fn attest(
let block_number =
rpc.chain_get_header(None).await?.ok_or_else(|| AttestationErr::BlockNumber)?.number;

validate_new_attest(block_number, &attestation_requests, &app_state.kv_store).await?;
validate_new_attestation(block_number, &attestation_requests, &app_state.kv_store).await?;

// Check whether there is an attestion request for us
if !attestation_requests.tss_account_ids.contains(&signer.signer().public().0) {
Expand Down
6 changes: 3 additions & 3 deletions crates/threshold-signature-server/src/attestation/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::{
attestation::api::validate_new_attest,
attestation::api::validate_new_attestation,
chain_api::{entropy, get_api, get_rpc},
helpers::{
substrate::query_chain,
Expand Down Expand Up @@ -85,7 +85,7 @@ async fn test_attest_validation_fail() {
let block_number = rpc.chain_get_header(None).await.unwrap().unwrap().number + 1;
let ocw_message = OcwMessageAttestationRequest { tss_account_ids: vec![], block_number };
let err_stale_data =
validate_new_attest(block_number, &ocw_message, &kv).await.map_err(|e| e.to_string());
validate_new_attestation(block_number, &ocw_message, &kv).await.map_err(|e| e.to_string());
assert_eq!(err_stale_data, Err("Data is stale".to_string()));
run_to_block(&rpc, block_number).await;

Expand All @@ -95,7 +95,7 @@ async fn test_attest_validation_fail() {
kv.kv().put(reservation, (block_number + 5).to_be_bytes().to_vec()).await.unwrap();

let err_repeated_data =
validate_new_attest(block_number, &ocw_message, &kv).await.map_err(|e| e.to_string());
validate_new_attestation(block_number, &ocw_message, &kv).await.map_err(|e| e.to_string());
assert_eq!(err_repeated_data, Err("Data is repeated".to_string()));
clean_tests();
}

0 comments on commit aa1f1da

Please sign in to comment.