Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
refactor: Rename seqeunce_of to sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
code0xff committed Sep 12, 2024
1 parent 98a402a commit 4c9d0ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frame/cosmos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ impl<T: Config> Pallet<T> {

// In the context of the pool, a transaction with
// too high a nonce is still considered valid
if transaction_nonce > Self::sequence_of(&origin) {
if transaction_nonce > Self::sequence(&origin) {
if let Some(prev_nonce) = transaction_nonce.checked_sub(1) {
builder = builder.and_requires((origin, prev_nonce))
}
Expand Down Expand Up @@ -498,7 +498,7 @@ impl<T: Config> Pallet<T> {
})
}

pub fn sequence_of(address: &H160) -> u64 {
pub fn sequence(address: &H160) -> u64 {
let account_id = T::AddressMapping::into_account_id(*address);
frame_system::Pallet::<T>::account_nonce(&account_id).saturated_into()
}
Expand Down
2 changes: 1 addition & 1 deletion frame/cosmos/x/auth/src/sigverify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ where
}

let sequence =
pallet_cosmos::Pallet::<T>::sequence_of(&H160::from_slice(&signer_addr_raw));
pallet_cosmos::Pallet::<T>::sequence(&H160::from_slice(&signer_addr_raw));
if signer_info.sequence > sequence {
return Err(TransactionValidityError::Invalid(InvalidTransaction::Future));
} else if signer_info.sequence < sequence {
Expand Down

0 comments on commit 4c9d0ec

Please sign in to comment.