mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 19:47:59 +00:00
Remove limitation to 256 transactions, don't construct a vector. (#2321)
* Remove limitation to 256 transactions, don't construct requires vector. * Bump impl version.
This commit is contained in:
committed by
Bastian Köcher
parent
3a87e9c8bc
commit
c2065aafd6
@@ -60,7 +60,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
impl_name: create_runtime_str!("substrate-node"),
|
||||
authoring_version: 10,
|
||||
spec_version: 62,
|
||||
impl_version: 64,
|
||||
impl_version: 65,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
};
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ use rstd::marker::PhantomData;
|
||||
use rstd::result;
|
||||
use primitives::traits::{
|
||||
self, Header, Zero, One, Checkable, Applyable, CheckEqual, OnFinalize,
|
||||
OnInitialize, As, Digest, NumberFor, Block as BlockT, OffchainWorker
|
||||
OnInitialize, Digest, NumberFor, Block as BlockT, OffchainWorker
|
||||
};
|
||||
use srml_support::{Dispatchable, traits::MakePayment};
|
||||
use parity_codec::{Codec, Encode};
|
||||
@@ -320,24 +320,23 @@ impl<
|
||||
}
|
||||
|
||||
// check index
|
||||
let mut expected_index = <system::Module<System>>::account_nonce(sender);
|
||||
let expected_index = <system::Module<System>>::account_nonce(sender);
|
||||
if index < &expected_index {
|
||||
return TransactionValidity::Invalid(ApplyError::Stale as i8)
|
||||
}
|
||||
if *index > expected_index + As::sa(256) {
|
||||
return TransactionValidity::Unknown(ApplyError::Future as i8)
|
||||
}
|
||||
|
||||
let mut deps = Vec::new();
|
||||
while expected_index < *index {
|
||||
deps.push((sender, expected_index).encode());
|
||||
expected_index = expected_index + One::one();
|
||||
}
|
||||
let index = *index;
|
||||
let provides = vec![(sender, index).encode()];
|
||||
let requires = if expected_index < index {
|
||||
vec![(sender, index - One::one()).encode()]
|
||||
} else {
|
||||
vec![]
|
||||
};
|
||||
|
||||
TransactionValidity::Valid {
|
||||
priority: encoded_len as TransactionPriority,
|
||||
requires: deps,
|
||||
provides: vec![(sender, *index).encode()],
|
||||
requires,
|
||||
provides,
|
||||
longevity: TransactionLongevity::max_value(),
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user