Skip to content

Commit

Permalink
Merge pull request #1167 from soramitsu/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
PankraSerg authored Jun 13, 2024
2 parents a29947b + e3aa645 commit aff0cb4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ apply plugin: "org.sonarqube"
buildscript {
ext {
// App version
versionName = '3.5.3'
versionCode = 184
versionName = '3.5.5'
versionCode = 186

// SDK and tools
compileSdkVersion = 34
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class StakingRelayChainScenarioRepository(
chainId: ChainId,
accountIdsHex: List<String>
): AccountIdMap<ValidatorPrefs?> {
return localStorage.queryKeys(
return remoteStorage.queryKeys(
keysBuilder = { runtime ->
val storage = runtime.metadata.stakingOrNull()?.storage("Validators")
?: return@queryKeys emptyMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class ExistentialDepositUseCaseImpl(
val chainId = chainAsset.chainId

val existentialDepositResult = kotlin.runCatching {
val runtime = chainRegistry.getRuntime(chainId)
val runtime = chainRegistry.getRuntimeOrNull(chainId)
?: return@runCatching BigInteger.ZERO

when (chainAsset.typeExtra) {
null,
ChainAssetType.Normal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class WssSubstrateSource(
ChainAssetType.Token2,
ChainAssetType.AssetId,
ChainAssetType.Xcm,
ChainAssetType.Stable -> ormlAssetTransfer(accountId, transfer)
ChainAssetType.Stable -> ormlAssetTransfer(accountId, transfer, typeRegistry)

ChainAssetType.Equilibrium -> equilibriumAssetTransfer(accountId, transfer)

Expand Down Expand Up @@ -356,16 +356,28 @@ class WssSubstrateSource(

private fun ExtrinsicBuilder.ormlAssetTransfer(
accountId: AccountId,
transfer: Transfer
) = call(
moduleName = Modules.CURRENCIES,
callName = "transfer",
arguments = mapOf(
"dest" to DictEnum.Entry("Id", accountId),
"currency_id" to transfer.chainAsset.currency,
"amount" to transfer.amountInPlanks
transfer: Transfer,
typeRegistry: TypeRegistry
): ExtrinsicBuilder {
@Suppress("IMPLICIT_CAST_TO_ANY")
val dest = when (typeRegistry["Address"]) {
is FixedByteArray -> accountId // asset type 'assetId'
else -> DictEnum.Entry(
name = "Id",
value = accountId
)
}

return call(
moduleName = Modules.CURRENCIES,
callName = "transfer",
arguments = mapOf(
"dest" to dest,
"currency_id" to transfer.chainAsset.currency,
"amount" to transfer.amountInPlanks
)
)
)
}

private fun ExtrinsicBuilder.soraAssetTransfer(
accountId: AccountId,
Expand Down

0 comments on commit aff0cb4

Please sign in to comment.