mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-04-22 05:38:02 +00:00
Prepare for Play Store release: simplify dashboard, clean debug logs
- Simplify dashboard card: remove referral/staking/perwerde fields (not yet on-chain), keep roles + trust score + action button - Remove all debug Log.d/e/w calls added during development (PEZ_STAKE, RuntimeFactory, ExtrinsicBuilder, etc.) - Change Play Store track from beta to production - Add release notes (whatsnew-en-US)
This commit is contained in:
-6
@@ -1,6 +1,5 @@
|
||||
package io.novafoundation.nova.runtime.extrinsic
|
||||
|
||||
import android.util.Log
|
||||
import io.novafoundation.nova.runtime.extrinsic.extensions.AuthorizeCall
|
||||
import io.novafoundation.nova.runtime.extrinsic.extensions.ChargeAssetTxPayment
|
||||
import io.novafoundation.nova.runtime.extrinsic.extensions.CheckAppId
|
||||
@@ -11,8 +10,6 @@ import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot
|
||||
import io.novasama.substrate_sdk_android.runtime.extrinsic.builder.ExtrinsicBuilder
|
||||
import io.novasama.substrate_sdk_android.runtime.extrinsic.v5.transactionExtension.TransactionExtension
|
||||
|
||||
private const val TAG = "CustomTxExtensions"
|
||||
|
||||
object CustomTransactionExtensions {
|
||||
|
||||
fun applyDefaultValues(builder: ExtrinsicBuilder) {
|
||||
@@ -34,8 +31,6 @@ object CustomTransactionExtensions {
|
||||
val extensions = mutableListOf<TransactionExtension>()
|
||||
val signedExtIds = runtime.metadata.extrinsic.signedExtensions.map { it.id }
|
||||
|
||||
Log.d(TAG, "Metadata signed extensions: $signedExtIds")
|
||||
|
||||
// Add extensions based on what the metadata requires
|
||||
if ("AuthorizeCall" in signedExtIds) {
|
||||
extensions.add(AuthorizeCall())
|
||||
@@ -57,7 +52,6 @@ object CustomTransactionExtensions {
|
||||
extensions.add(CheckAppId())
|
||||
}
|
||||
|
||||
Log.d(TAG, "Extensions to add: ${extensions.map { it.name }}")
|
||||
return extensions
|
||||
}
|
||||
}
|
||||
|
||||
-15
@@ -1,6 +1,5 @@
|
||||
package io.novafoundation.nova.runtime.extrinsic
|
||||
|
||||
import android.util.Log
|
||||
import io.novafoundation.nova.common.utils.orZero
|
||||
import io.novafoundation.nova.runtime.ext.requireGenesisHash
|
||||
import io.novafoundation.nova.runtime.extrinsic.extensions.PezkuwiCheckMortality
|
||||
@@ -20,8 +19,6 @@ import io.novasama.substrate_sdk_android.runtime.extrinsic.v5.transactionExtensi
|
||||
import io.novasama.substrate_sdk_android.runtime.extrinsic.v5.transactionExtension.extensions.CheckTxVersion
|
||||
import io.novasama.substrate_sdk_android.runtime.extrinsic.v5.transactionExtension.extensions.checkMetadataHash.CheckMetadataHash
|
||||
|
||||
private const val TAG = "ExtrinsicBuilderFactory"
|
||||
|
||||
class ExtrinsicBuilderFactory(
|
||||
private val chainRegistry: ChainRegistry,
|
||||
private val mortalityConstructor: MortalityConstructor,
|
||||
@@ -45,19 +42,10 @@ class ExtrinsicBuilderFactory(
|
||||
): Sequence<ExtrinsicBuilder> {
|
||||
val runtime = chainRegistry.getRuntime(chain.id)
|
||||
|
||||
// Log metadata extensions
|
||||
val metadataExtensions = runtime.metadata.extrinsic.signedExtensions.map { it.id }
|
||||
Log.d(TAG, "Chain: ${chain.name}, Metadata extensions: $metadataExtensions")
|
||||
|
||||
val mortality = mortalityConstructor.constructMortality(chain.id)
|
||||
val metadataProof = metadataShortenerService.generateMetadataProof(chain.id)
|
||||
|
||||
// Log custom extensions
|
||||
val customExtensions = CustomTransactionExtensions.defaultValues(runtime).map { it.name }
|
||||
Log.d(TAG, "Custom extensions to add: $customExtensions")
|
||||
|
||||
val isPezkuwi = isPezkuwiChain(runtime)
|
||||
Log.d(TAG, "isPezkuwiChain: $isPezkuwi")
|
||||
|
||||
return generateSequence {
|
||||
ExtrinsicBuilder(
|
||||
@@ -67,7 +55,6 @@ class ExtrinsicBuilderFactory(
|
||||
).apply {
|
||||
// Use custom CheckMortality for Pezkuwi chains to avoid type lookup issues
|
||||
if (isPezkuwi) {
|
||||
Log.d(TAG, "Using PezkuwiCheckMortality for ${chain.name}")
|
||||
setTransactionExtension(PezkuwiCheckMortality(mortality.era, mortality.blockHash.fromHex()))
|
||||
} else {
|
||||
setTransactionExtension(CheckMortality(mortality.era, mortality.blockHash.fromHex()))
|
||||
@@ -79,8 +66,6 @@ class ExtrinsicBuilderFactory(
|
||||
setTransactionExtension(CheckTxVersion(metadataProof.usedVersion.transactionVersion))
|
||||
|
||||
CustomTransactionExtensions.defaultValues(runtime).forEach(::setTransactionExtension)
|
||||
|
||||
Log.d(TAG, "All extensions set for ${chain.name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-14
@@ -1,6 +1,5 @@
|
||||
package io.novafoundation.nova.runtime.multiNetwork.runtime
|
||||
|
||||
import android.util.Log
|
||||
import com.google.gson.Gson
|
||||
import io.novafoundation.nova.common.utils.md5
|
||||
import io.novafoundation.nova.common.utils.newLimitedThreadPoolExecutor
|
||||
@@ -79,8 +78,6 @@ class RuntimeFactory(
|
||||
|
||||
val metadataReader = RuntimeMetadataReader.read(runtimeMetadataRaw)
|
||||
|
||||
Log.d("RuntimeFactory", "Constructing metadata of version ${metadataReader.metadataVersion} for chain $chainId")
|
||||
|
||||
val schema = metadataReader.metadataPostV14.schema
|
||||
|
||||
val typePreset = if (metadataReader.metadataVersion < 14) {
|
||||
@@ -93,13 +90,9 @@ class RuntimeFactory(
|
||||
)
|
||||
}
|
||||
|
||||
Log.d("RuntimeFactory", "DEBUG: TypesUsage for chain $chainId = $typesUsage")
|
||||
|
||||
val (types, baseHash, ownHash) = when (typesUsage) {
|
||||
TypesUsage.BASE -> {
|
||||
Log.d("RuntimeFactory", "DEBUG: Loading BASE types for $chainId")
|
||||
val (types, baseHash) = constructBaseTypes(typePreset)
|
||||
Log.d("RuntimeFactory", "DEBUG: BASE types loaded, hash=$baseHash, typeCount=${types.size}")
|
||||
|
||||
Triple(types, baseHash, null)
|
||||
}
|
||||
@@ -169,7 +162,6 @@ class RuntimeFactory(
|
||||
val typePreset = try {
|
||||
parseNetworkVersioning(ownTypesTree, withoutVersioning, runtimeVersion)
|
||||
} catch (e: IllegalArgumentException) {
|
||||
Log.w("RuntimeFactory", "No versioning info in chain types for $chainId, using base definitions")
|
||||
withoutVersioning
|
||||
}
|
||||
|
||||
@@ -178,12 +170,7 @@ class RuntimeFactory(
|
||||
|
||||
private suspend fun constructBaseTypes(initialPreset: TypePreset): Pair<TypePreset, String> {
|
||||
val baseTypesRaw = runCatching { runtimeFilesCache.getBaseTypes() }
|
||||
.getOrElse {
|
||||
Log.e("RuntimeFactory", "DEBUG: BaseTypes NOT in cache!")
|
||||
throw BaseTypesNotInCacheException
|
||||
}
|
||||
|
||||
Log.d("RuntimeFactory", "BaseTypes loaded, len=${baseTypesRaw.length}")
|
||||
.getOrElse { throw BaseTypesNotInCacheException }
|
||||
|
||||
val typePreset = parseBaseDefinitions(fromJson(baseTypesRaw), initialPreset)
|
||||
|
||||
|
||||
-2
@@ -1,6 +1,5 @@
|
||||
package io.novafoundation.nova.runtime.network.updaters
|
||||
|
||||
import android.util.Log
|
||||
import io.novafoundation.nova.common.utils.Modules
|
||||
import io.novafoundation.nova.common.utils.system
|
||||
import io.novafoundation.nova.core.storage.StorageCache
|
||||
@@ -37,7 +36,6 @@ class BlockNumberUpdater(
|
||||
|
||||
return storageSubscriptionBuilder.subscribe(storageKey)
|
||||
.onEach {
|
||||
Log.d("BlockNumberUpdater", "Block number updated: ${it.value}")
|
||||
storageCache.insert(it, scopeValue.id)
|
||||
}
|
||||
.noSideAffects()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package io.novafoundation.nova.runtime.util
|
||||
|
||||
import android.util.Log
|
||||
import io.novasama.substrate_sdk_android.runtime.AccountId
|
||||
import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType
|
||||
import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum
|
||||
@@ -8,18 +7,14 @@ import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.MULT
|
||||
import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray
|
||||
import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliases
|
||||
|
||||
private const val TAG = "AccountLookup"
|
||||
|
||||
fun RuntimeType<*, *>.constructAccountLookupInstance(accountId: AccountId): Any {
|
||||
val resolvedType = skipAliases()
|
||||
Log.d(TAG, "Type name: ${this.name}, resolved type: ${resolvedType?.javaClass?.simpleName}")
|
||||
|
||||
return when (resolvedType) {
|
||||
is DictEnum -> {
|
||||
// MultiAddress type - wrap in the appropriate variant
|
||||
// Standard chains use "Id", but Pezkuwi uses numeric variants like "0"
|
||||
val variantNames = resolvedType.elements.values.map { it.name }
|
||||
Log.d(TAG, "DictEnum variants: $variantNames")
|
||||
|
||||
// Use "Id" if available (standard chains), otherwise use the first variant (index 0)
|
||||
// which is always the AccountId variant in MultiAddress
|
||||
@@ -29,30 +24,22 @@ fun RuntimeType<*, *>.constructAccountLookupInstance(accountId: AccountId): Any
|
||||
// For chains like Pezkuwi that use numeric variant names
|
||||
resolvedType.elements[0]?.name ?: MULTI_ADDRESS_ID
|
||||
}
|
||||
Log.d(TAG, "Using variant name: $idVariantName")
|
||||
DictEnum.Entry(idVariantName, accountId)
|
||||
}
|
||||
is FixedByteArray -> {
|
||||
// GenericAccountId or similar - return raw accountId
|
||||
Log.d(TAG, "FixedByteArray type, returning raw accountId")
|
||||
accountId
|
||||
}
|
||||
null -> {
|
||||
// For Pezkuwi chains where alias might not resolve properly
|
||||
// Check if the original type name suggests MultiAddress
|
||||
Log.d(TAG, "Resolved type is null, checking original type name: ${this.name}")
|
||||
if (this.name?.contains("MultiAddress") == true || this.name?.contains("multiaddress") == true) {
|
||||
// For unresolved MultiAddress types, use "0" which is the standard first variant (AccountId)
|
||||
Log.d(TAG, "Type name contains MultiAddress, using DictEnum.Entry with variant 0")
|
||||
DictEnum.Entry("0", accountId)
|
||||
} else {
|
||||
Log.d(TAG, "Unknown type with null resolution, returning raw accountId")
|
||||
accountId
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
// Unknown type - for Pezkuwi compatibility, try raw accountId instead of throwing
|
||||
Log.w(TAG, "Unknown address type: ${this.name} (${resolvedType.javaClass.simpleName}), trying raw accountId")
|
||||
// Unknown type - for Pezkuwi compatibility, try raw accountId
|
||||
accountId
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user