mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 01:41:09 +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"),
|
impl_name: create_runtime_str!("substrate-node"),
|
||||||
authoring_version: 10,
|
authoring_version: 10,
|
||||||
spec_version: 62,
|
spec_version: 62,
|
||||||
impl_version: 64,
|
impl_version: 65,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ use rstd::marker::PhantomData;
|
|||||||
use rstd::result;
|
use rstd::result;
|
||||||
use primitives::traits::{
|
use primitives::traits::{
|
||||||
self, Header, Zero, One, Checkable, Applyable, CheckEqual, OnFinalize,
|
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 srml_support::{Dispatchable, traits::MakePayment};
|
||||||
use parity_codec::{Codec, Encode};
|
use parity_codec::{Codec, Encode};
|
||||||
@@ -320,24 +320,23 @@ impl<
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check index
|
// 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 {
|
if index < &expected_index {
|
||||||
return TransactionValidity::Invalid(ApplyError::Stale as i8)
|
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();
|
let index = *index;
|
||||||
while expected_index < *index {
|
let provides = vec![(sender, index).encode()];
|
||||||
deps.push((sender, expected_index).encode());
|
let requires = if expected_index < index {
|
||||||
expected_index = expected_index + One::one();
|
vec![(sender, index - One::one()).encode()]
|
||||||
}
|
} else {
|
||||||
|
vec![]
|
||||||
|
};
|
||||||
|
|
||||||
TransactionValidity::Valid {
|
TransactionValidity::Valid {
|
||||||
priority: encoded_len as TransactionPriority,
|
priority: encoded_len as TransactionPriority,
|
||||||
requires: deps,
|
requires,
|
||||||
provides: vec![(sender, *index).encode()],
|
provides,
|
||||||
longevity: TransactionLongevity::max_value(),
|
longevity: TransactionLongevity::max_value(),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user