mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 18:31:05 +00:00
tests: Ensure correct signing of extrinsics larger than 256 bytes
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -234,6 +234,33 @@ async fn dry_run_fails() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn submit_large_extrinsic() {
|
||||||
|
let ctx = test_context().await;
|
||||||
|
let api = ctx.client();
|
||||||
|
|
||||||
|
let alice = pair_signer(AccountKeyring::Alice.pair());
|
||||||
|
|
||||||
|
// 2 MiB blob of data.
|
||||||
|
let bytes: Vec<u8> = (0..2 * 1024 * 1024).map(|i: u32| i as u8).collect();
|
||||||
|
// The preimage pallet allows storing and managing large byte-blobs.
|
||||||
|
let tx = node_runtime::tx().preimage().note_preimage(bytes);
|
||||||
|
|
||||||
|
let signed_extrinsic = api
|
||||||
|
.tx()
|
||||||
|
.create_signed(&tx, &alice, Default::default())
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
signed_extrinsic
|
||||||
|
.submit_and_watch()
|
||||||
|
.await
|
||||||
|
.unwrap()
|
||||||
|
.wait_for_finalized_success()
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn unsigned_extrinsic_is_same_shape_as_polkadotjs() {
|
async fn unsigned_extrinsic_is_same_shape_as_polkadotjs() {
|
||||||
let ctx = test_context().await;
|
let ctx = test_context().await;
|
||||||
|
|||||||
Reference in New Issue
Block a user