From be31eba58f34a8ac4b6d1dd04752e60e36c844ea Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Sat, 6 Apr 2024 10:57:01 +1000 Subject: [PATCH] fix signature name --- account/src/lib.rs | 10 +++++----- account/src/test.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/account/src/lib.rs b/account/src/lib.rs index 7b95491b..c334f98a 100644 --- a/account/src/lib.rs +++ b/account/src/lib.rs @@ -16,7 +16,7 @@ struct AccountContract; #[contracttype] #[derive(Clone)] -pub struct Signature { +pub struct AccSignature { pub public_key: BytesN<32>, pub signature: BytesN<64>, } @@ -73,7 +73,7 @@ impl AccountContract { #[contractimpl] impl CustomAccountInterface for AccountContract { - type Signature = Vec; + type Signature = Vec; type Error = AccError; // This is the 'entry point' of the account contract and every account @@ -85,7 +85,7 @@ impl CustomAccountInterface for AccountContract { // been passed and return an error (or panic) otherwise. // // `__check_auth` takes the payload that needed to be signed, arbitrarily - // typed signatures (`Signature` contract type here) and authorization + // typed signatures (`Vec` contract type here) and authorization // context that contains all the invocations that this call tries to verify. // // `__check_auth` has to authenticate the signatures. It also may use @@ -104,7 +104,7 @@ impl CustomAccountInterface for AccountContract { fn __check_auth( env: Env, signature_payload: BytesN<32>, - signatures: Vec, + signatures: Vec, auth_context: Vec, ) -> Result<(), AccError> { // Perform authentication. @@ -141,7 +141,7 @@ impl CustomAccountInterface for AccountContract { fn authenticate( env: &Env, signature_payload: &BytesN<32>, - signatures: &Vec, + signatures: &Vec, ) -> Result<(), AccError> { for i in 0..signatures.len() { let signature = signatures.get_unchecked(i); diff --git a/account/src/test.rs b/account/src/test.rs index 58878817..eb7a1f60 100644 --- a/account/src/test.rs +++ b/account/src/test.rs @@ -30,7 +30,7 @@ fn create_account_contract(e: &Env) -> AccountContractClient { } fn sign(e: &Env, signer: &Keypair, payload: &BytesN<32>) -> Val { - Signature { + AccSignature { public_key: signer_public_key(e, signer), signature: signer .sign(payload.to_array().as_slice())