Skip to content

Commit

Permalink
fix signature name
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Apr 6, 2024
1 parent 9246a06 commit be31eba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct AccountContract;

#[contracttype]
#[derive(Clone)]
pub struct Signature {
pub struct AccSignature {
pub public_key: BytesN<32>,
pub signature: BytesN<64>,
}
Expand Down Expand Up @@ -73,7 +73,7 @@ impl AccountContract {

#[contractimpl]
impl CustomAccountInterface for AccountContract {
type Signature = Vec<Signature>;
type Signature = Vec<AccSignature>;
type Error = AccError;

// This is the 'entry point' of the account contract and every account
Expand All @@ -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<AccSignature>` 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
Expand All @@ -104,7 +104,7 @@ impl CustomAccountInterface for AccountContract {
fn __check_auth(
env: Env,
signature_payload: BytesN<32>,
signatures: Vec<Signature>,
signatures: Vec<AccSignature>,
auth_context: Vec<Context>,
) -> Result<(), AccError> {
// Perform authentication.
Expand Down Expand Up @@ -141,7 +141,7 @@ impl CustomAccountInterface for AccountContract {
fn authenticate(
env: &Env,
signature_payload: &BytesN<32>,
signatures: &Vec<Signature>,
signatures: &Vec<AccSignature>,
) -> Result<(), AccError> {
for i in 0..signatures.len() {
let signature = signatures.get_unchecked(i);
Expand Down
2 changes: 1 addition & 1 deletion account/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit be31eba

Please sign in to comment.