-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing: Prepare light client testing with substrate binary and add subxt-test macro #1507
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
34e9222
testing: Add long running light client flag and cfg aliases
lexnv 518aa8e
testing: Expose clients depending on feature flags
lexnv ea6f3cc
subxt: Use unstable backend for light client
lexnv ca36ef6
testing: Disable flaky lightclient tests
lexnv 8fe7e86
ci: Add long runnnig step
lexnv 593fbeb
Revert "subxt: Use unstable backend for light client"
lexnv 1fc1bb4
ci: Long running tests for 60 mins
lexnv ca60c31
ci: Use 16 cores for light-client testing
lexnv 3c58c5e
ci: Isolate light-client testing to save CI minutes
lexnv 0248343
testing: Retry on Tx::Dropped for lightclinet only
lexnv 8400a0e
testing: Wait for more blocks for the lightclient init
lexnv d671664
subxt: Use unstable backend for light client
lexnv 318ba5c
testing: Disable legacy RPC tests
lexnv 1a6f1af
testing: Disable sudo and contracts tests
lexnv 332fa72
testing: Retry constructing lightclient on read-proof errors
lexnv 88ccc54
testing: Disable tx dynamic test
lexnv b6c98c7
proc-macro: Timeout for tests
lexnv 20e75bc
testing: Add timeout 800 seconds
lexnv c5c7972
proc-macro/tests: Adjust subxt-test proc-macro
lexnv d3923c8
proc-macro: Rename crate to subxt-test-proc-macro
lexnv 1a64750
Use default subxt-proc-macro timeout
lexnv 4c3226e
light-client: Remove println
lexnv fbe2a74
subxt: Remove tokio as dependency, use it only for testing
lexnv 30073d3
testing: Chagne default timeout to 6 seconds
lexnv aa55cea
proc-macro: Add env timeout variable
lexnv 09277fe
ci: Add subxt env var for controling test timeouts
lexnv 5039f1c
tests/tx-retries: Retry on `Non node available` error
lexnv 410aaed
Merge remote-tracking branch 'origin/master' into lenxv/light-client-…
lexnv d81c70c
testing: Use unstable backend for testing lightclient
lexnv 00c4b78
testing: Remove old lightclient object
lexnv 03da904
testing: Adjust for the new interface
lexnv 292f971
backend/rpc: Allow older version of the initialized event
lexnv 2bc8947
rpc/tests: Check initialized decodes correctly
lexnv 811f70c
ci: Reset workflow
lexnv 2bb8acb
Apply cargo fmt
lexnv 1fdd734
Remove unused dep
lexnv 1bc6eb9
Merge remote-tracking branch 'origin/master' into lexnv/light-client-…
lexnv 5692703
Remove gitmerge old file
lexnv fd47be1
Remove unused dep
lexnv be4b34c
rename proc-macro to subxt-test-macro
lexnv 7270da8
tests: Remove txretries for lightclient
lexnv a62ceb7
tests: Wait for 5 blocks for the lightclient full testing suite
lexnv 7664b56
tests: Group imports
lexnv 510578f
macro: Rename const value
lexnv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use cfg_aliases::cfg_aliases; | ||
|
||
fn main() { | ||
// Setup cfg aliases | ||
cfg_aliases! { | ||
lightclient: { any(feature = "unstable-light-client", feature = "unstable-light-client-long-running") }, | ||
fullclient: { all(not(feature = "unstable-light-client"), not(feature = "unstable-light-client-long-running")) }, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,29 @@ | |
// This file is dual-licensed as Apache-2.0 or GPL-3.0. | ||
// see LICENSE for license details. | ||
|
||
use crate::{test_context, utils::node_runtime}; | ||
use crate::{subxt_test, test_context}; | ||
use codec::{Compact, Encode}; | ||
use futures::StreamExt; | ||
use subxt::config::signed_extensions::{ChargeAssetTxPayment, CheckMortality, CheckNonce}; | ||
use subxt::config::DefaultExtrinsicParamsBuilder; | ||
use subxt::config::SubstrateConfig; | ||
use subxt::utils::Era; | ||
use subxt_metadata::Metadata; | ||
|
||
#[cfg(fullclient)] | ||
use crate::utils::node_runtime; | ||
|
||
#[cfg(fullclient)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it possible to merge the use stuff to avoid repeating |
||
use subxt::{ | ||
config::{ | ||
signed_extensions::{ChargeAssetTxPayment, CheckMortality, CheckNonce}, | ||
DefaultExtrinsicParamsBuilder, SubstrateConfig, | ||
}, | ||
utils::Era, | ||
}; | ||
|
||
#[cfg(fullclient)] | ||
use subxt_signer::sr25519::dev; | ||
|
||
#[tokio::test] | ||
use subxt_metadata::Metadata; | ||
|
||
#[cfg(fullclient)] | ||
#[subxt_test] | ||
async fn block_subscriptions_are_consistent_with_eachother() -> Result<(), subxt::Error> { | ||
let ctx = test_context().await; | ||
let api = ctx.client(); | ||
|
@@ -76,7 +88,7 @@ async fn block_subscriptions_are_consistent_with_eachother() -> Result<(), subxt | |
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
#[subxt_test] | ||
async fn finalized_headers_subscription() -> Result<(), subxt::Error> { | ||
let ctx = test_context().await; | ||
let api = ctx.client(); | ||
|
@@ -93,7 +105,7 @@ async fn finalized_headers_subscription() -> Result<(), subxt::Error> { | |
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
#[subxt_test] | ||
async fn missing_block_headers_will_be_filled_in() -> Result<(), subxt::Error> { | ||
use subxt::backend::legacy; | ||
|
||
|
@@ -138,7 +150,7 @@ async fn missing_block_headers_will_be_filled_in() -> Result<(), subxt::Error> { | |
} | ||
|
||
// Check that we can subscribe to non-finalized blocks. | ||
#[tokio::test] | ||
#[subxt_test] | ||
async fn runtime_api_call() -> Result<(), subxt::Error> { | ||
let ctx = test_context().await; | ||
let api = ctx.client(); | ||
|
@@ -163,7 +175,8 @@ async fn runtime_api_call() -> Result<(), subxt::Error> { | |
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
#[cfg(fullclient)] | ||
#[subxt_test] | ||
async fn fetch_block_and_decode_extrinsic_details() { | ||
let ctx = test_context().await; | ||
let api = ctx.client(); | ||
|
@@ -232,7 +245,8 @@ async fn fetch_block_and_decode_extrinsic_details() { | |
assert!(tx.is_signed()); | ||
} | ||
|
||
#[tokio::test] | ||
#[cfg(fullclient)] | ||
#[subxt_test] | ||
async fn decode_signed_extensions_from_blocks() { | ||
let ctx = test_context().await; | ||
let api = ctx.client(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slightly weird comment; we could actually throw an error if both
finalized_block_hash
andfinalized_block_hashes
.now, we checking
finalized_block_hashes
first and if that doesn't exist we fallback tofinalized_block_hash
which is probably fine but if one inserts both by accident it lead to confusing scenarios but fine :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this only exists until we update smoldot :)