mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 02:57:57 +00:00
Add block-centric Storage API (#774)
* blocks: Add storage method Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Add support for runtime API calls and expose it to the blocks API Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * storage: Add storage type for block centric API Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Adjust subxt to the new Storage interface Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Fix clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -150,7 +150,13 @@ async fn chill_works_for_controller_only() -> Result<(), Error> {
|
||||
.await?;
|
||||
|
||||
let ledger_addr = node_runtime::storage().staking().ledger(alice.account_id());
|
||||
let ledger = api.storage().fetch(&ledger_addr, None).await?.unwrap();
|
||||
let ledger = api
|
||||
.storage()
|
||||
.at(None)
|
||||
.await?
|
||||
.fetch(&ledger_addr)
|
||||
.await?
|
||||
.unwrap();
|
||||
assert_eq!(alice_stash.account_id(), &ledger.stash);
|
||||
|
||||
let chill_tx = node_runtime::tx().staking().chill();
|
||||
@@ -232,7 +238,9 @@ async fn storage_current_era() -> Result<(), Error> {
|
||||
let current_era_addr = node_runtime::storage().staking().current_era();
|
||||
let _current_era = api
|
||||
.storage()
|
||||
.fetch(¤t_era_addr, None)
|
||||
.at(None)
|
||||
.await?
|
||||
.fetch(¤t_era_addr)
|
||||
.await?
|
||||
.expect("current era always exists");
|
||||
Ok(())
|
||||
@@ -243,7 +251,12 @@ async fn storage_era_reward_points() -> Result<(), Error> {
|
||||
let ctx = test_context().await;
|
||||
let api = ctx.client();
|
||||
let reward_points_addr = node_runtime::storage().staking().eras_reward_points(0);
|
||||
let current_era_result = api.storage().fetch(&reward_points_addr, None).await;
|
||||
let current_era_result = api
|
||||
.storage()
|
||||
.at(None)
|
||||
.await?
|
||||
.fetch(&reward_points_addr)
|
||||
.await;
|
||||
assert!(current_era_result.is_ok());
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user