mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 01:47:55 +00:00
tests: Ensure correct signing of extrinsics larger than 256 bytes (#797)
* tests: Ensure correct signing of extrinsics larger than 256 bytes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Use `vec!` macro for blob creation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> 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![0_u8; 2 * 1024 * 1024];
|
||||
// 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]
|
||||
async fn unsigned_extrinsic_is_same_shape_as_polkadotjs() {
|
||||
let ctx = test_context().await;
|
||||
|
||||
Reference in New Issue
Block a user