Add/Clarify comments (#187)

This commit is contained in:
Ryo Onodera 2021-02-26 21:48:44 +09:00 committed by GitHub
parent 69b7d3e99e
commit 2ba9381066
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -318,6 +318,7 @@ impl Bridge {
return Err(ProgramError::InvalidArgument);
}
// Prepare message/payload-specific sig_info account
if sig_info.data_is_empty() {
let bridge_key = Bridge::derive_bridge_id(program_id)?;
let sig_seeds =
@ -351,7 +352,7 @@ impl Bridge {
sig_state.hash = payload.hash;
}
// Check addresses
// Write sigs of checked addresses into sig_state
for s in sig_infos {
if s.signer_index > guardian_set.len_keys {
return Err(ProgramError::InvalidArgument);
@ -367,6 +368,7 @@ impl Bridge {
return Err(ProgramError::InvalidArgument);
}
// Overwritten content should be zeros except double signs by the signer or harmless replays
sig_state.signatures[s.signer_index as usize]
.copy_from_slice(secp_ixs[s.sig_index as usize].signature);
}