Merge branch 'master' into aj/update-substrate-crates

This commit is contained in:
Andrew Jones
2022-11-14 11:45:57 +00:00
24 changed files with 168 additions and 76 deletions
@@ -101,12 +101,12 @@ async fn tx_dynamic_transfer() -> Result<(), subxt::Error> {
let alice_account_addr = subxt::dynamic::storage(
"System",
"Account",
vec![Value::from_bytes(&alice.account_id())],
vec![Value::from_bytes(alice.account_id())],
);
let bob_account_addr = subxt::dynamic::storage(
"System",
"Account",
vec![Value::from_bytes(&bob.account_id())],
vec![Value::from_bytes(bob.account_id())],
);
let alice_pre = api
@@ -122,7 +122,7 @@ async fn tx_dynamic_transfer() -> Result<(), subxt::Error> {
"Balances",
"transfer",
vec![
Value::unnamed_variant("Id", vec![Value::from_bytes(&bob.account_id())]),
Value::unnamed_variant("Id", vec![Value::from_bytes(bob.account_id())]),
Value::u128(10_000u128),
],
);
@@ -145,11 +145,11 @@ async fn tx_dynamic_transfer() -> Result<(), subxt::Error> {
let expected_fields = Composite::Named(vec![
(
"from".into(),
Value::unnamed_composite(vec![Value::from_bytes(&alice.account_id())]),
Value::unnamed_composite(vec![Value::from_bytes(alice.account_id())]),
),
(
"to".into(),
Value::unnamed_composite(vec![Value::from_bytes(&bob.account_id())]),
Value::unnamed_composite(vec![Value::from_bytes(bob.account_id())]),
),
("amount".into(), Value::u128(10_000)),
]);
@@ -242,7 +242,7 @@ async fn storage_current_era() -> Result<(), Error> {
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 reward_points_addr = node_runtime::storage().staking().eras_reward_points(0);
let current_era_result = api.storage().fetch(&reward_points_addr, None).await;
assert!(current_era_result.is_ok());
+1 -1
View File
@@ -72,7 +72,7 @@ async fn storage_n_mapish_key_is_properly_created() -> Result<(), subxt::Error>
bytes.extend(&sp_core::twox_128("KeyOwner".as_bytes())[..]);
// twox64_concat a *tuple* of the args expected:
let suffix = (KeyTypeId([1, 2, 3, 4]), vec![5u8, 6, 7, 8]).encode();
bytes.extend(&sp_core::twox_64(&suffix));
bytes.extend(sp_core::twox_64(&suffix));
bytes.extend(&suffix);
bytes
};