Merge remote-tracking branch 'origin/master' into lexnv/metadata_v15

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-04-13 20:13:39 +03:00
30 changed files with 631 additions and 314 deletions
+7 -7
View File
@@ -1,6 +1,6 @@
[package]
name = "integration-tests"
version = "0.27.1"
version = "0.28.0"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
@@ -23,13 +23,13 @@ futures = "0.3.27"
hex = "0.4.3"
regex = "1.7.3"
scale-info = { version = "2.5.0", features = ["bit-vec"] }
sp-core = { version = "18.0.0", default-features = false }
sp-runtime = "20.0.0"
sp-keyring = "20.0.0"
sp-core = { version = "20.0.0", default-features = false }
sp-runtime = "23.0.0"
sp-keyring = "23.0.0"
syn = "1.0.109"
subxt = { version = "0.27.1", path = "../../subxt" }
subxt-codegen = { version = "0.27.1", path = "../../codegen" }
subxt-metadata = { version = "0.27.1", path = "../../metadata" }
subxt = { version = "0.28.0", path = "../../subxt" }
subxt-codegen = { version = "0.28.0", path = "../../codegen" }
subxt-metadata = { version = "0.28.0", path = "../../metadata" }
test-runtime = { path = "../test-runtime" }
tokio = { version = "1.27", features = ["macros", "time"] }
tracing = "0.1.34"
+2 -2
View File
@@ -111,7 +111,7 @@ async fn fetch_keys() {
let addr = node_runtime::storage().system().account_root();
let keys = api
.storage()
.at(None)
.at_latest()
.await
.unwrap()
.fetch_keys(&addr.to_root_bytes(), 4, None)
@@ -128,7 +128,7 @@ async fn test_iter() {
let addr = node_runtime::storage().system().account_root();
let mut iter = api
.storage()
.at(None)
.at_latest()
.await
.unwrap()
.iter(addr, 10)
+12 -12
View File
@@ -27,13 +27,13 @@ async fn tx_basic_transfer() -> Result<(), subxt::Error> {
let alice_pre = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&alice_account_addr)
.await?;
let bob_pre = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&bob_account_addr)
.await?;
@@ -64,13 +64,13 @@ async fn tx_basic_transfer() -> Result<(), subxt::Error> {
let alice_post = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&alice_account_addr)
.await?;
let bob_post = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&bob_account_addr)
.await?;
@@ -102,13 +102,13 @@ async fn tx_dynamic_transfer() -> Result<(), subxt::Error> {
let alice_pre = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&alice_account_addr)
.await?;
let bob_pre = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&bob_account_addr)
.await?;
@@ -152,13 +152,13 @@ async fn tx_dynamic_transfer() -> Result<(), subxt::Error> {
let alice_post = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&alice_account_addr)
.await?;
let bob_post = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&bob_account_addr)
.await?;
@@ -211,7 +211,7 @@ async fn multiple_transfers_work_nonce_incremented() -> Result<(), subxt::Error>
let bob_pre = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&bob_account_addr)
.await?;
@@ -231,7 +231,7 @@ async fn multiple_transfers_work_nonce_incremented() -> Result<(), subxt::Error>
let bob_post = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&bob_account_addr)
.await?;
@@ -248,7 +248,7 @@ async fn storage_total_issuance() {
let addr = node_runtime::storage().balances().total_issuance();
let total_issuance = api
.storage()
.at(None)
.at_latest()
.await
.unwrap()
.fetch_or_default(&addr)
@@ -283,7 +283,7 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> {
let locks = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&locks_addr)
.await?;
@@ -212,7 +212,7 @@ async fn tx_call() {
let contract_info = cxt
.client()
.storage()
.at(None)
.at_latest()
.await
.unwrap()
.fetch(&info_addr)
@@ -222,7 +222,7 @@ async fn tx_call() {
let keys = cxt
.client()
.storage()
.at(None)
.at_latest()
.await
.unwrap()
.fetch_keys(&info_addr_bytes, 10, None)
@@ -146,7 +146,7 @@ async fn chill_works_for_controller_only() -> Result<(), Error> {
let ledger_addr = node_runtime::storage().staking().ledger(alice.account_id());
let ledger = api
.storage()
.at(None)
.at_latest()
.await?
.fetch(&ledger_addr)
.await?
@@ -234,7 +234,7 @@ async fn storage_current_era() -> Result<(), Error> {
let current_era_addr = node_runtime::storage().staking().current_era();
let _current_era = api
.storage()
.at(None)
.at_latest()
.await?
.fetch(&current_era_addr)
.await?
@@ -249,7 +249,7 @@ async fn storage_era_reward_points() -> Result<(), Error> {
let reward_points_addr = node_runtime::storage().staking().eras_reward_points(0);
let current_era_result = api
.storage()
.at(None)
.at_latest()
.await?
.fetch(&reward_points_addr)
.await;
@@ -20,7 +20,7 @@ async fn storage_account() -> Result<(), subxt::Error> {
let account_info = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&account_info_addr)
.await;
@@ -11,7 +11,7 @@ async fn storage_get_current_timestamp() {
let timestamp = api
.storage()
.at(None)
.at_latest()
.await
.unwrap()
.fetch(&node_runtime::storage().timestamp().now())
+3 -3
View File
@@ -18,7 +18,7 @@ async fn storage_plain_lookup() -> Result<(), subxt::Error> {
let addr = node_runtime::storage().timestamp().now();
let entry = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&addr)
.await?;
@@ -47,7 +47,7 @@ async fn storage_map_lookup() -> Result<(), subxt::Error> {
let nonce_addr = node_runtime::storage().system().account(alice);
let entry = api
.storage()
.at(None)
.at_latest()
.await?
.fetch_or_default(&nonce_addr)
.await?;
@@ -121,7 +121,7 @@ async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error> {
// The actual test; look up this approval in storage:
let addr = node_runtime::storage().assets().approvals(99, alice, bob);
let entry = api.storage().at(None).await?.fetch(&addr).await?;
let entry = api.storage().at_latest().await?.fetch(&addr).await?;
assert_eq!(entry.map(|a| a.amount), Some(123));
Ok(())
}