Skip to content

Commit

Permalink
use new logic flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ukint-vs committed Dec 1, 2023
1 parent be06b0a commit 8a37b9a
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions gclient/src/api/calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ impl GearApi {
free: 0u128,
reserved: 0,
frozen: 0,
flags: gsdk::metadata::runtime_types::pallet_balances::types::ExtraFlags(0),
flags: gsdk::metadata::runtime_types::pallet_balances::types::ExtraFlags(
170141183460469231731687303715884105728,
),
})
} else {
Err(e)
Expand All @@ -317,7 +319,9 @@ impl GearApi {
free: 0u128,
reserved: 0,
frozen: 0,
flags: gsdk::metadata::runtime_types::pallet_balances::types::ExtraFlags(0),
flags: gsdk::metadata::runtime_types::pallet_balances::types::ExtraFlags(
170141183460469231731687303715884105728,
),
})
} else {
Err(e)
Expand Down Expand Up @@ -434,9 +438,12 @@ impl GearApi {
if let Error::GearSDK(GsdkError::StorageNotFound) = e {
Ok(AccountData {
free: 0u128,
reserved: 0,
frozen: 0,
flags: gsdk::metadata::runtime_types::pallet_balances::types::ExtraFlags(0),
reserved: 0,
frozen: 0,
flags:
gsdk::metadata::runtime_types::pallet_balances::types::ExtraFlags(
170141183460469231731687303715884105728,
),
})
} else {
Err(e)
Expand Down Expand Up @@ -550,20 +557,24 @@ impl GearApi {
})
.collect();

let program_account_data = self.account_data_at(program_id, block_hash).await.or_else(
|e| {
if let Error::GearSDK(GsdkError::StorageNotFound) = e {
Ok(AccountData {
free: 0u128,
reserved: 0,
frozen: 0,
flags: gsdk::metadata::runtime_types::pallet_balances::types::ExtraFlags(0),
})
} else {
Err(e)
}
},
)?;
let program_account_data =
self.account_data_at(program_id, block_hash)
.await
.or_else(|e| {
if let Error::GearSDK(GsdkError::StorageNotFound) = e {
Ok(AccountData {
free: 0u128,
reserved: 0,
frozen: 0,
flags:
gsdk::metadata::runtime_types::pallet_balances::types::ExtraFlags(
170141183460469231731687303715884105728,
),
})
} else {
Err(e)
}
})?;

ProgramMemoryDump {
pages: program_pages,
Expand Down

0 comments on commit 8a37b9a

Please sign in to comment.