There was an error while loading. Please reload this page.
1 parent e731e38 commit e975ea7Copy full SHA for e975ea7
1 file changed
lib/authorization.rs
@@ -105,6 +105,18 @@ pub fn get_address(verifying_key: &VerifyingKey) -> Address {
105
pub fn verify_authorized_transaction(
106
transaction: &AuthorizedTransaction,
107
) -> Result<(), Error> {
108
+ let verifications_required = &transaction.transaction.inputs.len();
109
+ match transaction
110
+ .authorizations
111
+ .len()
112
+ .cmp(verifications_required)
113
+ {
114
+ std::cmp::Ordering::Less => return Err(Error::NotEnoughAuthorizations),
115
+ std::cmp::Ordering::Equal => (),
116
+ std::cmp::Ordering::Greater => {
117
+ return Err(Error::TooManyAuthorizations);
118
+ }
119
120
let tx_bytes_canonical = borsh::to_vec(&transaction.transaction)?;
121
let messages: Vec<_> = std::iter::repeat_n(
122
tx_bytes_canonical.as_slice(),
0 commit comments