diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index bd6168e1..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,47 +0,0 @@ -def dockerImage = 'build-tools/android-build-box:latest' -def jenkinsAgent = 'android' -def deploymentBranches = ['master', 'develop'] - -node(jenkinsAgent) { - properties( - [ - disableConcurrentBuilds(), - buildDiscarder(steps.logRotator(numToKeepStr: '20')) - ] - ) - timestamps { - try { - stage('Git pull'){ - checkout scm - } - withCredentials([ - [$class: 'UsernamePasswordMultiBinding', credentialsId: 'bot-soramitsu-rw', usernameVariable: 'NEXUS_USERNAME', passwordVariable: 'NEXUS_PASSWORD'] - ]) - { - docker.withRegistry('https://docker.soramitsu.co.jp', 'bot-build-tools-ro') { - docker.image("${dockerImage}").inside() { - stage('Lint') { - sh "./gradlew ktlint" - } - stage('Tests') { - sh "./gradlew testDebugUnitTest" - } - stage('Build library') { - sh "./gradlew clean build" - } - if (env.BRANCH_NAME in deploymentBranches) { - stage('Deploy library') { - sh "./gradlew publish" - } - } - } - } - } - } catch (e) { - print e - currentBuild.result = 'FAILURE' - } finally { - cleanWs() - } - } -} \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 778c7d96..765b1b10 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) - implementation project(':fearless-utils') + implementation project(':substrate-sdk-android') implementation androidDep implementation constraintDep implementation gsonDep diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 92e5b210..4d506691 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="io.novasama.substrate_sdk_app"> @@ -11,7 +11,7 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + diff --git a/app/src/main/java/jp/co/soramitsu/fearless_utils_android/MainActivity.kt b/app/src/main/java/io/novasama/substrate_sdk_app/MainActivity.kt similarity index 85% rename from app/src/main/java/jp/co/soramitsu/fearless_utils_android/MainActivity.kt rename to app/src/main/java/io/novasama/substrate_sdk_app/MainActivity.kt index 3bac94e4..8e2b9637 100644 --- a/app/src/main/java/jp/co/soramitsu/fearless_utils_android/MainActivity.kt +++ b/app/src/main/java/io/novasama/substrate_sdk_app/MainActivity.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils_android +package io.novasama.substrate_sdk_app import android.os.Bundle import androidx.appcompat.app.AppCompatActivity diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d5009311..0149b7db 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,3 @@ - fearless-utils-android + substrate-sdk-android \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5cd6754e..5a4e50b3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ buildscript { ext { // App version - versionName = '1.11.2' + versionName = '2.0.0' versionCode = 1 // SDK and tools diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/JunctionType.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/JunctionType.kt deleted file mode 100644 index 193e4f84..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/JunctionType.kt +++ /dev/null @@ -1,6 +0,0 @@ -package jp.co.soramitsu.fearless_utils.encrypt.junction - -enum class JunctionType { - SOFT, - HARD -} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/EthereumKeypairFactory.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/EthereumKeypairFactory.kt deleted file mode 100644 index 23fb6e68..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/EthereumKeypairFactory.kt +++ /dev/null @@ -1,12 +0,0 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair.ethereum - -import jp.co.soramitsu.fearless_utils.encrypt.junction.Junction -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.generate - -object EthereumKeypairFactory { - - fun generate(seed: ByteArray, junctions: List): Keypair { - return Bip32KeypairFactory.generate(seed, junctions) - } -} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/exceptions/Bip39Exception.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/exceptions/Bip39Exception.kt deleted file mode 100644 index 3668eec6..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/exceptions/Bip39Exception.kt +++ /dev/null @@ -1,3 +0,0 @@ -package jp.co.soramitsu.fearless_utils.exceptions - -class Bip39Exception : Exception() diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/exceptions/JunctionTypeException.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/exceptions/JunctionTypeException.kt deleted file mode 100644 index 05a8f0ef..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/exceptions/JunctionTypeException.kt +++ /dev/null @@ -1,3 +0,0 @@ -package jp.co.soramitsu.fearless_utils.exceptions - -class JunctionTypeException : Exception() diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/RuntimeSnapshot.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/RuntimeSnapshot.kt deleted file mode 100644 index bd38e622..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/RuntimeSnapshot.kt +++ /dev/null @@ -1,9 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime - -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadata - -class RuntimeSnapshot( - val typeRegistry: TypeRegistry, - val metadata: RuntimeMetadata -) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/DynamicTypeExtension.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/DynamicTypeExtension.kt deleted file mode 100644 index 96e2eed1..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/DynamicTypeExtension.kt +++ /dev/null @@ -1,11 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference - -typealias TypeProvider = (typeDef: String) -> TypeReference - -interface DynamicTypeExtension { - - fun createType(name: String, typeDef: String, typeProvider: TypeProvider): Type<*>? -} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/DynamicTypeResolver.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/DynamicTypeResolver.kt deleted file mode 100644 index c6254eb8..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/DynamicTypeResolver.kt +++ /dev/null @@ -1,43 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic - -import jp.co.soramitsu.fearless_utils.extensions.tryFindNonNull -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.BoxExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.CompactExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.FixedArrayExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.HashMapExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.OptionExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.ResultTypeExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.TupleExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.VectorExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type - -class DynamicTypeResolver( - val extensions: List -) { - constructor(vararg extensions: DynamicTypeExtension) : this(extensions.toList()) - - companion object { - fun defaultCompoundResolver(): DynamicTypeResolver { - return DynamicTypeResolver(DEFAULT_COMPOUND_EXTENSIONS) - } - - val DEFAULT_COMPOUND_EXTENSIONS = listOf( - VectorExtension, - CompactExtension, - OptionExtension, - BoxExtension, - TupleExtension, - FixedArrayExtension, - HashMapExtension, - ResultTypeExtension - ) - } - - fun createDynamicType( - name: String, - typeDef: String, - innerTypeProvider: TypeProvider - ): Type<*>? { - return extensions.tryFindNonNull { it.createType(name, typeDef, innerTypeProvider) } - } -} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/TypePreset.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/TypePreset.kt deleted file mode 100644 index 2bcff613..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/TypePreset.kt +++ /dev/null @@ -1,178 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.registry - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Alias -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.BitVec -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Bytes -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.CallBytes -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Data -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.EraType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.EventRecord -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Extrinsic -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericAccountId -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericCall -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericConsensus -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericConsensusEngineId -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericEvent -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericMultiAddress -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericSeal -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericSealV0 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.H160 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.H256 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.H512 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Null -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.OpaqueCall -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.SessionKeysSubstrate -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.i128 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.i16 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.i256 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.i32 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.i64 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.i8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u128 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u16 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u256 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u32 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u64 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.stub.FakeType - -typealias TypePresetBuilder = MutableMap -typealias TypePreset = Map - -fun TypePreset.newBuilder(): TypePresetBuilder = toMutableMap() - -fun TypePresetBuilder.type(type: Type<*>) { - val currentRef = getOrCreate(type.name) - - currentRef.value = type -} - -fun TypePresetBuilder.fakeType(name: String) { - type(FakeType(name)) -} - -fun TypePresetBuilder.alias(alias: String, original: String) { - val aliasedReference = getOrCreate(original) - - val typeAlias = Alias(alias, aliasedReference) - - type(typeAlias) -} - -fun TypePresetBuilder.getOrCreate(definition: String) = getOrPut(definition) { TypeReference(null) } - -fun TypePresetBuilder.create(definition: String): TypeReference = - TypeReference(null).also { put(definition, it) } - -fun createTypePresetBuilder(): TypePresetBuilder = mutableMapOf() - -fun typePreset(builder: TypePresetBuilder.() -> Unit): TypePreset { - return createTypePresetBuilder().apply(builder) -} - -fun v14Preset() = typePreset { - type(BooleanType) - - type(u8) - type(u16) - type(u32) - type(u64) - type(u128) - type(u256) - - type(i8) - type(i16) - type(i32) - type(i64) - type(i128) - type(i256) - - type(Bytes) - type(Null) - type(H256) - - type(GenericCall) - type(GenericEvent) - type(EraType) - - type(Data(this)) - type(GenericAccountId) - - alias("Balance", "u128") -} - -fun v13Preset(): TypePreset = typePreset { - type(BooleanType) - - type(u8) - type(u16) - type(u32) - type(u64) - type(u128) - type(u256) - - type(i8) - type(i16) - type(i32) - type(i64) - type(i128) - type(i256) - - type(GenericAccountId) - type(Null) - type(GenericCall) - - fakeType("GenericBlock") - - type(H160) - type(H256) - type(H512) - - alias("GenericVote", "u8") - - type(Bytes) - type(BitVec) - - type(Extrinsic) - - type(CallBytes) // seems to be unused in runtime - type(EraType) - type(Data(this)) - - alias("BoxProposal", "Proposal") - - type(GenericConsensusEngineId) - - type(SessionKeysSubstrate(this)) - - alias("GenericAccountIndex", "u32") - - type(GenericMultiAddress(this)) - - type(OpaqueCall) - - type(GenericEvent) - type(EventRecord(this)) - - alias("::Source", "LookupSource") - alias("U64", "u64") - alias("U32", "u32") - - alias("Bidkind", "BidKind") - - alias("AccountIdAddress", "GenericAccountId") - - alias("VoteWeight", "u128") - alias("PreRuntime", "GenericPreRuntime") - // todo replace with real type - fakeType("GenericPreRuntime") - type(GenericSealV0(this)) - type(GenericSeal(this)) - type(GenericConsensus(this)) -} - -fun TypePreset.unknownTypes() = entries - .mapNotNull { (name, typeRef) -> if (!typeRef.isResolved()) name else null } diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/TypeRegistryExt.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/TypeRegistryExt.kt deleted file mode 100644 index 105aaf67..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/TypeRegistryExt.kt +++ /dev/null @@ -1,9 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.registry - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type - -fun TypeRegistry.getOrThrow( - definition: String -): Type<*> { - return get(definition) ?: error("Type $definition was not found.") -} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Bytes.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Bytes.kt deleted file mode 100644 index 2e8ad5cc..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Bytes.kt +++ /dev/null @@ -1,5 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.DynamicByteArray - -val Bytes = DynamicByteArray("Bytes") diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/EventRecord.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/EventRecord.kt deleted file mode 100644 index 3fc044e5..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/EventRecord.kt +++ /dev/null @@ -1,22 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Vec - -@Suppress("FunctionName") -fun EventRecord(typePresetBuilder: TypePresetBuilder) = Struct( - name = "EventRecord", - mapping = linkedMapOf( - "phase" to typePresetBuilder.getOrCreate("Phase"), - "event" to typePresetBuilder.getOrCreate("GenericEvent"), - "topics" to TypeReference( - Vec( - name = "Vec", - typeReference = typePresetBuilder.getOrCreate("Hash") - ) - ) - ) -) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericAccountId.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericAccountId.kt deleted file mode 100644 index 739bf102..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericAccountId.kt +++ /dev/null @@ -1,5 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.FixedByteArray - -object GenericAccountId : FixedByteArray("GenericAccountId", 32) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericConsensusEngineId.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericConsensusEngineId.kt deleted file mode 100644 index a86c1a0b..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericConsensusEngineId.kt +++ /dev/null @@ -1,24 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Vec -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.FixedByteArray - -val GenericConsensusEngineId = FixedByteArray("GenericConsensusEngineId", 4) - -@Suppress("FunctionName") -fun GenericConsensus(typePresetBuilder: TypePresetBuilder) = Struct( - name = "GenericConsensus", - mapping = linkedMapOf( - "engine" to typePresetBuilder.getOrCreate("ConsensusEngineId"), - "data" to TypeReference( - Vec( - name = "Vec", - typeReference = typePresetBuilder.getOrCreate("u8") - ) - ) - ) -) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ResultType.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ResultType.kt deleted file mode 100644 index 0619502e..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ResultType.kt +++ /dev/null @@ -1,18 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum - -class ResultType(ok: TypeReference, err: TypeReference) : DictEnum( - "Result", - listOf( - Entry(Ok, ok), - Entry(Err, err) - ) -) { - - companion object { - const val Ok = "Ok" - const val Err = "Err" - } -} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/instances/AddressInstanceConstructor.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/instances/AddressInstanceConstructor.kt deleted file mode 100644 index 6b09e4f1..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/instances/AddressInstanceConstructor.kt +++ /dev/null @@ -1,24 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.instances - -import jp.co.soramitsu.fearless_utils.runtime.AccountId -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrThrow -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.MULTI_ADDRESS_ID -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.FixedByteArray - -object AddressInstanceConstructor : RuntimeType.InstanceConstructor { - - override fun constructInstance(typeRegistry: TypeRegistry, value: AccountId): Any { - return when (val addressType = typeRegistry.getOrThrow(ExtrinsicTypes.ADDRESS)) { - is DictEnum -> { // MultiAddress - DictEnum.Entry(MULTI_ADDRESS_ID, value) - } - is FixedByteArray -> { // GenericAccountId or similar - value - } - else -> throw UnsupportedOperationException("Unknown address type: ${addressType.name}") - } - } -} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/Primitive.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/Primitive.kt deleted file mode 100644 index 07286680..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/Primitive.kt +++ /dev/null @@ -1,8 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type - -abstract class Primitive(name: String) : Type(name) { - - override val isFullyResolved = true -} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/GetMetadataRequest.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/GetMetadataRequest.kt deleted file mode 100644 index 9338af22..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/GetMetadataRequest.kt +++ /dev/null @@ -1,5 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata - -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest - -object GetMetadataRequest : RuntimeRequest("state_getMetadata", listOf()) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/account/AccountInfoRequest.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/account/AccountInfoRequest.kt deleted file mode 100644 index e7041e35..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/account/AccountInfoRequest.kt +++ /dev/null @@ -1,10 +0,0 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.account - -import jp.co.soramitsu.fearless_utils.runtime.Module -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage.GetStorageRequest - -class AccountInfoRequest(publicKey: ByteArray) : GetStorageRequest( - listOf( - Module.System.Account.storageKey(publicKey) - ) -) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/author/PendingExtrinsicsRequest.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/author/PendingExtrinsicsRequest.kt deleted file mode 100644 index 1fa9a971..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/author/PendingExtrinsicsRequest.kt +++ /dev/null @@ -1,7 +0,0 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.author - -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest - -private const val METHOD = "author_pendingExtrinsics" - -class PendingExtrinsicsRequest : RuntimeRequest(METHOD, listOf()) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/GetStorageRequest.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/GetStorageRequest.kt deleted file mode 100644 index 09597419..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/GetStorageRequest.kt +++ /dev/null @@ -1,8 +0,0 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage - -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest - -open class GetStorageRequest(keys: List) : RuntimeRequest( - method = "state_getStorage", - keys -) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/system/NodeNetworkTypeRequest.kt b/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/system/NodeNetworkTypeRequest.kt deleted file mode 100644 index 1c338853..00000000 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/system/NodeNetworkTypeRequest.kt +++ /dev/null @@ -1,7 +0,0 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.system - -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest - -private const val METHOD = "system_chain" - -class NodeNetworkTypeRequest : RuntimeRequest(METHOD, listOf()) diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/extensions/VectorExtensionTest.kt b/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/extensions/VectorExtensionTest.kt deleted file mode 100644 index da9bd3fe..00000000 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/extensions/VectorExtensionTest.kt +++ /dev/null @@ -1,27 +0,0 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.registry.extensions - -import jp.co.soramitsu.fearless_utils.common.assertInstance -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.VectorExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Vec -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.DynamicByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import org.junit.Test - -class VectorExtensionTest { - - @Test - fun `should create optimized type for u8`() { - val result = VectorExtension.createWrapper("A", TypeReference(u8)) - - assertInstance(result) - } - - @Test - fun `should create vec type for other type`() { - val result = VectorExtension.createWrapper("A", TypeReference(BooleanType)) - - assertInstance(result) - } -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 057fe6aa..d9066373 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,4 @@ android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official -RELEASE_REPOSITORY_URL https://nexus.iroha.tech/repository/maven-soramitsu/ -SNAPSHOT_REPOSITORY_URL https://nexus.iroha.tech/repository/maven-soramitsu/ - signing.secretKeyRingFile=./signing/key.gpg \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index aa550cf5..6bc72eaf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,2 @@ -include ':fearless-utils' -include ':app' -rootProject.name = "fearless-utils-android" \ No newline at end of file +include ':substrate-sdk-android' +include ':app' \ No newline at end of file diff --git a/sr25519-java/Cargo.toml b/sr25519-java/Cargo.toml index 98a1fbf7..8a223ba7 100644 --- a/sr25519-java/Cargo.toml +++ b/sr25519-java/Cargo.toml @@ -1,11 +1,9 @@ [package] name = "sr25519java" version = "0.1.0" -authors = ["Harrm "] +authors = ['Novasama Technologies'] edition = "2018" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] zeroize = { version="<=1.1.1" } zeroize_derive = { version="<=1.1.1" } @@ -15,6 +13,7 @@ schnorrkel = { version="<=0.9.1" } [profile.release] lto = true +opt-level = "s" [lib] name = "sr25519java" diff --git a/sr25519-java/src/lib.rs b/sr25519-java/src/lib.rs index d514d20b..1b233f8e 100644 --- a/sr25519-java/src/lib.rs +++ b/sr25519-java/src/lib.rs @@ -2,7 +2,7 @@ #![allow(non_snake_case)] use jni::JNIEnv; -use jni::objects::{JClass, JString, JObject}; +use jni::objects::{JClass}; use jni::sys::{jbyteArray, jboolean, jsize}; use jni::errors::{Result as JniResult, Error as JniError, ErrorKind}; use schnorrkel::{ @@ -96,17 +96,6 @@ fn create_secret(secret: &[u8]) -> JniResult { } } -#[no_mangle] -pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr25519_test<'a>( - jni_env: JNIEnv<'a>, - _: JClass, - hello_what: JString) -> JString<'a> { - let hello_what_str = try_or_throw!(jni_env, jni_env.get_string(hello_what), JObject::null().into()); - let s = format!("Hello, {}!", hello_what_str.to_str().unwrap_or("")); - println!("{}", s); - try_or_throw!(jni_env, jni_env.new_string(s), JObject::null().into()) -} - /** * Verify a message and its corresponding against a public key; * @@ -116,7 +105,7 @@ pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr255 * @return true if signature is valid, false otherwise */ #[no_mangle] -pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr25519_verify( +pub unsafe extern "system" fn Java_io_novasama_substrate_1sdk_1android_encrypt_Sr25519_verify( jni_env: JNIEnv, _: JClass, signature_bytes: jbyteArray, message: jbyteArray, public_key: jbyteArray) -> jboolean { @@ -144,7 +133,7 @@ pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr255 * @return the signature */ #[no_mangle] -pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr25519_sign( +pub unsafe extern "system" fn Java_io_novasama_substrate_1sdk_1android_encrypt_Sr25519_sign( jni_env: JNIEnv, _: JClass, public_key: jbyteArray, secret: jbyteArray, message: jbyteArray) -> jbyteArray { @@ -169,7 +158,7 @@ pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr255 * @return pre-allocated output buffer of SR25519_KEYPAIR_SIZE bytes */ #[no_mangle] -pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr25519_deriveKeypairHard( +pub unsafe extern "system" fn Java_io_novasama_substrate_1sdk_1android_encrypt_Sr25519_deriveKeypairHard( jni_env: JNIEnv, _: JClass, pair: jbyteArray, cc: jbyteArray, @@ -191,7 +180,7 @@ pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr255 * @return keypair: pre-allocated output buffer of SR25519_KEYPAIR_SIZE bytes */ #[no_mangle] -pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr25519_deriveKeypairSoft( +pub unsafe extern "system" fn Java_io_novasama_substrate_1sdk_1android_encrypt_Sr25519_deriveKeypairSoft( jni_env: JNIEnv, _: JClass, pair: jbyteArray, @@ -213,7 +202,7 @@ pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr255 * @return pre-allocated output buffer of SR25519_PUBLIC_SIZE bytes */ #[no_mangle] -pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr25519_derivePublicSoft( +pub unsafe extern "system" fn Java_io_novasama_substrate_1sdk_1android_encrypt_Sr25519_derivePublicSoft( jni_env: JNIEnv, _: JClass, pair: jbyteArray, @@ -233,7 +222,7 @@ pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr255 * @return keypair [32b key | 32b nonce | 32b public], pre-allocated output buffer of SR25519_KEYPAIR_SIZE bytes */ #[no_mangle] -pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr25519_keypairFromSeed( +pub unsafe extern "system" fn Java_io_novasama_substrate_1sdk_1android_encrypt_Sr25519_keypairFromSeed( jni_env: JNIEnv, _: JClass, seed: jbyteArray) -> jbyteArray { @@ -249,7 +238,7 @@ pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr255 * and the last 32 bytes being the seed for nonces */ #[no_mangle] -pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr25519_toEd25519Bytes( +pub unsafe extern "system" fn Java_io_novasama_substrate_1sdk_1android_encrypt_Sr25519_toEd25519Bytes( jni_env: JNIEnv, _: JClass, secret: jbyteArray @@ -266,7 +255,7 @@ pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr255 * represented canonically, and the last 32 bytes being the seed for nonces */ #[no_mangle] -pub unsafe extern "system" fn Java_jp_co_soramitsu_fearless_1utils_encrypt_Sr25519_fromEd25519Bytes( +pub unsafe extern "system" fn Java_io_novasama_substrate_1sdk_1android_encrypt_Sr25519_fromEd25519Bytes( jni_env: JNIEnv, _: JClass, expanded_ed_secret: jbyteArray diff --git a/fearless-utils/.gitignore b/substrate-sdk-android/.gitignore similarity index 100% rename from fearless-utils/.gitignore rename to substrate-sdk-android/.gitignore diff --git a/fearless-utils/build.gradle b/substrate-sdk-android/build.gradle similarity index 88% rename from fearless-utils/build.gradle rename to substrate-sdk-android/build.gradle index 32e348b2..0c053c43 100644 --- a/fearless-utils/build.gradle +++ b/substrate-sdk-android/build.gradle @@ -15,6 +15,7 @@ publishing { android { compileSdkVersion rootProject.compileVersion + defaultConfig { minSdkVersion rootProject.minVersion targetSdkVersion rootProject.targetVersion @@ -57,6 +58,7 @@ cargo { module = "../sr25519-java/" libname = "sr25519java" targets = ["arm", "arm64", "x86", "x86_64"] + profile = "release" } tasks.whenTaskAdded { task -> @@ -65,19 +67,6 @@ tasks.whenTaskAdded { task -> } } -task deleteJar(type: Delete) { - delete 'libs/jars/libfearless.jar' -} - -task createJar(type: Copy) { - from('build/intermediates/bundles/release/') - into('libs/jars/') - include('classes.jar') - rename('classes.jar', 'libfearless.jar') -} - -createJar.dependsOn(deleteJar, build) - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -97,11 +86,12 @@ dependencies { testImplementation jUnitDep testImplementation mockitoDep - testImplementation project(path: ':fearless-utils') + testImplementation project(':substrate-sdk-android') androidTestImplementation androidTestRunnerDep androidTestImplementation androidTestRulesDep androidTestImplementation androidJunitDep + androidTestImplementation project(':substrate-sdk-android') testImplementation coroutinesTestDep } diff --git a/fearless-utils/gradle.properties b/substrate-sdk-android/gradle.properties similarity index 56% rename from fearless-utils/gradle.properties rename to substrate-sdk-android/gradle.properties index 55c940ff..8165fddb 100644 --- a/fearless-utils/gradle.properties +++ b/substrate-sdk-android/gradle.properties @@ -1,3 +1,3 @@ -POM_NAME=Fearless Utils Lib +POM_NAME=Substrate Sdk Android POM_ARTIFACT_ID=library POM_PACKAGING=aar \ No newline at end of file diff --git a/fearless-utils/libs/polkaj-scale-0.2.3.jar b/substrate-sdk-android/libs/polkaj-scale-0.2.3.jar similarity index 100% rename from fearless-utils/libs/polkaj-scale-0.2.3.jar rename to substrate-sdk-android/libs/polkaj-scale-0.2.3.jar diff --git a/fearless-utils/signing/key.gpg b/substrate-sdk-android/signing/key.gpg similarity index 100% rename from fearless-utils/signing/key.gpg rename to substrate-sdk-android/signing/key.gpg diff --git a/fearless-utils/src/androidTest/java/jp/co/soramitsu/fearless_utils/encrypt/AndroidSignerTest.kt b/substrate-sdk-android/src/androidTest/java/io/novasama/substrate_sdk_android/encrypt/AndroidSignerTest.kt similarity index 61% rename from fearless-utils/src/androidTest/java/jp/co/soramitsu/fearless_utils/encrypt/AndroidSignerTest.kt rename to substrate-sdk-android/src/androidTest/java/io/novasama/substrate_sdk_android/encrypt/AndroidSignerTest.kt index dd5dedda..d1eb92bb 100644 --- a/fearless-utils/src/androidTest/java/jp/co/soramitsu/fearless_utils/encrypt/AndroidSignerTest.kt +++ b/substrate-sdk-android/src/androidTest/java/io/novasama/substrate_sdk_android/encrypt/AndroidSignerTest.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.TestData -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.SubstrateKeypairFactory +import io.novasama.substrate_sdk_android.TestData +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.SubstrateKeypairFactory import org.junit.Test class AndroidSignerTest { @@ -15,9 +15,10 @@ class AndroidSignerTest { val result = Signer.sign(MultiChainEncryption.Substrate(EncryptionType.SR25519), messageHex.toByteArray(), keypair) require( - Signer.verifySr25519( + SignatureVerifier.verify( + result, + Signer.MessageHashing.SUBSTRATE, messageHex.toByteArray(), - result.signature, keypair.publicKey ) ) diff --git a/fearless-utils/src/androidTest/java/jp/co/soramitsu/fearless_utils/encrypt/AndroidSubstrateKeypairDerivationTest.kt b/substrate-sdk-android/src/androidTest/java/io/novasama/substrate_sdk_android/encrypt/AndroidSubstrateKeypairDerivationTest.kt similarity index 88% rename from fearless-utils/src/androidTest/java/jp/co/soramitsu/fearless_utils/encrypt/AndroidSubstrateKeypairDerivationTest.kt rename to substrate-sdk-android/src/androidTest/java/io/novasama/substrate_sdk_android/encrypt/AndroidSubstrateKeypairDerivationTest.kt index 5b15d0b3..41a072d9 100644 --- a/fearless-utils/src/androidTest/java/jp/co/soramitsu/fearless_utils/encrypt/AndroidSubstrateKeypairDerivationTest.kt +++ b/substrate-sdk-android/src/androidTest/java/io/novasama/substrate_sdk_android/encrypt/AndroidSubstrateKeypairDerivationTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt import org.junit.Test diff --git a/fearless-utils/src/androidTest/java/jp/co/soramitsu/fearless_utils/encrypt/json/JsonSeedEncoderTest.kt b/substrate-sdk-android/src/androidTest/java/io/novasama/substrate_sdk_android/encrypt/json/JsonSeedEncoderTest.kt similarity index 74% rename from fearless-utils/src/androidTest/java/jp/co/soramitsu/fearless_utils/encrypt/json/JsonSeedEncoderTest.kt rename to substrate-sdk-android/src/androidTest/java/io/novasama/substrate_sdk_android/encrypt/json/JsonSeedEncoderTest.kt index 1e268a83..db4c4b0e 100644 --- a/fearless-utils/src/androidTest/java/jp/co/soramitsu/fearless_utils/encrypt/json/JsonSeedEncoderTest.kt +++ b/substrate-sdk-android/src/androidTest/java/io/novasama/substrate_sdk_android/encrypt/json/JsonSeedEncoderTest.kt @@ -1,21 +1,20 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json +package io.novasama.substrate_sdk_android.encrypt.json import androidx.test.ext.junit.runners.AndroidJUnit4 import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.TestData -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.Sr25519Keypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.SubstrateKeypairFactory -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.toAddress +import io.novasama.substrate_sdk_android.TestData +import io.novasama.substrate_sdk_android.encrypt.EncryptionType +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.Sr25519Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.SubstrateKeypairFactory +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.toAddress import org.junit.Test import org.junit.runner.RunWith -import java.security.SecureRandom private val PASSWORD = "12345" private val NAME = "name" -private const val ADDRESS_TYPE_WESTEND: Byte = 42 +private const val ADDRESS_TYPE_WESTEND: Short = 42 private const val GENESIS_HASH_WESTEND = "e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e" diff --git a/fearless-utils/src/androidTest/resources/crypto/sr25519HDKD.json b/substrate-sdk-android/src/androidTest/resources/crypto/sr25519HDKD.json similarity index 100% rename from fearless-utils/src/androidTest/resources/crypto/sr25519HDKD.json rename to substrate-sdk-android/src/androidTest/resources/crypto/sr25519HDKD.json diff --git a/fearless-utils/src/main/AndroidManifest.xml b/substrate-sdk-android/src/main/AndroidManifest.xml similarity index 62% rename from fearless-utils/src/main/AndroidManifest.xml rename to substrate-sdk-android/src/main/AndroidManifest.xml index e0259c5c..dc73616c 100644 --- a/fearless-utils/src/main/AndroidManifest.xml +++ b/substrate-sdk-android/src/main/AndroidManifest.xml @@ -1,3 +1,3 @@ + package="io.novasama.substrate_sdk_android"> \ No newline at end of file diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Base58.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Base58.kt similarity index 97% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Base58.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Base58.kt index c99683ff..5f2ec7cf 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Base58.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Base58.kt @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.exceptions.AddressFormatException +import io.novasama.substrate_sdk_android.exceptions.AddressFormatException import java.io.UnsupportedEncodingException import java.math.BigInteger import java.security.MessageDigest diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/EncryptionType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/EncryptionType.kt similarity index 87% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/EncryptionType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/EncryptionType.kt index aa4d047c..7d95aa54 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/EncryptionType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/EncryptionType.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.encrypt.json.JsonSeedDecodingException +import io.novasama.substrate_sdk_android.encrypt.json.JsonSeedDecodingException enum class EncryptionType(val rawName: String, val signatureVersion: Int) { ED25519("ed25519", 0), diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Ext.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Ext.kt similarity index 90% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Ext.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Ext.kt index de920a2d..95ce9f30 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Ext.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Ext.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/SecurityProviders.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/SecurityProviders.kt similarity index 87% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/SecurityProviders.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/SecurityProviders.kt index fbf3e3d9..2ddd1f08 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/SecurityProviders.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/SecurityProviders.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt import net.i2p.crypto.eddsa.EdDSASecurityProvider import org.bouncycastle.jce.provider.BouncyCastleProvider diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/SignatureVerifier.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/SignatureVerifier.kt similarity index 93% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/SignatureVerifier.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/SignatureVerifier.kt index c93ec955..1bacc51b 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/SignatureVerifier.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/SignatureVerifier.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.encrypt.keypair.ECDSAUtils -import jp.co.soramitsu.fearless_utils.extensions.fromHex +import io.novasama.substrate_sdk_android.encrypt.keypair.ECDSAUtils +import io.novasama.substrate_sdk_android.extensions.fromHex import net.i2p.crypto.eddsa.EdDSAEngine import net.i2p.crypto.eddsa.EdDSAPublicKey import net.i2p.crypto.eddsa.EdDSASecurityProvider diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/SignatureWrapper.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/SignatureWrapper.kt similarity index 91% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/SignatureWrapper.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/SignatureWrapper.kt index d4e45a84..9bc5f40c 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/SignatureWrapper.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/SignatureWrapper.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt sealed class SignatureWrapper(val encryptionType: EncryptionType) { abstract val signature: ByteArray diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Signer.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Signer.kt similarity index 91% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Signer.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Signer.kt index ad428264..31bc5a06 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Signer.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Signer.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.Sr25519Keypair -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b256 -import jp.co.soramitsu.fearless_utils.hash.Hasher.keccak256 +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.Sr25519Keypair +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b256 +import io.novasama.substrate_sdk_android.hash.Hasher.keccak256 import net.i2p.crypto.eddsa.EdDSAEngine import net.i2p.crypto.eddsa.EdDSAPrivateKey import net.i2p.crypto.eddsa.EdDSASecurityProvider diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Sr25519.java b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Sr25519.java similarity index 97% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Sr25519.java rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Sr25519.java index 1e08d0e3..dcef9b0c 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/Sr25519.java +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/Sr25519.java @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt; +package io.novasama.substrate_sdk_android.encrypt; public final class Sr25519 { @@ -24,8 +24,6 @@ public final class Sr25519 { System.loadLibrary("sr25519java"); } - public static native String test(String hello_what); - /** * Verify a message and its corresponding against a public key; * diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/Common.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/Common.kt similarity index 91% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/Common.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/Common.kt index 634f9ae5..39f720f3 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/Common.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/Common.kt @@ -1,6 +1,6 @@ @file:Suppress("EXPERIMENTAL_API_USAGE") -package jp.co.soramitsu.fearless_utils.encrypt.json +package io.novasama.substrate_sdk_android.encrypt.json import java.nio.ByteBuffer import java.nio.ByteOrder diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/JsonSeedDecoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/JsonSeedDecoder.kt similarity index 75% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/JsonSeedDecoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/JsonSeedDecoder.kt index b5bfa9ec..dc1351fa 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/JsonSeedDecoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/JsonSeedDecoder.kt @@ -1,19 +1,19 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json +package io.novasama.substrate_sdk_android.encrypt.json import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.json.JsonSeedDecodingException.IncorrectPasswordException -import jp.co.soramitsu.fearless_utils.encrypt.json.JsonSeedDecodingException.InvalidJsonException -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.ContentCoderFactory -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.decode -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.TypeCoderFactory -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.decode -import jp.co.soramitsu.fearless_utils.encrypt.model.ImportAccountData -import jp.co.soramitsu.fearless_utils.encrypt.model.ImportAccountMeta -import jp.co.soramitsu.fearless_utils.encrypt.model.JsonAccountData -import jp.co.soramitsu.fearless_utils.encrypt.model.NetworkTypeIdentifier -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.addressByteOrNull +import io.novasama.substrate_sdk_android.encrypt.EncryptionType +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.json.JsonSeedDecodingException.IncorrectPasswordException +import io.novasama.substrate_sdk_android.encrypt.json.JsonSeedDecodingException.InvalidJsonException +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.ContentCoderFactory +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.decode +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.TypeCoderFactory +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.decode +import io.novasama.substrate_sdk_android.encrypt.model.ImportAccountData +import io.novasama.substrate_sdk_android.encrypt.model.ImportAccountMeta +import io.novasama.substrate_sdk_android.encrypt.model.JsonAccountData +import io.novasama.substrate_sdk_android.encrypt.model.NetworkTypeIdentifier +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.addressByteOrNull import org.bouncycastle.util.encoders.Base64 sealed class JsonSeedDecodingException : Exception() { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/JsonSeedEncoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/JsonSeedEncoder.kt similarity index 74% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/JsonSeedEncoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/JsonSeedEncoder.kt index 7c95ffdd..f5cbca4b 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/JsonSeedEncoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/JsonSeedEncoder.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json +package io.novasama.substrate_sdk_android.encrypt.json import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.ContentCoderFactory -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.encode -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.TypeCoderFactory -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.encode -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.model.JsonAccountData +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.ContentCoderFactory +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.encode +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.TypeCoderFactory +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.encode +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.model.JsonAccountData import org.bouncycastle.util.encoders.Base64 @Suppress("EXPERIMENTAL_API_USAGE") diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/ContentCoderFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/ContentCoderFactory.kt similarity index 77% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/ContentCoderFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/ContentCoderFactory.kt index 05fec0ba..10a739fe 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/ContentCoderFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/ContentCoderFactory.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.content +package io.novasama.substrate_sdk_android.encrypt.json.coders.content -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.checksumCoder.Pkcs8ChecksumCoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.secretCoder.EcdsaJsonSecretCoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.secretCoder.Ed25519JsonSecretCoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.secretCoder.EthereumJsonSecretCoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.secretCoder.Sr25519JsonSecretCoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.checksumCoder.Pkcs8ChecksumCoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.secretCoder.EcdsaJsonSecretCoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.secretCoder.Ed25519JsonSecretCoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.secretCoder.EthereumJsonSecretCoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.secretCoder.Sr25519JsonSecretCoder private class JsonContentDecoderImpl( override val checksumDecoder: JsonContentDecoder.ChecksumDecoder, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/JsonTypeEncoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/JsonTypeEncoder.kt similarity index 87% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/JsonTypeEncoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/JsonTypeEncoder.kt index 2de2380f..9459aeed 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/JsonTypeEncoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/JsonTypeEncoder.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.content +package io.novasama.substrate_sdk_android.encrypt.json.coders.content -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair interface JsonContentEncoder { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/checksumCoder/Pkcs8ChecksumCoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/checksumCoder/Pkcs8ChecksumCoder.kt similarity index 82% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/checksumCoder/Pkcs8ChecksumCoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/checksumCoder/Pkcs8ChecksumCoder.kt index f0fe261b..88a2ddb0 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/checksumCoder/Pkcs8ChecksumCoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/checksumCoder/Pkcs8ChecksumCoder.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.checksumCoder +package io.novasama.substrate_sdk_android.encrypt.json.coders.content.checksumCoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.JsonChecksumCoder -import jp.co.soramitsu.fearless_utils.extensions.split +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.JsonChecksumCoder +import io.novasama.substrate_sdk_android.extensions.split import java.lang.Exception private val PKCS8_HEADER = intArrayOf(48, 83, 2, 1, 1, 48, 5, 6, 3, 43, 101, 112, 4, 34, 4, 32) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/secretCoder/EthereumJsonSecretCoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/secretCoder/EthereumJsonSecretCoder.kt similarity index 55% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/secretCoder/EthereumJsonSecretCoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/secretCoder/EthereumJsonSecretCoder.kt index ce415486..9fa801c2 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/secretCoder/EthereumJsonSecretCoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/secretCoder/EthereumJsonSecretCoder.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.secretCoder +package io.novasama.substrate_sdk_android.encrypt.json.coders.content.secretCoder -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.JsonContentDecoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.JsonSecretCoder -import jp.co.soramitsu.fearless_utils.encrypt.keypair.BaseKeypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.ECDSAUtils -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.derivePublicKey +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.JsonContentDecoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.JsonSecretCoder +import io.novasama.substrate_sdk_android.encrypt.keypair.BaseKeypair +import io.novasama.substrate_sdk_android.encrypt.keypair.ECDSAUtils +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.derivePublicKey object EthereumJsonSecretCoder : JsonSecretCoder { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/secretCoder/OtherSubstrate.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/secretCoder/OtherSubstrate.kt similarity index 65% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/secretCoder/OtherSubstrate.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/secretCoder/OtherSubstrate.kt index 43810355..c1f81a8a 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/secretCoder/OtherSubstrate.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/secretCoder/OtherSubstrate.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.secretCoder - -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.JsonContentDecoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.JsonSecretCoder -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.SubstrateKeypairFactory +package io.novasama.substrate_sdk_android.encrypt.json.coders.content.secretCoder + +import io.novasama.substrate_sdk_android.encrypt.EncryptionType +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.JsonContentDecoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.JsonSecretCoder +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.SubstrateKeypairFactory internal object EcdsaJsonSecretCoder : OtherSubstrateJsonSecretCoder(EncryptionType.ECDSA) internal object Ed25519JsonSecretCoder : OtherSubstrateJsonSecretCoder(EncryptionType.ED25519) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/secretCoder/Sr25519JsonSecretCoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/secretCoder/Sr25519JsonSecretCoder.kt similarity index 63% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/secretCoder/Sr25519JsonSecretCoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/secretCoder/Sr25519JsonSecretCoder.kt index 48942ed2..f4946149 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/content/secretCoder/Sr25519JsonSecretCoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/content/secretCoder/Sr25519JsonSecretCoder.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.secretCoder - -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.Sr25519 -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.JsonContentDecoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.content.JsonSecretCoder -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.Sr25519Keypair +package io.novasama.substrate_sdk_android.encrypt.json.coders.content.secretCoder + +import io.novasama.substrate_sdk_android.encrypt.EncryptionType +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.Sr25519 +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.JsonContentDecoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.content.JsonSecretCoder +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.Sr25519Keypair object Sr25519JsonSecretCoder : JsonSecretCoder { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/JsonTypeEncoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/JsonTypeEncoder.kt similarity index 95% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/JsonTypeEncoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/JsonTypeEncoder.kt index ed5d78c1..f6d4d52c 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/JsonTypeEncoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/JsonTypeEncoder.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.type +package io.novasama.substrate_sdk_android.encrypt.json.coders.type interface JsonTypeEncoder { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/TypeCoderFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/TypeCoderFactory.kt similarity index 87% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/TypeCoderFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/TypeCoderFactory.kt index 37837ab7..e815dc3a 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/TypeCoderFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/TypeCoderFactory.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.type +package io.novasama.substrate_sdk_android.encrypt.json.coders.type -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.cryptor.XSalsa20Poly1305Cryptor -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.keyGenerator.ScryptKeyGenerator +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.cryptor.XSalsa20Poly1305Cryptor +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.keyGenerator.ScryptKeyGenerator private class JsonTypeDecoderImpl( override val encryptionKeyGenerator: JsonTypeDecoder.EncryptionKeyGenerator, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/cryptor/XSalsa20Poly1305Cryptor.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/cryptor/XSalsa20Poly1305Cryptor.kt similarity index 69% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/cryptor/XSalsa20Poly1305Cryptor.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/cryptor/XSalsa20Poly1305Cryptor.kt index 775f0b31..6340db05 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/cryptor/XSalsa20Poly1305Cryptor.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/cryptor/XSalsa20Poly1305Cryptor.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.cryptor +package io.novasama.substrate_sdk_android.encrypt.json.coders.type.cryptor -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.JsonCryptor -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.JsonTypeDecoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.JsonTypeEncoder -import jp.co.soramitsu.fearless_utils.encrypt.json.copyBytes -import jp.co.soramitsu.fearless_utils.encrypt.xsalsa20poly1305.SecretBox +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.JsonCryptor +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.JsonTypeDecoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.JsonTypeEncoder +import io.novasama.substrate_sdk_android.encrypt.json.copyBytes +import io.novasama.substrate_sdk_android.encrypt.xsalsa20poly1305.SecretBox private val NONCE_OFFSET = 0 private val NONCE_SIZE = 24 diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/keyGenerator/ScryptKeyGenerator.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/keyGenerator/ScryptKeyGenerator.kt similarity index 77% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/keyGenerator/ScryptKeyGenerator.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/keyGenerator/ScryptKeyGenerator.kt index 2422cfcf..ea40b1ae 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/json/coders/type/keyGenerator/ScryptKeyGenerator.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/json/coders/type/keyGenerator/ScryptKeyGenerator.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.keyGenerator - -import jp.co.soramitsu.fearless_utils.encrypt.json.asLittleEndianBytes -import jp.co.soramitsu.fearless_utils.encrypt.json.asLittleEndianInt -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.JsonEncryptionKeyGenerator -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.JsonTypeDecoder -import jp.co.soramitsu.fearless_utils.encrypt.json.coders.type.JsonTypeEncoder -import jp.co.soramitsu.fearless_utils.encrypt.json.copyBytes +package io.novasama.substrate_sdk_android.encrypt.json.coders.type.keyGenerator + +import io.novasama.substrate_sdk_android.encrypt.json.asLittleEndianBytes +import io.novasama.substrate_sdk_android.encrypt.json.asLittleEndianInt +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.JsonEncryptionKeyGenerator +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.JsonTypeDecoder +import io.novasama.substrate_sdk_android.encrypt.json.coders.type.JsonTypeEncoder +import io.novasama.substrate_sdk_android.encrypt.json.copyBytes import org.bouncycastle.crypto.generators.SCrypt import java.security.SecureRandom import java.util.Random diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/BIP32JunctionDecoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/BIP32JunctionDecoder.kt similarity index 82% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/BIP32JunctionDecoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/BIP32JunctionDecoder.kt index 62790767..9b92576b 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/BIP32JunctionDecoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/BIP32JunctionDecoder.kt @@ -1,9 +1,9 @@ @file:Suppress("EXPERIMENTAL_UNSIGNED_LITERALS") -package jp.co.soramitsu.fearless_utils.encrypt.junction +package io.novasama.substrate_sdk_android.encrypt.junction -import jp.co.soramitsu.fearless_utils.extensions.requireOrException -import jp.co.soramitsu.fearless_utils.extensions.toUnsignedBytes +import io.novasama.substrate_sdk_android.extensions.requireOrException +import io.novasama.substrate_sdk_android.extensions.toUnsignedBytes private const val HARD_KEY_FLAG = 0x80000000u diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/Junction.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/Junction.kt similarity index 54% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/Junction.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/Junction.kt index f0d828b8..47276e0d 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/Junction.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/Junction.kt @@ -1,3 +1,3 @@ -package jp.co.soramitsu.fearless_utils.encrypt.junction +package io.novasama.substrate_sdk_android.encrypt.junction data class Junction(val type: JunctionType, val chaincode: ByteArray) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/JunctionDecoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/JunctionDecoder.kt similarity index 94% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/JunctionDecoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/JunctionDecoder.kt index 729f25b0..9901b888 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/JunctionDecoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/JunctionDecoder.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.junction +package io.novasama.substrate_sdk_android.encrypt.junction -import jp.co.soramitsu.fearless_utils.extensions.requireOrException +import io.novasama.substrate_sdk_android.extensions.requireOrException abstract class JunctionDecoder { diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/JunctionType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/JunctionType.kt new file mode 100644 index 00000000..a2d039dc --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/JunctionType.kt @@ -0,0 +1,6 @@ +package io.novasama.substrate_sdk_android.encrypt.junction + +enum class JunctionType { + SOFT, + HARD +} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/SubstrateJunctionDecoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/SubstrateJunctionDecoder.kt similarity index 76% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/SubstrateJunctionDecoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/SubstrateJunctionDecoder.kt index 6fc05fe2..ecc14663 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/junction/SubstrateJunctionDecoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/junction/SubstrateJunctionDecoder.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.encrypt.junction +package io.novasama.substrate_sdk_android.encrypt.junction -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b128 -import jp.co.soramitsu.fearless_utils.scale.dataType.string -import jp.co.soramitsu.fearless_utils.scale.dataType.toByteArray +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b128 +import io.novasama.substrate_sdk_android.scale.dataType.string +import io.novasama.substrate_sdk_android.scale.dataType.toByteArray import java.nio.ByteBuffer import java.nio.ByteOrder diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/Derivation.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/Derivation.kt similarity index 69% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/Derivation.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/Derivation.kt index a2acea4d..411cc9b4 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/Derivation.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/Derivation.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair +package io.novasama.substrate_sdk_android.encrypt.keypair -import jp.co.soramitsu.fearless_utils.encrypt.junction.Junction +import io.novasama.substrate_sdk_android.encrypt.junction.Junction internal fun KeypairFactory.generate( seed: ByteArray, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ECDSAUtils.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ECDSAUtils.kt similarity index 89% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ECDSAUtils.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ECDSAUtils.kt index 8c88391b..21b369c8 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ECDSAUtils.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ECDSAUtils.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair +package io.novasama.substrate_sdk_android.encrypt.keypair -import jp.co.soramitsu.fearless_utils.extensions.toHexString +import io.novasama.substrate_sdk_android.extensions.toHexString import org.bouncycastle.jce.ECNamedCurveTable import org.bouncycastle.util.encoders.Hex import org.web3j.crypto.Sign diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/Keypair.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/Keypair.kt similarity index 76% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/Keypair.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/Keypair.kt index 151fa873..7d1b0a4b 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/Keypair.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/Keypair.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair +package io.novasama.substrate_sdk_android.encrypt.keypair interface Keypair { val privateKey: ByteArray diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/KeypairFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/KeypairFactory.kt similarity index 62% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/KeypairFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/KeypairFactory.kt index a3c89f35..88621c07 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/KeypairFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/KeypairFactory.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair +package io.novasama.substrate_sdk_android.encrypt.keypair -import jp.co.soramitsu.fearless_utils.encrypt.junction.Junction +import io.novasama.substrate_sdk_android.encrypt.junction.Junction internal interface KeypairFactory { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/Bip32ExtendedKeyPair.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/Bip32ExtendedKeyPair.kt similarity index 53% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/Bip32ExtendedKeyPair.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/Bip32ExtendedKeyPair.kt index bcd1396a..a1bd8297 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/Bip32ExtendedKeyPair.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/Bip32ExtendedKeyPair.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair.ethereum +package io.novasama.substrate_sdk_android.encrypt.keypair.ethereum -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair class Bip32ExtendedKeyPair( override val privateKey: ByteArray, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/Bip32KeypairFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/Bip32KeypairFactory.kt similarity index 78% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/Bip32KeypairFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/Bip32KeypairFactory.kt index 44dde162..93731c35 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/Bip32KeypairFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/Bip32KeypairFactory.kt @@ -1,14 +1,14 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair.ethereum - -import jp.co.soramitsu.fearless_utils.encrypt.hmacSHA512 -import jp.co.soramitsu.fearless_utils.encrypt.junction.Junction -import jp.co.soramitsu.fearless_utils.encrypt.junction.JunctionType -import jp.co.soramitsu.fearless_utils.encrypt.keypair.ECDSAUtils -import jp.co.soramitsu.fearless_utils.encrypt.keypair.KeypairFactory -import jp.co.soramitsu.fearless_utils.encrypt.keypair.derivePublicKey -import jp.co.soramitsu.fearless_utils.extensions.fromUnsignedBytes -import jp.co.soramitsu.fearless_utils.extensions.requireOrException -import jp.co.soramitsu.fearless_utils.scale.utils.toUnsignedBytes +package io.novasama.substrate_sdk_android.encrypt.keypair.ethereum + +import io.novasama.substrate_sdk_android.encrypt.hmacSHA512 +import io.novasama.substrate_sdk_android.encrypt.junction.Junction +import io.novasama.substrate_sdk_android.encrypt.junction.JunctionType +import io.novasama.substrate_sdk_android.encrypt.keypair.ECDSAUtils +import io.novasama.substrate_sdk_android.encrypt.keypair.KeypairFactory +import io.novasama.substrate_sdk_android.encrypt.keypair.derivePublicKey +import io.novasama.substrate_sdk_android.extensions.fromUnsignedBytes +import io.novasama.substrate_sdk_android.extensions.requireOrException +import io.novasama.substrate_sdk_android.scale.utils.toUnsignedBytes import java.math.BigInteger object Bip32KeypairFactory : KeypairFactory { diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/EthereumKeypairFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/EthereumKeypairFactory.kt new file mode 100644 index 00000000..d6eaf21b --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/EthereumKeypairFactory.kt @@ -0,0 +1,12 @@ +package io.novasama.substrate_sdk_android.encrypt.keypair.ethereum + +import io.novasama.substrate_sdk_android.encrypt.junction.Junction +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.generate + +object EthereumKeypairFactory { + + fun generate(seed: ByteArray, junctions: List): Keypair { + return Bip32KeypairFactory.generate(seed, junctions) + } +} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/Common.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/Common.kt similarity index 56% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/Common.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/Common.kt index f670b168..8912900c 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/Common.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/Common.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate +package io.novasama.substrate_sdk_android.encrypt.keypair.substrate -import jp.co.soramitsu.fearless_utils.encrypt.junction.Junction -import jp.co.soramitsu.fearless_utils.encrypt.junction.JunctionType -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.KeypairFactory -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b256 -import jp.co.soramitsu.fearless_utils.scale.dataType.string -import jp.co.soramitsu.fearless_utils.scale.dataType.toByteArray +import io.novasama.substrate_sdk_android.encrypt.junction.Junction +import io.novasama.substrate_sdk_android.encrypt.junction.JunctionType +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.KeypairFactory +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b256 +import io.novasama.substrate_sdk_android.scale.dataType.string +import io.novasama.substrate_sdk_android.scale.dataType.toByteArray class KeypairWithSeed( val seed: ByteArray, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/ECDSASubstrateKeypairFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/ECDSASubstrateKeypairFactory.kt similarity index 62% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/ECDSASubstrateKeypairFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/ECDSASubstrateKeypairFactory.kt index ec2011f1..3d62197b 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/ECDSASubstrateKeypairFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/ECDSASubstrateKeypairFactory.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate +package io.novasama.substrate_sdk_android.encrypt.keypair.substrate -import jp.co.soramitsu.fearless_utils.encrypt.keypair.ECDSAUtils -import jp.co.soramitsu.fearless_utils.encrypt.keypair.derivePublicKey +import io.novasama.substrate_sdk_android.encrypt.keypair.ECDSAUtils +import io.novasama.substrate_sdk_android.encrypt.keypair.derivePublicKey internal object ECDSASubstrateKeypairFactory : OtherSubstrateKeypairFactory("Secp256k1HDKD") { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/Ed25519SubstrateKeypairFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/Ed25519SubstrateKeypairFactory.kt similarity index 90% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/Ed25519SubstrateKeypairFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/Ed25519SubstrateKeypairFactory.kt index 2aada235..f30343f9 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/Ed25519SubstrateKeypairFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/Ed25519SubstrateKeypairFactory.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate +package io.novasama.substrate_sdk_android.encrypt.keypair.substrate -import jp.co.soramitsu.fearless_utils.encrypt.SecurityProviders +import io.novasama.substrate_sdk_android.encrypt.SecurityProviders import net.i2p.crypto.eddsa.EdDSAKey import net.i2p.crypto.eddsa.spec.EdDSANamedCurveTable import net.i2p.crypto.eddsa.spec.EdDSAPrivateKeySpec diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/Sr25519SubstrateKeypairFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/Sr25519SubstrateKeypairFactory.kt similarity index 81% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/Sr25519SubstrateKeypairFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/Sr25519SubstrateKeypairFactory.kt index cb88a7bd..1bd26c91 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/Sr25519SubstrateKeypairFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/Sr25519SubstrateKeypairFactory.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate +package io.novasama.substrate_sdk_android.encrypt.keypair.substrate -import jp.co.soramitsu.fearless_utils.encrypt.Sr25519 -import jp.co.soramitsu.fearless_utils.encrypt.junction.Junction -import jp.co.soramitsu.fearless_utils.encrypt.junction.JunctionType -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.KeypairFactory +import io.novasama.substrate_sdk_android.encrypt.Sr25519 +import io.novasama.substrate_sdk_android.encrypt.junction.Junction +import io.novasama.substrate_sdk_android.encrypt.junction.JunctionType +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.KeypairFactory class Sr25519Keypair( override val privateKey: ByteArray, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/SubstrateKeypairFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/SubstrateKeypairFactory.kt similarity index 59% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/SubstrateKeypairFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/SubstrateKeypairFactory.kt index 7263f384..8740047f 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/substrate/SubstrateKeypairFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/keypair/substrate/SubstrateKeypairFactory.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate +package io.novasama.substrate_sdk_android.encrypt.keypair.substrate -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType -import jp.co.soramitsu.fearless_utils.encrypt.junction.Junction -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.generate +import io.novasama.substrate_sdk_android.encrypt.EncryptionType +import io.novasama.substrate_sdk_android.encrypt.junction.Junction +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.keypair.generate object SubstrateKeypairFactory { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/EnglishWordList.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/EnglishWordList.kt similarity index 99% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/EnglishWordList.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/EnglishWordList.kt index 645fd955..3a8f79d2 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/EnglishWordList.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/EnglishWordList.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.mnemonic +package io.novasama.substrate_sdk_android.encrypt.mnemonic import io.github.novacrypto.bip39.WordList diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/Mnemonic.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/Mnemonic.kt similarity index 82% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/Mnemonic.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/Mnemonic.kt index 37b66382..7a96701f 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/Mnemonic.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/Mnemonic.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.mnemonic +package io.novasama.substrate_sdk_android.encrypt.mnemonic class Mnemonic( diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/MnemonicCreator.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/MnemonicCreator.kt similarity index 97% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/MnemonicCreator.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/MnemonicCreator.kt index 98ac98cc..fa6a60ff 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/MnemonicCreator.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/MnemonicCreator.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.encrypt.mnemonic +package io.novasama.substrate_sdk_android.encrypt.mnemonic import io.github.novacrypto.SecureCharBuffer import io.github.novacrypto.bip39.MnemonicGenerator import io.github.novacrypto.hashing.Sha256 -import jp.co.soramitsu.fearless_utils.exceptions.Bip39Exception +import io.novasama.substrate_sdk_android.exceptions.Bip39Exception import java.security.SecureRandom import java.text.Normalizer import java.text.Normalizer.normalize diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/model/ImportAccountData.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/model/ImportAccountData.kt similarity index 75% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/model/ImportAccountData.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/model/ImportAccountData.kt index c07ddc68..3b772f87 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/model/ImportAccountData.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/model/ImportAccountData.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt.model +package io.novasama.substrate_sdk_android.encrypt.model -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair class ImportAccountData( val keypair: Keypair, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/model/JsonAccountData.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/model/JsonAccountData.kt similarity index 90% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/model/JsonAccountData.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/model/JsonAccountData.kt index 08f582b3..e33d2921 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/model/JsonAccountData.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/model/JsonAccountData.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.model +package io.novasama.substrate_sdk_android.encrypt.model -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType +import io.novasama.substrate_sdk_android.encrypt.EncryptionType const val ENCODING_SCRYPT = "scrypt" const val ENCODING_SALSA = "xsalsa20-poly1305" diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/QrFormat.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/QrFormat.kt similarity index 86% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/QrFormat.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/QrFormat.kt index 52f6714e..af2ae1ba 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/QrFormat.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/QrFormat.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.qr +package io.novasama.substrate_sdk_android.encrypt.qr import java.lang.Exception diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/QrSharing.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/QrSharing.kt similarity index 80% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/QrSharing.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/QrSharing.kt index 8520d762..579dc695 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/QrSharing.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/QrSharing.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.qr +package io.novasama.substrate_sdk_android.encrypt.qr -import jp.co.soramitsu.fearless_utils.extensions.tryFindNonNull +import io.novasama.substrate_sdk_android.extensions.tryFindNonNull class QrSharing( private val decodingFormats: List, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/formats/AddressQrFormat.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/formats/AddressQrFormat.kt similarity index 79% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/formats/AddressQrFormat.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/formats/AddressQrFormat.kt index 9a543b47..58e4cd20 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/formats/AddressQrFormat.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/formats/AddressQrFormat.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.qr.formats +package io.novasama.substrate_sdk_android.encrypt.qr.formats -import jp.co.soramitsu.fearless_utils.encrypt.qr.QrFormat +import io.novasama.substrate_sdk_android.encrypt.qr.QrFormat class AddressQrFormat( private val addressValidator: (String) -> Boolean diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/formats/SubstrateQrFormat.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/formats/SubstrateQrFormat.kt similarity index 82% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/formats/SubstrateQrFormat.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/formats/SubstrateQrFormat.kt index 1d6dd4c8..ca615d93 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/qr/formats/SubstrateQrFormat.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/qr/formats/SubstrateQrFormat.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.encrypt.qr.formats +package io.novasama.substrate_sdk_android.encrypt.qr.formats -import jp.co.soramitsu.fearless_utils.encrypt.qr.QrFormat -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString +import io.novasama.substrate_sdk_android.encrypt.qr.QrFormat +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString private const val PREFIX = "substrate" diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/SeedCreator.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/SeedCreator.kt similarity index 93% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/SeedCreator.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/SeedCreator.kt index 49a80490..2abe3467 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/SeedCreator.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/SeedCreator.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.seed +package io.novasama.substrate_sdk_android.encrypt.seed import org.bouncycastle.crypto.digests.SHA512Digest import org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/SeedFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/SeedFactory.kt similarity index 65% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/SeedFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/SeedFactory.kt index d8402df8..6697d43e 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/SeedFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/SeedFactory.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.seed +package io.novasama.substrate_sdk_android.encrypt.seed -import jp.co.soramitsu.fearless_utils.encrypt.mnemonic.Mnemonic +import io.novasama.substrate_sdk_android.encrypt.mnemonic.Mnemonic interface SeedFactory { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/ethereum/EthereumSeedFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/ethereum/EthereumSeedFactory.kt similarity index 65% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/ethereum/EthereumSeedFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/ethereum/EthereumSeedFactory.kt index 2751770a..aff95db1 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/ethereum/EthereumSeedFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/ethereum/EthereumSeedFactory.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.encrypt.seed.ethereum +package io.novasama.substrate_sdk_android.encrypt.seed.ethereum -import jp.co.soramitsu.fearless_utils.encrypt.mnemonic.Mnemonic -import jp.co.soramitsu.fearless_utils.encrypt.mnemonic.MnemonicCreator -import jp.co.soramitsu.fearless_utils.encrypt.seed.SeedCreator -import jp.co.soramitsu.fearless_utils.encrypt.seed.SeedFactory +import io.novasama.substrate_sdk_android.encrypt.mnemonic.Mnemonic +import io.novasama.substrate_sdk_android.encrypt.mnemonic.MnemonicCreator +import io.novasama.substrate_sdk_android.encrypt.seed.SeedCreator +import io.novasama.substrate_sdk_android.encrypt.seed.SeedFactory object EthereumSeedFactory : SeedFactory { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/substrate/SubstrateSeedFactory.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/substrate/SubstrateSeedFactory.kt similarity index 64% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/substrate/SubstrateSeedFactory.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/substrate/SubstrateSeedFactory.kt index c5fd667f..18473d4b 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/seed/substrate/SubstrateSeedFactory.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/seed/substrate/SubstrateSeedFactory.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.encrypt.seed.substrate +package io.novasama.substrate_sdk_android.encrypt.seed.substrate -import jp.co.soramitsu.fearless_utils.encrypt.mnemonic.Mnemonic -import jp.co.soramitsu.fearless_utils.encrypt.mnemonic.MnemonicCreator -import jp.co.soramitsu.fearless_utils.encrypt.seed.SeedCreator -import jp.co.soramitsu.fearless_utils.encrypt.seed.SeedFactory +import io.novasama.substrate_sdk_android.encrypt.mnemonic.Mnemonic +import io.novasama.substrate_sdk_android.encrypt.mnemonic.MnemonicCreator +import io.novasama.substrate_sdk_android.encrypt.seed.SeedCreator +import io.novasama.substrate_sdk_android.encrypt.seed.SeedFactory object SubstrateSeedFactory : SeedFactory { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/HSalsa20.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/HSalsa20.kt similarity index 97% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/HSalsa20.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/HSalsa20.kt index 9363bef5..0907afa9 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/HSalsa20.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/HSalsa20.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.xsalsa20poly1305 +package io.novasama.substrate_sdk_android.encrypt.xsalsa20poly1305 import org.bouncycastle.crypto.engines.Salsa20Engine import org.bouncycastle.util.Pack diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/Keys.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/Keys.kt similarity index 97% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/Keys.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/Keys.kt index 3b017569..e10624ab 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/Keys.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/Keys.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.xsalsa20poly1305 +package io.novasama.substrate_sdk_android.encrypt.xsalsa20poly1305 import org.bouncycastle.math.ec.rfc7748.X25519 import java.security.SecureRandom diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/SecretBox.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/SecretBox.kt similarity index 97% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/SecretBox.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/SecretBox.kt index 08af2a3d..b9c5128a 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/SecretBox.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/SecretBox.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.xsalsa20poly1305 +package io.novasama.substrate_sdk_android.encrypt.xsalsa20poly1305 -import jp.co.soramitsu.fearless_utils.encrypt.xsalsa20poly1305.Keys.sharedSecret +import io.novasama.substrate_sdk_android.encrypt.xsalsa20poly1305.Keys.sharedSecret import org.bouncycastle.crypto.digests.Blake2bDigest import org.bouncycastle.crypto.engines.XSalsa20Engine import org.bouncycastle.crypto.macs.Poly1305 diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/SimpleBox.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/SimpleBox.kt similarity index 97% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/SimpleBox.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/SimpleBox.kt index 3d9adf51..06d17028 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/encrypt/xsalsa20poly1305/SimpleBox.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/encrypt/xsalsa20poly1305/SimpleBox.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.xsalsa20poly1305 +package io.novasama.substrate_sdk_android.encrypt.xsalsa20poly1305 import java.util.Arrays diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/exceptions/AddressFormatException.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/exceptions/AddressFormatException.kt similarity index 92% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/exceptions/AddressFormatException.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/exceptions/AddressFormatException.kt index de897585..8b340c89 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/exceptions/AddressFormatException.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/exceptions/AddressFormatException.kt @@ -13,6 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package jp.co.soramitsu.fearless_utils.exceptions +package io.novasama.substrate_sdk_android.exceptions class AddressFormatException(message: String?) : Exception(message) diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/exceptions/Bip39Exception.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/exceptions/Bip39Exception.kt new file mode 100644 index 00000000..88d7fdcb --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/exceptions/Bip39Exception.kt @@ -0,0 +1,3 @@ +package io.novasama.substrate_sdk_android.exceptions + +class Bip39Exception : Exception() diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/exceptions/JunctionTypeException.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/exceptions/JunctionTypeException.kt new file mode 100644 index 00000000..1ee3b93c --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/exceptions/JunctionTypeException.kt @@ -0,0 +1,3 @@ +package io.novasama.substrate_sdk_android.exceptions + +class JunctionTypeException : Exception() diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Ethereum.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Ethereum.kt similarity index 91% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Ethereum.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Ethereum.kt index f21f935f..2c219414 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Ethereum.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Ethereum.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.extensions +package io.novasama.substrate_sdk_android.extensions -import jp.co.soramitsu.fearless_utils.encrypt.keypair.ECDSAUtils -import jp.co.soramitsu.fearless_utils.hash.Hasher.keccak256 +import io.novasama.substrate_sdk_android.encrypt.keypair.ECDSAUtils +import io.novasama.substrate_sdk_android.hash.Hasher.keccak256 import org.web3j.crypto.Keys import java.util.Locale diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Exceptions.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Exceptions.kt similarity index 91% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Exceptions.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Exceptions.kt index 46dbc488..2a5a916e 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Exceptions.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Exceptions.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.extensions +package io.novasama.substrate_sdk_android.extensions import kotlin.contracts.ExperimentalContracts import kotlin.contracts.contract diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Hex.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Hex.kt similarity index 91% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Hex.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Hex.kt index 92dc1999..9188378a 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Hex.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Hex.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.extensions +package io.novasama.substrate_sdk_android.extensions import org.bouncycastle.util.encoders.Hex diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Kotlin.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Kotlin.kt similarity index 97% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Kotlin.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Kotlin.kt index 40dfd041..82d619f7 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/extensions/Kotlin.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/extensions/Kotlin.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.extensions +package io.novasama.substrate_sdk_android.extensions -import jp.co.soramitsu.fearless_utils.hash.isNegative +import io.novasama.substrate_sdk_android.hash.isNegative import java.math.BigInteger import java.nio.ByteBuffer import java.nio.ByteOrder diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/Blake2b128.java b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/Blake2b128.java similarity index 91% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/Blake2b128.java rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/Blake2b128.java index 4dd2dcdc..2863c5ad 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/Blake2b128.java +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/Blake2b128.java @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.hash; +package io.novasama.substrate_sdk_android.hash; import org.bouncycastle.crypto.digests.Blake2bDigest; import org.bouncycastle.jcajce.provider.digest.BCMessageDigest; diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/Ext.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/Ext.kt similarity index 93% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/Ext.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/Ext.kt index 6c7ef146..2d2e9e7e 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/Ext.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/Ext.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.hash +package io.novasama.substrate_sdk_android.hash import net.jpountz.xxhash.XXHash64 import org.bouncycastle.jcajce.provider.digest.BCMessageDigest diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/Hasher.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/Hasher.kt similarity index 89% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/Hasher.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/Hasher.kt index 8e9bca9b..52c04ed9 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/Hasher.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/Hasher.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.hash +package io.novasama.substrate_sdk_android.hash import net.jpountz.xxhash.XXHashFactory import org.bouncycastle.jcajce.provider.digest.Blake2b @@ -9,7 +9,7 @@ object Hasher { private val blake2b256 = Blake2b.Blake2b256() - private val blake2b128 = Blake2b128() + private val blake2b128 = io.novasama.substrate_sdk_android.hash.Blake2b128() private val blake2b512 = Blake2b.Blake2b512() diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/XXHash.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/XXHash.kt similarity index 93% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/XXHash.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/XXHash.kt index 0e944928..2533cd6b 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/hash/XXHash.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/hash/XXHash.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.hash +package io.novasama.substrate_sdk_android.hash import net.jpountz.xxhash.XXHash64 import java.nio.ByteBuffer diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/icon/Circle.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/icon/Circle.kt similarity index 69% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/icon/Circle.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/icon/Circle.kt index 2fadbbb1..8779824d 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/icon/Circle.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/icon/Circle.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.icon +package io.novasama.substrate_sdk_android.icon data class Circle( val x: Double, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/icon/IconGenerator.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/icon/IconGenerator.kt similarity index 99% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/icon/IconGenerator.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/icon/IconGenerator.kt index 8107e058..4832739c 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/icon/IconGenerator.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/icon/IconGenerator.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.icon +package io.novasama.substrate_sdk_android.icon import android.graphics.drawable.PictureDrawable import com.caverock.androidsvg.SVG diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/icon/Scheme.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/icon/Scheme.kt similarity index 66% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/icon/Scheme.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/icon/Scheme.kt index 1664da13..36463cea 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/icon/Scheme.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/icon/Scheme.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.icon +package io.novasama.substrate_sdk_android.icon data class Scheme( val name: String, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/Modules.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/Modules.kt similarity index 96% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/Modules.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/Modules.kt index 6a99c9f2..97d88095 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/Modules.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/Modules.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.runtime +package io.novasama.substrate_sdk_android.runtime typealias AccountId = ByteArray diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/RuntimeSnapshot.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/RuntimeSnapshot.kt new file mode 100644 index 00000000..50fa1edc --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/RuntimeSnapshot.kt @@ -0,0 +1,9 @@ +package io.novasama.substrate_sdk_android.runtime + +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadata + +class RuntimeSnapshot( + val typeRegistry: TypeRegistry, + val metadata: RuntimeMetadata +) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/StorageUtils.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/StorageUtils.kt similarity index 68% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/StorageUtils.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/StorageUtils.kt index 1c92ed18..68ef736d 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/StorageUtils.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/StorageUtils.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime +package io.novasama.substrate_sdk_android.runtime -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.hash.Hasher -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b128Concat -import jp.co.soramitsu.fearless_utils.hash.Hasher.xxHash128 -import jp.co.soramitsu.fearless_utils.hash.hashConcat +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.hash.Hasher +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b128Concat +import io.novasama.substrate_sdk_android.hash.Hasher.xxHash128 +import io.novasama.substrate_sdk_android.hash.hashConcat typealias HashFunction = (ByteArray) -> ByteArray diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/ParsingExt.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/ParsingExt.kt similarity index 92% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/ParsingExt.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/ParsingExt.kt index 2d41987c..31efeb57 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/ParsingExt.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/ParsingExt.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions +package io.novasama.substrate_sdk_android.runtime.definitions internal fun String.splitTuple(): List { val innerPart = replace(Regex("\\s"), "").removeSurrounding("(", ")") diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/TypeDefinitionParser.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/TypeDefinitionParser.kt similarity index 82% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/TypeDefinitionParser.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/TypeDefinitionParser.kt index 055a6149..b84bb3c9 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/TypeDefinitionParser.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/TypeDefinitionParser.kt @@ -1,20 +1,20 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions +package io.novasama.substrate_sdk_android.runtime.definitions import com.google.gson.annotations.SerializedName -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeResolver -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePreset -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.create -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.newBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Alias -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.CollectionEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.SetType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeResolver +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePreset +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.create +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.registry.newBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.type +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Alias +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.CollectionEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.SetType +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct import java.math.BigInteger class TypeDefinitionsTree( diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/DynamicTypeExtension.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/DynamicTypeExtension.kt new file mode 100644 index 00000000..957887c0 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/DynamicTypeExtension.kt @@ -0,0 +1,11 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.dynamic + +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference + +typealias TypeProvider = (typeDef: String) -> TypeReference + +interface DynamicTypeExtension { + + fun createType(name: String, typeDef: String, typeProvider: TypeProvider): Type<*>? +} diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/DynamicTypeResolver.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/DynamicTypeResolver.kt new file mode 100644 index 00000000..e925561d --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/DynamicTypeResolver.kt @@ -0,0 +1,43 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.dynamic + +import io.novasama.substrate_sdk_android.extensions.tryFindNonNull +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.BoxExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.CompactExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.FixedArrayExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.HashMapExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.OptionExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.ResultTypeExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.TupleExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.VectorExtension +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type + +class DynamicTypeResolver( + val extensions: List +) { + constructor(vararg extensions: DynamicTypeExtension) : this(extensions.toList()) + + companion object { + fun defaultCompoundResolver(): DynamicTypeResolver { + return DynamicTypeResolver(DEFAULT_COMPOUND_EXTENSIONS) + } + + val DEFAULT_COMPOUND_EXTENSIONS = listOf( + VectorExtension, + CompactExtension, + OptionExtension, + BoxExtension, + TupleExtension, + FixedArrayExtension, + HashMapExtension, + ResultTypeExtension + ) + } + + fun createDynamicType( + name: String, + typeDef: String, + innerTypeProvider: TypeProvider + ): Type<*>? { + return extensions.tryFindNonNull { it.createType(name, typeDef, innerTypeProvider) } + } +} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/extentsions/Default.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/extentsions/Default.kt similarity index 69% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/extentsions/Default.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/extentsions/Default.kt index e49cb343..8cefe035 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/extentsions/Default.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/extentsions/Default.kt @@ -1,19 +1,19 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions - -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.TypeProvider -import jp.co.soramitsu.fearless_utils.runtime.definitions.splitTuple -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.FixedArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Option -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Tuple -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Vec -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.ResultType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.Compact -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.DynamicByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.FixedByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 +package io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions + +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.TypeProvider +import io.novasama.substrate_sdk_android.runtime.definitions.splitTuple +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.FixedArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Option +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Tuple +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Vec +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.ResultType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.Compact +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.DynamicByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 object VectorExtension : WrapperExtension() { override val wrapperName = "Vec" diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/extentsions/GenericsExtension.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/extentsions/GenericsExtension.kt similarity index 62% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/extentsions/GenericsExtension.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/extentsions/GenericsExtension.kt index 4becfdd0..4223a31d 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/extentsions/GenericsExtension.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/extentsions/GenericsExtension.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions +package io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.TypeProvider -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.TypeProvider +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type private val GENERIC_REGEX = "^([^<]*)<(.+)>\$".toRegex() // PartName diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/extentsions/WrapperExtension.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/extentsions/WrapperExtension.kt similarity index 56% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/extentsions/WrapperExtension.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/extentsions/WrapperExtension.kt index 2b99cfd0..83da82d5 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/dynamic/extentsions/WrapperExtension.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/dynamic/extentsions/WrapperExtension.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions +package io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.TypeProvider -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeExtension +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.TypeProvider +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference abstract class WrapperExtension : DynamicTypeExtension { diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/TypePreset.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/TypePreset.kt new file mode 100644 index 00000000..4f69a402 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/TypePreset.kt @@ -0,0 +1,178 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.registry + +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Alias +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.BitVec +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Bytes +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.CallBytes +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Data +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.EraType +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.EventRecord +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Extrinsic +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericAccountId +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericCall +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericConsensus +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericConsensusEngineId +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericEvent +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericMultiAddress +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericSeal +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericSealV0 +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.H160 +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.H256 +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.H512 +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Null +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.OpaqueCall +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.SessionKeysSubstrate +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.i128 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.i16 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.i256 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.i32 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.i64 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.i8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u128 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u16 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u256 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u32 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u64 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.stub.FakeType + +typealias TypePresetBuilder = MutableMap +typealias TypePreset = Map + +fun TypePreset.newBuilder(): TypePresetBuilder = toMutableMap() + +fun TypePresetBuilder.type(type: Type<*>) { + val currentRef = getOrCreate(type.name) + + currentRef.value = type +} + +fun TypePresetBuilder.fakeType(name: String) { + type(FakeType(name)) +} + +fun TypePresetBuilder.alias(alias: String, original: String) { + val aliasedReference = getOrCreate(original) + + val typeAlias = Alias(alias, aliasedReference) + + type(typeAlias) +} + +fun TypePresetBuilder.getOrCreate(definition: String) = getOrPut(definition) { TypeReference(null) } + +fun TypePresetBuilder.create(definition: String): TypeReference = + TypeReference(null).also { put(definition, it) } + +fun createTypePresetBuilder(): TypePresetBuilder = mutableMapOf() + +fun typePreset(builder: TypePresetBuilder.() -> Unit): TypePreset { + return createTypePresetBuilder().apply(builder) +} + +fun v14Preset() = typePreset { + type(BooleanType) + + type(u8) + type(u16) + type(u32) + type(u64) + type(u128) + type(u256) + + type(i8) + type(i16) + type(i32) + type(i64) + type(i128) + type(i256) + + type(Bytes) + type(Null) + type(H256) + + type(GenericCall) + type(GenericEvent) + type(EraType) + + type(Data(this)) + type(GenericAccountId) + + alias("Balance", "u128") +} + +fun v13Preset(): TypePreset = typePreset { + type(BooleanType) + + type(u8) + type(u16) + type(u32) + type(u64) + type(u128) + type(u256) + + type(i8) + type(i16) + type(i32) + type(i64) + type(i128) + type(i256) + + type(GenericAccountId) + type(Null) + type(GenericCall) + + fakeType("GenericBlock") + + type(H160) + type(H256) + type(H512) + + alias("GenericVote", "u8") + + type(Bytes) + type(BitVec) + + type(Extrinsic) + + type(CallBytes) // seems to be unused in runtime + type(EraType) + type(Data(this)) + + alias("BoxProposal", "Proposal") + + type(GenericConsensusEngineId) + + type(SessionKeysSubstrate(this)) + + alias("GenericAccountIndex", "u32") + + type(GenericMultiAddress(this)) + + type(OpaqueCall) + + type(GenericEvent) + type(EventRecord(this)) + + alias("::Source", "LookupSource") + alias("U64", "u64") + alias("U32", "u32") + + alias("Bidkind", "BidKind") + + alias("AccountIdAddress", "GenericAccountId") + + alias("VoteWeight", "u128") + alias("PreRuntime", "GenericPreRuntime") + // todo replace with real type + fakeType("GenericPreRuntime") + type(GenericSealV0(this)) + type(GenericSeal(this)) + type(GenericConsensus(this)) +} + +fun TypePreset.unknownTypes() = entries + .mapNotNull { (name, typeRef) -> if (!typeRef.isResolved()) name else null } diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/TypeRegistry.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/TypeRegistry.kt similarity index 72% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/TypeRegistry.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/TypeRegistry.kt index 7a15ab02..9ab29658 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/TypeRegistry.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/TypeRegistry.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.registry - -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeResolver -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.preprocessors.RemoveGenericNoisePreprocessor -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.resolvedOrNull -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliases +package io.novasama.substrate_sdk_android.runtime.definitions.registry + +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeResolver +import io.novasama.substrate_sdk_android.runtime.definitions.registry.preprocessors.RemoveGenericNoisePreprocessor +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.resolvedOrNull +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliases interface RequestPreprocessor { diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/TypeRegistryExt.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/TypeRegistryExt.kt new file mode 100644 index 00000000..359403ee --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/TypeRegistryExt.kt @@ -0,0 +1,9 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.registry + +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type + +fun TypeRegistry.getOrThrow( + definition: String +): Type<*> { + return get(definition) ?: error("Type $definition was not found.") +} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/preprocessors/RemoveGenericNoisePreprocessor.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/preprocessors/RemoveGenericNoisePreprocessor.kt similarity index 62% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/preprocessors/RemoveGenericNoisePreprocessor.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/preprocessors/RemoveGenericNoisePreprocessor.kt index 3d4f9d0b..381ec3d1 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/preprocessors/RemoveGenericNoisePreprocessor.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/preprocessors/RemoveGenericNoisePreprocessor.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.registry.preprocessors +package io.novasama.substrate_sdk_android.runtime.definitions.registry.preprocessors -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.RequestPreprocessor +import io.novasama.substrate_sdk_android.runtime.definitions.registry.RequestPreprocessor object RemoveGenericNoisePreprocessor : RequestPreprocessor { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/Type.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/Type.kt similarity index 86% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/Type.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/Type.kt index 172a0d47..86ccc5c6 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/Type.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/Type.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types +package io.novasama.substrate_sdk_android.runtime.definitions.types import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException class TypeReference(var value: Type<*>?) { private var resolutionInProgress: Boolean = false diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/TypeExt.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/TypeExt.kt similarity index 84% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/TypeExt.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/TypeExt.kt index c535a92f..de613861 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/TypeExt.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/TypeExt.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types +package io.novasama.substrate_sdk_android.runtime.definitions.types import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.extensions.ensureExceptionType -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Alias -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.extensions.ensureExceptionType +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Alias +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException import java.io.ByteArrayOutputStream /** diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/TypeReferenceExt.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/TypeReferenceExt.kt similarity index 83% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/TypeReferenceExt.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/TypeReferenceExt.kt index c66c9100..0dfa8a96 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/TypeReferenceExt.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/TypeReferenceExt.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types +package io.novasama.substrate_sdk_android.runtime.definitions.types -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Alias +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Alias class CyclicAliasingException : Exception() diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Alias.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Alias.kt similarity index 72% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Alias.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Alias.kt index 57aa29d2..873614a2 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Alias.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Alias.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference class Alias(alias: String, val aliasedReference: TypeReference) : Type(alias) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/CollectionEnum.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/CollectionEnum.kt similarity index 72% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/CollectionEnum.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/CollectionEnum.kt index 9ecbf9a9..fcb81789 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/CollectionEnum.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/CollectionEnum.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.scale.dataType.CollectionEnumType +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.scale.dataType.CollectionEnumType class CollectionEnum( name: String, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/DictEnum.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/DictEnum.kt similarity index 83% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/DictEnum.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/DictEnum.kt index e6ab180a..136b9539 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/DictEnum.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/DictEnum.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliasesOrNull +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliasesOrNull @OptIn(ExperimentalUnsignedTypes::class) open class DictEnum( diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/FixedArray.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/FixedArray.kt similarity index 81% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/FixedArray.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/FixedArray.kt index e08713dd..9f8c9599 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/FixedArray.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/FixedArray.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference class FixedArray(name: String, val length: Int, typeReference: TypeReference) : WrapperType>(name, typeReference) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Option.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Option.kt similarity index 78% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Option.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Option.kt index 2ef9e308..b3ae1a16 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Option.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Option.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType class Option( name: String, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/SetType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/SetType.kt similarity index 79% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/SetType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/SetType.kt index 2b022ef5..ebc18d97 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/SetType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/SetType.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.hash.isPositive -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.NumberType +import io.novasama.substrate_sdk_android.hash.isPositive +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.NumberType import java.math.BigInteger class SetType( diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Struct.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Struct.kt similarity index 76% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Struct.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Struct.kt index 6e334e3b..da4e8441 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Struct.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Struct.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliases +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliases @Suppress("UNCHECKED_CAST") class Struct( diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Tuple.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Tuple.kt similarity index 72% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Tuple.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Tuple.kt index 6a4cda13..b22fb0e2 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Tuple.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Tuple.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliases -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliasesOrNull +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliases +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliasesOrNull class Tuple(name: String, val typeReferences: List) : Type>(name) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Vec.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Vec.kt similarity index 79% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Vec.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Vec.kt index 355eea97..02079ea4 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/Vec.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/Vec.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.scale.dataType.compactInt +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.scale.dataType.compactInt class Vec(name: String, typeReference: TypeReference) : WrapperType>(name, typeReference) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/WrapperType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/WrapperType.kt similarity index 53% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/WrapperType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/WrapperType.kt index f71dcf0d..73a00b42 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/WrapperType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/WrapperType.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliasesOrNull +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliasesOrNull abstract class WrapperType(name: String, val typeReference: TypeReference) : Type(name) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/errors/EncodeDecodeException.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/errors/EncodeDecodeException.kt similarity index 74% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/errors/EncodeDecodeException.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/errors/EncodeDecodeException.kt index dd808a30..b2083e78 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/errors/EncodeDecodeException.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/errors/EncodeDecodeException.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors +package io.novasama.substrate_sdk_android.runtime.definitions.types.errors class EncodeDecodeException( message: String? = null, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/BitVec.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/BitVec.kt similarity index 79% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/BitVec.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/BitVec.kt index 1dac3cb5..4d9c39c0 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/BitVec.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/BitVec.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.hash.isPositive -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.Primitive -import jp.co.soramitsu.fearless_utils.scale.dataType.compactInt -import jp.co.soramitsu.fearless_utils.scale.dataType.uint +import io.novasama.substrate_sdk_android.hash.isPositive +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.Primitive +import io.novasama.substrate_sdk_android.scale.dataType.compactInt +import io.novasama.substrate_sdk_android.scale.dataType.uint import java.math.BigInteger import kotlin.math.ceil diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Bytes.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Bytes.kt new file mode 100644 index 00000000..95501332 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Bytes.kt @@ -0,0 +1,5 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.DynamicByteArray + +val Bytes = DynamicByteArray("Bytes") diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/CallBytes.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/CallBytes.kt similarity index 64% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/CallBytes.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/CallBytes.kt index 15c50bd8..f8512614 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/CallBytes.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/CallBytes.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.Primitive -import jp.co.soramitsu.fearless_utils.scale.dataType.byteArraySized +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.Primitive +import io.novasama.substrate_sdk_android.scale.dataType.byteArraySized object CallBytes : Primitive("CallBytes") { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Data.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Data.kt similarity index 79% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Data.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Data.kt index bee36957..0fecd72d 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Data.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Data.kt @@ -1,15 +1,15 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.scale.dataType.byte -import jp.co.soramitsu.fearless_utils.scale.utils.directWrite +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.scale.dataType.byte +import io.novasama.substrate_sdk_android.scale.utils.directWrite class Data(preset: TypePresetBuilder) : DictEnum(TYPE_NAME, createMapping(preset)) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/DefaultSignedExtensions.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/DefaultSignedExtensions.kt similarity index 57% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/DefaultSignedExtensions.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/DefaultSignedExtensions.kt index 32690a8f..997302c1 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/DefaultSignedExtensions.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/DefaultSignedExtensions.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.Compact -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u32 -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionMetadata.Companion.onlyAdditional -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionMetadata.Companion.onlySigned +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.Compact +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u32 +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionMetadata.Companion.onlyAdditional +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionMetadata.Companion.onlySigned object DefaultSignedExtensions { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Era.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Era.kt similarity index 85% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Era.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Era.kt index 8341eec7..99e8e318 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Era.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Era.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.extensions.toHex -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.Primitive -import jp.co.soramitsu.fearless_utils.scale.dataType.byte -import jp.co.soramitsu.fearless_utils.scale.dataType.uint16 +import io.novasama.substrate_sdk_android.extensions.toHex +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.Primitive +import io.novasama.substrate_sdk_android.scale.dataType.byte +import io.novasama.substrate_sdk_android.scale.dataType.uint16 import kotlin.math.ceil import kotlin.math.log2 import kotlin.math.max diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/EventRecord.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/EventRecord.kt new file mode 100644 index 00000000..aeb14f37 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/EventRecord.kt @@ -0,0 +1,22 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Vec + +@Suppress("FunctionName") +fun EventRecord(typePresetBuilder: TypePresetBuilder) = Struct( + name = "EventRecord", + mapping = linkedMapOf( + "phase" to typePresetBuilder.getOrCreate("Phase"), + "event" to typePresetBuilder.getOrCreate("GenericEvent"), + "topics" to TypeReference( + Vec( + name = "Vec", + typeReference = typePresetBuilder.getOrCreate("Hash") + ) + ) + ) +) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Extrinsic.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Extrinsic.kt similarity index 86% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Extrinsic.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Extrinsic.kt index dbc4d517..ce764991 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Extrinsic.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Extrinsic.kt @@ -1,17 +1,17 @@ @file:Suppress("EXPERIMENTAL_API_USAGE") // unsigned types -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.bytes -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toByteArray -import jp.co.soramitsu.fearless_utils.scale.dataType.byte -import jp.co.soramitsu.fearless_utils.scale.dataType.compactInt +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.bytes +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.definitions.types.toByteArray +import io.novasama.substrate_sdk_android.scale.dataType.byte +import io.novasama.substrate_sdk_android.scale.dataType.compactInt private val SIGNED_MASK = 0b1000_0000.toUByte() diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ExtrinsicExt.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ExtrinsicExt.kt similarity index 87% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ExtrinsicExt.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ExtrinsicExt.kt index 89440c1c..f91d2dce 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ExtrinsicExt.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ExtrinsicExt.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.encrypt.EncryptionType +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum class MultiSignature(val encryptionType: EncryptionType, val value: ByteArray) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ExtrinsicPayloadExtras.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ExtrinsicPayloadExtras.kt similarity index 79% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ExtrinsicPayloadExtras.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ExtrinsicPayloadExtras.kt index 992b1c51..2108cfb5 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ExtrinsicPayloadExtras.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ExtrinsicPayloadExtras.kt @@ -1,14 +1,14 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.isEmptyStruct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.isEmptyTuple -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionId -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionMetadata +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.isEmptyStruct +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.isEmptyTuple +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionId +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionMetadata object SignedExtras : ExtrinsicPayloadExtras("ExtrinsicPayloadExtras.SignedExtras") { diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericAccountId.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericAccountId.kt new file mode 100644 index 00000000..b60cc30c --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericAccountId.kt @@ -0,0 +1,5 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray + +object GenericAccountId : FixedByteArray("GenericAccountId", 32) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericCall.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericCall.kt similarity index 74% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericCall.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericCall.kt index 7f4bd6b9..cefdf7c0 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericCall.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericCall.kt @@ -1,17 +1,17 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.metadata.callOrNull -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.FunctionArgument -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.MetadataFunction -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Module -import jp.co.soramitsu.fearless_utils.runtime.metadata.moduleOrNull -import jp.co.soramitsu.fearless_utils.scale.dataType.tuple -import jp.co.soramitsu.fearless_utils.scale.dataType.uint8 +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.metadata.callOrNull +import io.novasama.substrate_sdk_android.runtime.metadata.module.FunctionArgument +import io.novasama.substrate_sdk_android.runtime.metadata.module.MetadataFunction +import io.novasama.substrate_sdk_android.runtime.metadata.module.Module +import io.novasama.substrate_sdk_android.runtime.metadata.moduleOrNull +import io.novasama.substrate_sdk_android.scale.dataType.tuple +import io.novasama.substrate_sdk_android.scale.dataType.uint8 object GenericCall : Type("GenericCall") { diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericConsensusEngineId.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericConsensusEngineId.kt new file mode 100644 index 00000000..d37403a5 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericConsensusEngineId.kt @@ -0,0 +1,24 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Vec +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray + +val GenericConsensusEngineId = FixedByteArray("GenericConsensusEngineId", 4) + +@Suppress("FunctionName") +fun GenericConsensus(typePresetBuilder: TypePresetBuilder) = Struct( + name = "GenericConsensus", + mapping = linkedMapOf( + "engine" to typePresetBuilder.getOrCreate("ConsensusEngineId"), + "data" to TypeReference( + Vec( + name = "Vec", + typeReference = typePresetBuilder.getOrCreate("u8") + ) + ) + ) +) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericEvent.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericEvent.kt similarity index 74% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericEvent.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericEvent.kt index 050c0880..9754ac57 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericEvent.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericEvent.kt @@ -1,17 +1,17 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.metadata.eventOrNull -import jp.co.soramitsu.fearless_utils.runtime.metadata.fullNameOf -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Event -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Module -import jp.co.soramitsu.fearless_utils.runtime.metadata.moduleOrNull -import jp.co.soramitsu.fearless_utils.scale.dataType.tuple -import jp.co.soramitsu.fearless_utils.scale.dataType.uint8 +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.metadata.eventOrNull +import io.novasama.substrate_sdk_android.runtime.metadata.fullNameOf +import io.novasama.substrate_sdk_android.runtime.metadata.module.Event +import io.novasama.substrate_sdk_android.runtime.metadata.module.Module +import io.novasama.substrate_sdk_android.runtime.metadata.moduleOrNull +import io.novasama.substrate_sdk_android.scale.dataType.tuple +import io.novasama.substrate_sdk_android.scale.dataType.uint8 @OptIn(ExperimentalUnsignedTypes::class) object GenericEvent : Type("GenericEvent") { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericMultiAddress.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericMultiAddress.kt similarity index 54% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericMultiAddress.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericMultiAddress.kt index 1b11a452..64f36d2f 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericMultiAddress.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericMultiAddress.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.Compact +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.Compact const val MULTI_ADDRESS_ID = "Id" diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericSeal.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericSeal.kt similarity index 62% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericSeal.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericSeal.kt index 2c3146d1..4d3af61a 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericSeal.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericSeal.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct @Suppress("FunctionName") fun GenericSealV0(typePresetBuilder: TypePresetBuilder) = Struct( diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Hash.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Hash.kt similarity index 52% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Hash.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Hash.kt index d25053e0..9e273f3d 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Hash.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Hash.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.FixedByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray val H160 = Hash(160) val H256 = Hash(256) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Null.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Null.kt similarity index 59% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Null.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Null.kt index 74fcf551..7a056158 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/Null.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/Null.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.Primitive -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliases +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.Primitive +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliases object Null : Primitive("Null") { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/OpaqueCall.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/OpaqueCall.kt similarity index 69% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/OpaqueCall.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/OpaqueCall.kt index 7d978119..55103eea 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/OpaqueCall.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/OpaqueCall.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toByteArray +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.toByteArray object OpaqueCall : Type("OpaqueCall") { diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ResultType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ResultType.kt new file mode 100644 index 00000000..72a92f12 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ResultType.kt @@ -0,0 +1,18 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum + +class ResultType(ok: TypeReference, err: TypeReference) : DictEnum( + "Result", + listOf( + Entry(Ok, ok), + Entry(Err, err) + ) +) { + + companion object { + const val Ok = "Ok" + const val Err = "Err" + } +} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/SessionKeysSubstrate.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/SessionKeysSubstrate.kt similarity index 52% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/SessionKeysSubstrate.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/SessionKeysSubstrate.kt index bb84a4d8..bb9964ce 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/SessionKeysSubstrate.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/SessionKeysSubstrate.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct @Suppress("FunctionName") fun SessionKeysSubstrate(typePresetBuilder: TypePresetBuilder) = Struct( diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/instances/AddressInstanceConstructor.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/instances/AddressInstanceConstructor.kt new file mode 100644 index 00000000..c2f43000 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/instances/AddressInstanceConstructor.kt @@ -0,0 +1,24 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.types.instances + +import io.novasama.substrate_sdk_android.runtime.AccountId +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrThrow +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.MULTI_ADDRESS_ID +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray + +object AddressInstanceConstructor : RuntimeType.InstanceConstructor { + + override fun constructInstance(typeRegistry: TypeRegistry, value: AccountId): Any { + return when (val addressType = typeRegistry.getOrThrow(ExtrinsicTypes.ADDRESS)) { + is DictEnum -> { // MultiAddress + DictEnum.Entry(MULTI_ADDRESS_ID, value) + } + is FixedByteArray -> { // GenericAccountId or similar + value + } + else -> throw UnsupportedOperationException("Unknown address type: ${addressType.name}") + } + } +} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/instances/ExtrinsicTypes.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/instances/ExtrinsicTypes.kt similarity index 58% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/instances/ExtrinsicTypes.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/instances/ExtrinsicTypes.kt index c18d2cc8..0e1f9946 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/instances/ExtrinsicTypes.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/instances/ExtrinsicTypes.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.instances +package io.novasama.substrate_sdk_android.runtime.definitions.types.instances object ExtrinsicTypes { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/instances/SignatureInstanceConstructor.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/instances/SignatureInstanceConstructor.kt similarity index 52% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/instances/SignatureInstanceConstructor.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/instances/SignatureInstanceConstructor.kt index 8f9ea519..26e6879f 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/instances/SignatureInstanceConstructor.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/instances/SignatureInstanceConstructor.kt @@ -1,16 +1,16 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.instances +package io.novasama.substrate_sdk_android.runtime.definitions.types.instances -import jp.co.soramitsu.fearless_utils.encrypt.SignatureWrapper -import jp.co.soramitsu.fearless_utils.encrypt.vByte -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrThrow -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.MultiSignature -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.prepareForEncoding -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.FixedByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliases +import io.novasama.substrate_sdk_android.encrypt.SignatureWrapper +import io.novasama.substrate_sdk_android.encrypt.vByte +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrThrow +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.MultiSignature +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.prepareForEncoding +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliases object SignatureInstanceConstructor : RuntimeType.InstanceConstructor { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/BooleanType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/BooleanType.kt similarity index 79% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/BooleanType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/BooleanType.kt index ccce5182..c8dbbcb5 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/BooleanType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/BooleanType.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives +package io.novasama.substrate_sdk_android.runtime.definitions.types.primitives import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot object BooleanType : Primitive("bool") { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/Compact.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/Compact.kt similarity index 70% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/Compact.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/Compact.kt index 0475f9c8..59ff9346 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/Compact.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/Compact.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives +package io.novasama.substrate_sdk_android.runtime.definitions.types.primitives import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.scale.dataType.compactInt +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.scale.dataType.compactInt import java.math.BigInteger class Compact(name: String) : NumberType(name) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/DynamicByteArray.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/DynamicByteArray.kt similarity index 74% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/DynamicByteArray.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/DynamicByteArray.kt index 7c2662c6..cfb9fb50 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/DynamicByteArray.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/DynamicByteArray.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives +package io.novasama.substrate_sdk_android.runtime.definitions.types.primitives import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.scale.dataType.byteArray +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.scale.dataType.byteArray class DynamicByteArray(name: String) : Primitive(name) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/FixedByteArray.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/FixedByteArray.kt similarity index 82% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/FixedByteArray.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/FixedByteArray.kt index 32e2ada4..5bd9bbd2 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/FixedByteArray.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/FixedByteArray.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives +package io.novasama.substrate_sdk_android.runtime.definitions.types.primitives import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot open class FixedByteArray(name: String, val length: Int) : Primitive(name) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/IntType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/IntType.kt similarity index 73% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/IntType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/IntType.kt index 837da561..33717698 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/IntType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/IntType.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives +package io.novasama.substrate_sdk_android.runtime.definitions.types.primitives import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.extensions.fromSignedBytes -import jp.co.soramitsu.fearless_utils.extensions.toSignedBytes -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.scale.utils.directWrite +import io.novasama.substrate_sdk_android.extensions.fromSignedBytes +import io.novasama.substrate_sdk_android.extensions.toSignedBytes +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.scale.utils.directWrite import java.math.BigInteger import java.nio.ByteOrder diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/NumberType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/NumberType.kt similarity index 72% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/NumberType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/NumberType.kt index 23c25b01..c56ed09e 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/NumberType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/NumberType.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives +package io.novasama.substrate_sdk_android.runtime.definitions.types.primitives import java.math.BigInteger diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/Primitive.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/Primitive.kt new file mode 100644 index 00000000..f5eb9ac6 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/Primitive.kt @@ -0,0 +1,8 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.types.primitives + +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type + +abstract class Primitive(name: String) : Type(name) { + + override val isFullyResolved = true +} diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/UIntType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/UIntType.kt similarity index 77% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/UIntType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/UIntType.kt index 26f26197..cb09e0d7 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/UIntType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/UIntType.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives +package io.novasama.substrate_sdk_android.runtime.definitions.types.primitives import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.scale.dataType.uint +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.scale.dataType.uint import java.math.BigInteger val u8 = UIntType(8) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/stub/FakeType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/stub/FakeType.kt similarity index 73% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/stub/FakeType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/stub/FakeType.kt index 535c0593..98126378 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/stub/FakeType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/types/stub/FakeType.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.stub +package io.novasama.substrate_sdk_android.runtime.definitions.types.stub import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type class FakeType(name: String) : Type(name) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/TypesParserV14.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/TypesParserV14.kt similarity index 77% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/TypesParserV14.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/TypesParserV14.kt index 3ff9febc..020b2065 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/TypesParserV14.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/TypesParserV14.kt @@ -1,39 +1,38 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.v14 - -import jp.co.soramitsu.fearless_utils.extensions.snakeCaseToCamelCase -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePreset -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.alias -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.newBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Alias -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.FixedArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Tuple -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Vec -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Bytes -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Null -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.Compact -import jp.co.soramitsu.fearless_utils.runtime.definitions.v14.TypesParserV14.pathNameIfWhitelisted -import jp.co.soramitsu.fearless_utils.runtime.definitions.v14.typeMapping.SiTypeMapping -import jp.co.soramitsu.fearless_utils.runtime.definitions.v14.typeMapping.default -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.LookupSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PortableType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.RegistryType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefArray -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefBitSequence -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefCompact -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefComposite -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefCompositeField -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefEnum -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefSequence -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefVariant -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefVariantItem -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct +package io.novasama.substrate_sdk_android.runtime.definitions.v14 + +import io.novasama.substrate_sdk_android.extensions.snakeCaseToCamelCase +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePreset +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.alias +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.registry.newBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.type +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Alias +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.FixedArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Tuple +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Vec +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Bytes +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Null +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.Compact +import io.novasama.substrate_sdk_android.runtime.definitions.v14.typeMapping.SiTypeMapping +import io.novasama.substrate_sdk_android.runtime.definitions.v14.typeMapping.default +import io.novasama.substrate_sdk_android.runtime.metadata.v14.LookupSchema +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PortableType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.RegistryType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefArray +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefBitSequence +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefCompact +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefComposite +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefCompositeField +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefEnum +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefSequence +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefVariant +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefVariantItem +import io.novasama.substrate_sdk_android.scale.EncodableStruct @OptIn(ExperimentalUnsignedTypes::class) object TypesParserV14 { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/AddExtrinsicTypesSiTypeMapping.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/AddExtrinsicTypesSiTypeMapping.kt similarity index 67% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/AddExtrinsicTypesSiTypeMapping.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/AddExtrinsicTypesSiTypeMapping.kt index 81baa959..878bac84 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/AddExtrinsicTypesSiTypeMapping.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/AddExtrinsicTypesSiTypeMapping.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.v14.typeMapping - -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.alias -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.instances.ExtrinsicTypes -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PortableType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.paramType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.type -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct +package io.novasama.substrate_sdk_android.runtime.definitions.v14.typeMapping + +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.alias +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.instances.ExtrinsicTypes +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PortableType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.paramType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.type +import io.novasama.substrate_sdk_android.scale.EncodableStruct private const val UNCHECKED_EXTRINSIC_TYPE = "sp_runtime.generic.unchecked_extrinsic.UncheckedExtrinsic" diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/AddRuntimeDispatchInfoSiTypeMapping.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/AddRuntimeDispatchInfoSiTypeMapping.kt similarity index 63% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/AddRuntimeDispatchInfoSiTypeMapping.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/AddRuntimeDispatchInfoSiTypeMapping.kt index bb1f23e5..5ea53806 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/AddRuntimeDispatchInfoSiTypeMapping.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/AddRuntimeDispatchInfoSiTypeMapping.kt @@ -1,17 +1,17 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.v14.typeMapping +package io.novasama.substrate_sdk_android.runtime.definitions.v14.typeMapping -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PortableType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefComposite -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.asCompositeOrNull -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.fieldType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.type -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.registry.type +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PortableType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefComposite +import io.novasama.substrate_sdk_android.runtime.metadata.v14.asCompositeOrNull +import io.novasama.substrate_sdk_android.runtime.metadata.v14.fieldType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.type +import io.novasama.substrate_sdk_android.scale.EncodableStruct private const val DISPATCH_INFO_TYPE = "frame_support.dispatch.DispatchInfo" diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/PathMatchTypeMapping.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/PathMatchTypeMapping.kt similarity index 79% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/PathMatchTypeMapping.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/PathMatchTypeMapping.kt index 8b6c88b1..fcecab90 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/PathMatchTypeMapping.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/PathMatchTypeMapping.kt @@ -1,14 +1,14 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.v14.typeMapping - -import jp.co.soramitsu.fearless_utils.extensions.tryFindNonNull -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.aliasedAs -import jp.co.soramitsu.fearless_utils.runtime.definitions.v14.typeMapping.PathMatchTypeMapping.Matcher -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PortableType -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct +package io.novasama.substrate_sdk_android.runtime.definitions.v14.typeMapping + +import io.novasama.substrate_sdk_android.extensions.tryFindNonNull +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.aliasedAs +import io.novasama.substrate_sdk_android.runtime.definitions.v14.typeMapping.PathMatchTypeMapping.Matcher +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PortableType +import io.novasama.substrate_sdk_android.scale.EncodableStruct typealias PathMatchTypeMappingReplacement = Pair diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/SiTypeMapping.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/SiTypeMapping.kt similarity index 75% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/SiTypeMapping.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/SiTypeMapping.kt index 8e40db68..3131d360 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/definitions/v14/typeMapping/SiTypeMapping.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/definitions/v14/typeMapping/SiTypeMapping.kt @@ -1,31 +1,31 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.v14.typeMapping - -import jp.co.soramitsu.fearless_utils.extensions.tryFindNonNull -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.getOrCreate -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Alias -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Option -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.SetType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.aliasedAs -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.DynamicByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.FixedByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliases -import jp.co.soramitsu.fearless_utils.runtime.definitions.v14.typeMapping.PathMatchTypeMapping.Replacement.AliasTo -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PortableType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.RegistryType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefArray -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefComposite -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeDefSequence -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.TypeParameter -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.def -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.name -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.params -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.path -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.type -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct +package io.novasama.substrate_sdk_android.runtime.definitions.v14.typeMapping + +import io.novasama.substrate_sdk_android.extensions.tryFindNonNull +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.registry.getOrCreate +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Alias +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Option +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.SetType +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.aliasedAs +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.DynamicByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliases +import io.novasama.substrate_sdk_android.runtime.definitions.v14.typeMapping.PathMatchTypeMapping.Replacement.AliasTo +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PortableType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.RegistryType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefArray +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefComposite +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeDefSequence +import io.novasama.substrate_sdk_android.runtime.metadata.v14.TypeParameter +import io.novasama.substrate_sdk_android.runtime.metadata.v14.def +import io.novasama.substrate_sdk_android.runtime.metadata.v14.name +import io.novasama.substrate_sdk_android.runtime.metadata.v14.params +import io.novasama.substrate_sdk_android.runtime.metadata.v14.path +import io.novasama.substrate_sdk_android.runtime.metadata.v14.type +import io.novasama.substrate_sdk_android.scale.EncodableStruct import java.math.BigInteger interface SiTypeMapping { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/BatchMode.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/BatchMode.kt similarity index 86% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/BatchMode.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/BatchMode.kt index eef98ba7..d4fd39bd 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/BatchMode.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/BatchMode.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.runtime.extrinsic +package io.novasama.substrate_sdk_android.runtime.extrinsic enum class BatchMode { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/ExtrinsicBuilder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/ExtrinsicBuilder.kt similarity index 78% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/ExtrinsicBuilder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/ExtrinsicBuilder.kt index 1fb02f57..258ab090 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/ExtrinsicBuilder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/ExtrinsicBuilder.kt @@ -1,28 +1,28 @@ -package jp.co.soramitsu.fearless_utils.runtime.extrinsic - -import jp.co.soramitsu.fearless_utils.encrypt.SignatureWrapper -import jp.co.soramitsu.fearless_utils.runtime.AccountId -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.DefaultSignedExtensions -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Era -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Extrinsic -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Extrinsic.EncodingInstance.CallRepresentation -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.ExtrinsicPayloadExtrasInstance -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericCall -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.new -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.instances.AddressInstanceConstructor -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.instances.SignatureInstanceConstructor -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHexUntyped -import jp.co.soramitsu.fearless_utils.runtime.extrinsic.signer.SignedExtrinsic -import jp.co.soramitsu.fearless_utils.runtime.extrinsic.signer.Signer -import jp.co.soramitsu.fearless_utils.runtime.extrinsic.signer.SignerPayloadExtrinsic -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionId -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionValue -import jp.co.soramitsu.fearless_utils.runtime.metadata.call -import jp.co.soramitsu.fearless_utils.runtime.metadata.module -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.chain.RuntimeVersion +package io.novasama.substrate_sdk_android.runtime.extrinsic + +import io.novasama.substrate_sdk_android.encrypt.SignatureWrapper +import io.novasama.substrate_sdk_android.runtime.AccountId +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.DefaultSignedExtensions +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Era +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Extrinsic +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Extrinsic.EncodingInstance.CallRepresentation +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.ExtrinsicPayloadExtrasInstance +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericCall +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.new +import io.novasama.substrate_sdk_android.runtime.definitions.types.instances.AddressInstanceConstructor +import io.novasama.substrate_sdk_android.runtime.definitions.types.instances.SignatureInstanceConstructor +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHexUntyped +import io.novasama.substrate_sdk_android.runtime.extrinsic.signer.SignedExtrinsic +import io.novasama.substrate_sdk_android.runtime.extrinsic.signer.Signer +import io.novasama.substrate_sdk_android.runtime.extrinsic.signer.SignerPayloadExtrinsic +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionId +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionValue +import io.novasama.substrate_sdk_android.runtime.metadata.call +import io.novasama.substrate_sdk_android.runtime.metadata.module +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.chain.RuntimeVersion import java.math.BigInteger private val DEFAULT_TIP = BigInteger.ZERO diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/ExtrinsicBuilderExt.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/ExtrinsicBuilderExt.kt similarity index 56% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/ExtrinsicBuilderExt.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/ExtrinsicBuilderExt.kt index 4ecd8b69..ba544cb3 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/ExtrinsicBuilderExt.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/ExtrinsicBuilderExt.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.runtime.extrinsic - -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.DefaultSignedExtensions -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliases -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionId -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionValue -import jp.co.soramitsu.fearless_utils.runtime.metadata.findSignedExtension +package io.novasama.substrate_sdk_android.runtime.extrinsic + +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.DefaultSignedExtensions +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliases +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionId +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionValue +import io.novasama.substrate_sdk_android.runtime.metadata.findSignedExtension import java.math.BigInteger fun ExtrinsicBuilder.signedExtra(id: SignedExtensionId, value: Any?) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/Nonce.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/Nonce.kt similarity index 92% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/Nonce.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/Nonce.kt index a6ec4e28..5b90f7a8 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/Nonce.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/Nonce.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.runtime.extrinsic +package io.novasama.substrate_sdk_android.runtime.extrinsic import java.math.BigInteger diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/signer/KeyPairSigner.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/signer/KeyPairSigner.kt similarity index 75% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/signer/KeyPairSigner.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/signer/KeyPairSigner.kt index ad4d5fb9..8702875d 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/signer/KeyPairSigner.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/signer/KeyPairSigner.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.extrinsic.signer +package io.novasama.substrate_sdk_android.runtime.extrinsic.signer -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.keypair.Keypair -import jp.co.soramitsu.fearless_utils.encrypt.Signer as MessageSigner +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.keypair.Keypair +import io.novasama.substrate_sdk_android.encrypt.Signer as MessageSigner class KeyPairSigner( private val keypair: Keypair, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/signer/Signer.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/signer/Signer.kt similarity index 70% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/signer/Signer.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/signer/Signer.kt index f43bbbc5..b28521f5 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/signer/Signer.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/signer/Signer.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.extrinsic.signer - -import jp.co.soramitsu.fearless_utils.encrypt.SignatureWrapper -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.runtime.AccountId -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Extrinsic.EncodingInstance.CallRepresentation -import jp.co.soramitsu.fearless_utils.runtime.extrinsic.Nonce +package io.novasama.substrate_sdk_android.runtime.extrinsic.signer + +import io.novasama.substrate_sdk_android.encrypt.SignatureWrapper +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.runtime.AccountId +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Extrinsic.EncodingInstance.CallRepresentation +import io.novasama.substrate_sdk_android.runtime.extrinsic.Nonce class SignedExtrinsic( val payload: SignerPayloadExtrinsic, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/signer/SignerExt.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/signer/SignerExt.kt similarity index 66% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/signer/SignerExt.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/signer/SignerExt.kt index e844357c..6760d098 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/signer/SignerExt.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/extrinsic/signer/SignerExt.kt @@ -1,14 +1,14 @@ -package jp.co.soramitsu.fearless_utils.runtime.extrinsic.signer +package io.novasama.substrate_sdk_android.runtime.extrinsic.signer import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b256 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.AdditionalSignedExtras -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.DefaultSignedExtensions -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Extrinsic -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericCall -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.SignedExtras -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.useScaleWriter -import jp.co.soramitsu.fearless_utils.scale.utils.directWrite +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b256 +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.AdditionalSignedExtras +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.DefaultSignedExtensions +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Extrinsic +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericCall +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.SignedExtras +import io.novasama.substrate_sdk_android.runtime.definitions.types.useScaleWriter +import io.novasama.substrate_sdk_android.scale.utils.directWrite private const val PAYLOAD_HASH_THRESHOLD = 256 diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/GetMetadataRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/GetMetadataRequest.kt new file mode 100644 index 00000000..0fbd6a23 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/GetMetadataRequest.kt @@ -0,0 +1,5 @@ +package io.novasama.substrate_sdk_android.runtime.metadata + +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest + +object GetMetadataRequest : RuntimeRequest("state_getMetadata", listOf()) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadata.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadata.kt similarity index 84% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadata.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadata.kt index 11fc9539..047aee39 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadata.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadata.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata +package io.novasama.substrate_sdk_android.runtime.metadata -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Null -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Module +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Null +import io.novasama.substrate_sdk_android.runtime.metadata.module.Module import java.math.BigInteger interface WithName { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataExt.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataExt.kt similarity index 89% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataExt.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataExt.kt index 17ef1381..eb9bd384 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataExt.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataExt.kt @@ -1,18 +1,18 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata +package io.novasama.substrate_sdk_android.runtime.metadata import io.emeraldpay.polkaj.scale.ScaleCodecReader -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.hash.Hasher.xxHash128 -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.RuntimeType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.bytes -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Event -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.MetadataFunction -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Module -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntry -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntryType +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.hash.Hasher.xxHash128 +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.RuntimeType +import io.novasama.substrate_sdk_android.runtime.definitions.types.bytes +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.metadata.module.Event +import io.novasama.substrate_sdk_android.runtime.metadata.module.MetadataFunction +import io.novasama.substrate_sdk_android.runtime.metadata.module.Module +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntry +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntryType import java.io.ByteArrayOutputStream /** diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataSchema.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataSchema.kt similarity index 77% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataSchema.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataSchema.kt index 5d2be7d2..acbed650 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataSchema.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataSchema.kt @@ -1,22 +1,22 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata - -import jp.co.soramitsu.fearless_utils.hash.Hasher -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b128 -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b128Concat -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b256 -import jp.co.soramitsu.fearless_utils.hash.hashConcat -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct -import jp.co.soramitsu.fearless_utils.scale.Schema -import jp.co.soramitsu.fearless_utils.scale.bool -import jp.co.soramitsu.fearless_utils.scale.byteArray -import jp.co.soramitsu.fearless_utils.scale.dataType.EnumType -import jp.co.soramitsu.fearless_utils.scale.dataType.scalable -import jp.co.soramitsu.fearless_utils.scale.enum -import jp.co.soramitsu.fearless_utils.scale.schema -import jp.co.soramitsu.fearless_utils.scale.string -import jp.co.soramitsu.fearless_utils.scale.uint8 -import jp.co.soramitsu.fearless_utils.scale.vector -import jp.co.soramitsu.fearless_utils.scale.dataType.string as stringType +package io.novasama.substrate_sdk_android.runtime.metadata + +import io.novasama.substrate_sdk_android.hash.Hasher +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b128 +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b128Concat +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b256 +import io.novasama.substrate_sdk_android.hash.hashConcat +import io.novasama.substrate_sdk_android.scale.EncodableStruct +import io.novasama.substrate_sdk_android.scale.Schema +import io.novasama.substrate_sdk_android.scale.bool +import io.novasama.substrate_sdk_android.scale.byteArray +import io.novasama.substrate_sdk_android.scale.dataType.EnumType +import io.novasama.substrate_sdk_android.scale.dataType.scalable +import io.novasama.substrate_sdk_android.scale.enum +import io.novasama.substrate_sdk_android.scale.schema +import io.novasama.substrate_sdk_android.scale.string +import io.novasama.substrate_sdk_android.scale.uint8 +import io.novasama.substrate_sdk_android.scale.vector +import io.novasama.substrate_sdk_android.scale.dataType.string as stringType object RuntimeMetadataSchema : Schema() { val modules by vector(ModuleMetadataSchema) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataTopReader.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataTopReader.kt similarity index 70% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataTopReader.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataTopReader.kt index ce837ed9..b0d4753d 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataTopReader.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataTopReader.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata +package io.novasama.substrate_sdk_android.runtime.metadata import io.emeraldpay.polkaj.scale.ScaleCodecReader -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.RuntimeMetadataSchemaV14 -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct -import jp.co.soramitsu.fearless_utils.scale.Schema -import jp.co.soramitsu.fearless_utils.scale.uint32 -import jp.co.soramitsu.fearless_utils.scale.uint8 +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.runtime.metadata.v14.RuntimeMetadataSchemaV14 +import io.novasama.substrate_sdk_android.scale.EncodableStruct +import io.novasama.substrate_sdk_android.scale.Schema +import io.novasama.substrate_sdk_android.scale.uint32 +import io.novasama.substrate_sdk_android.scale.uint8 object Magic : Schema() { val magicNumber by uint32() diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/builder/RuntimeBuilder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/builder/RuntimeBuilder.kt similarity index 60% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/builder/RuntimeBuilder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/builder/RuntimeBuilder.kt index c92af083..3c47589e 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/builder/RuntimeBuilder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/builder/RuntimeBuilder.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata.builder +package io.novasama.substrate_sdk_android.runtime.metadata.builder -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.DefaultSignedExtensions -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadataReader -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionMetadata +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.DefaultSignedExtensions +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadataReader +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionMetadata interface RuntimeBuilder { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/builder/V13RuntimeBuilder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/builder/V13RuntimeBuilder.kt similarity index 77% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/builder/V13RuntimeBuilder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/builder/V13RuntimeBuilder.kt index 2abac11d..663067eb 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/builder/V13RuntimeBuilder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/builder/V13RuntimeBuilder.kt @@ -1,34 +1,34 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata.builder - -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.metadata.DoubleMapSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.ErrorMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.EventMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.ExtrinsicMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.ExtrinsicMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.FunctionArgumentMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.FunctionMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.MapSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.ModuleConstantMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.ModuleMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.NMapSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadataReader -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.StorageEntryMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.StorageMetadataSchema -import jp.co.soramitsu.fearless_utils.runtime.metadata.groupByName -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Constant -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Error -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Event -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.FunctionArgument -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.MetadataFunction -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Module -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Storage -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntry -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntryType -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct +package io.novasama.substrate_sdk_android.runtime.metadata.builder + +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.metadata.DoubleMapSchema +import io.novasama.substrate_sdk_android.runtime.metadata.ErrorMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.EventMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.ExtrinsicMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.ExtrinsicMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.FunctionArgumentMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.FunctionMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.MapSchema +import io.novasama.substrate_sdk_android.runtime.metadata.ModuleConstantMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.ModuleMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.NMapSchema +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadataReader +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.StorageEntryMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.StorageMetadataSchema +import io.novasama.substrate_sdk_android.runtime.metadata.groupByName +import io.novasama.substrate_sdk_android.runtime.metadata.module.Constant +import io.novasama.substrate_sdk_android.runtime.metadata.module.Error +import io.novasama.substrate_sdk_android.runtime.metadata.module.Event +import io.novasama.substrate_sdk_android.runtime.metadata.module.FunctionArgument +import io.novasama.substrate_sdk_android.runtime.metadata.module.MetadataFunction +import io.novasama.substrate_sdk_android.runtime.metadata.module.Module +import io.novasama.substrate_sdk_android.runtime.metadata.module.Storage +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntry +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntryType +import io.novasama.substrate_sdk_android.scale.EncodableStruct @OptIn(ExperimentalUnsignedTypes::class) internal object V13RuntimeBuilder : RuntimeBuilder { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/builder/V14RuntimeBuilder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/builder/V14RuntimeBuilder.kt similarity index 74% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/builder/V14RuntimeBuilder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/builder/V14RuntimeBuilder.kt index c554c906..863ce9ee 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/builder/V14RuntimeBuilder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/builder/V14RuntimeBuilder.kt @@ -1,39 +1,39 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata.builder - -import jp.co.soramitsu.fearless_utils.extensions.requireOrException -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Tuple -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Null -import jp.co.soramitsu.fearless_utils.runtime.metadata.ExtrinsicMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadataReader -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.groupByName -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Constant -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Error -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Event -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.FunctionArgument -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.MetadataFunction -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Module -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Storage -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntry -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntryType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.ExtrinsicMetadataV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.MapTypeV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PalletCallMetadataV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PalletConstantMetadataV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PalletErrorMetadataV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PalletEventMetadataV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.PalletMetadataV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.RuntimeMetadataSchemaV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.SignedExtensionMetadataV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.StorageEntryMetadataV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.StorageMetadataV14 -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct +package io.novasama.substrate_sdk_android.runtime.metadata.builder + +import io.novasama.substrate_sdk_android.extensions.requireOrException +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Tuple +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Null +import io.novasama.substrate_sdk_android.runtime.metadata.ExtrinsicMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadataReader +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.groupByName +import io.novasama.substrate_sdk_android.runtime.metadata.module.Constant +import io.novasama.substrate_sdk_android.runtime.metadata.module.Error +import io.novasama.substrate_sdk_android.runtime.metadata.module.Event +import io.novasama.substrate_sdk_android.runtime.metadata.module.FunctionArgument +import io.novasama.substrate_sdk_android.runtime.metadata.module.MetadataFunction +import io.novasama.substrate_sdk_android.runtime.metadata.module.Module +import io.novasama.substrate_sdk_android.runtime.metadata.module.Storage +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntry +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntryType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.ExtrinsicMetadataV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.MapTypeV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PalletCallMetadataV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PalletConstantMetadataV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PalletErrorMetadataV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PalletEventMetadataV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.PalletMetadataV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.RuntimeMetadataSchemaV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.SignedExtensionMetadataV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.StorageEntryMetadataV14 +import io.novasama.substrate_sdk_android.runtime.metadata.v14.StorageMetadataV14 +import io.novasama.substrate_sdk_android.scale.EncodableStruct import java.math.BigInteger @OptIn(ExperimentalUnsignedTypes::class) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/module/RuntimeMetadataModule.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/module/RuntimeMetadataModule.kt similarity index 81% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/module/RuntimeMetadataModule.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/module/RuntimeMetadataModule.kt index 06228ab9..ee3308d7 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/module/RuntimeMetadataModule.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/module/RuntimeMetadataModule.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata.module +package io.novasama.substrate_sdk_android.runtime.metadata.module -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.Type -import jp.co.soramitsu.fearless_utils.runtime.metadata.StorageEntryModifier -import jp.co.soramitsu.fearless_utils.runtime.metadata.StorageHasher -import jp.co.soramitsu.fearless_utils.runtime.metadata.WithName +import io.novasama.substrate_sdk_android.runtime.definitions.types.Type +import io.novasama.substrate_sdk_android.runtime.metadata.StorageEntryModifier +import io.novasama.substrate_sdk_android.runtime.metadata.StorageHasher +import io.novasama.substrate_sdk_android.runtime.metadata.WithName import java.math.BigInteger class Module( diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/v14/ModuleMetadataSchema.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/v14/ModuleMetadataSchema.kt similarity index 63% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/v14/ModuleMetadataSchema.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/v14/ModuleMetadataSchema.kt index 6e0b8045..864c0277 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/v14/ModuleMetadataSchema.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/v14/ModuleMetadataSchema.kt @@ -1,17 +1,17 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata.v14 +package io.novasama.substrate_sdk_android.runtime.metadata.v14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.StorageEntryModifier -import jp.co.soramitsu.fearless_utils.runtime.metadata.StorageHasher -import jp.co.soramitsu.fearless_utils.scale.Schema -import jp.co.soramitsu.fearless_utils.scale.byteArray -import jp.co.soramitsu.fearless_utils.scale.compactInt -import jp.co.soramitsu.fearless_utils.scale.dataType.EnumType -import jp.co.soramitsu.fearless_utils.scale.dataType.scalable -import jp.co.soramitsu.fearless_utils.scale.enum -import jp.co.soramitsu.fearless_utils.scale.schema -import jp.co.soramitsu.fearless_utils.scale.string -import jp.co.soramitsu.fearless_utils.scale.uint8 -import jp.co.soramitsu.fearless_utils.scale.vector +import io.novasama.substrate_sdk_android.runtime.metadata.StorageEntryModifier +import io.novasama.substrate_sdk_android.runtime.metadata.StorageHasher +import io.novasama.substrate_sdk_android.scale.Schema +import io.novasama.substrate_sdk_android.scale.byteArray +import io.novasama.substrate_sdk_android.scale.compactInt +import io.novasama.substrate_sdk_android.scale.dataType.EnumType +import io.novasama.substrate_sdk_android.scale.dataType.scalable +import io.novasama.substrate_sdk_android.scale.enum +import io.novasama.substrate_sdk_android.scale.schema +import io.novasama.substrate_sdk_android.scale.string +import io.novasama.substrate_sdk_android.scale.uint8 +import io.novasama.substrate_sdk_android.scale.vector object PalletMetadataV14 : Schema() { val name by string() @@ -32,11 +32,11 @@ object StorageEntryMetadataV14 : Schema() { val name by string() val modifier by enum(StorageEntryModifier::class) val type by enum( - jp.co.soramitsu.fearless_utils.scale.dataType.compactInt, + io.novasama.substrate_sdk_android.scale.dataType.compactInt, scalable(MapTypeV14), ) val default by byteArray() - val documentation by vector(jp.co.soramitsu.fearless_utils.scale.dataType.string) + val documentation by vector(io.novasama.substrate_sdk_android.scale.dataType.string) } object MapTypeV14 : Schema() { @@ -61,7 +61,7 @@ object PalletConstantMetadataV14 : Schema() { val name by string() val type by compactInt() val value by byteArray() // vector - val documentation by vector(jp.co.soramitsu.fearless_utils.scale.dataType.string) + val documentation by vector(io.novasama.substrate_sdk_android.scale.dataType.string) } object ExtrinsicMetadataV14 : Schema() { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/v14/RuntimeMetadataSchemaV14.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/v14/RuntimeMetadataSchemaV14.kt similarity index 75% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/v14/RuntimeMetadataSchemaV14.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/v14/RuntimeMetadataSchemaV14.kt index c80a5260..24d1a7f9 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/runtime/metadata/v14/RuntimeMetadataSchemaV14.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/runtime/metadata/v14/RuntimeMetadataSchemaV14.kt @@ -1,17 +1,17 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata.v14 - -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct -import jp.co.soramitsu.fearless_utils.scale.Schema -import jp.co.soramitsu.fearless_utils.scale.compactInt -import jp.co.soramitsu.fearless_utils.scale.dataType.EnumType -import jp.co.soramitsu.fearless_utils.scale.dataType.list -import jp.co.soramitsu.fearless_utils.scale.dataType.scalable -import jp.co.soramitsu.fearless_utils.scale.enum -import jp.co.soramitsu.fearless_utils.scale.schema -import jp.co.soramitsu.fearless_utils.scale.string -import jp.co.soramitsu.fearless_utils.scale.uint32 -import jp.co.soramitsu.fearless_utils.scale.uint8 -import jp.co.soramitsu.fearless_utils.scale.vector +package io.novasama.substrate_sdk_android.runtime.metadata.v14 + +import io.novasama.substrate_sdk_android.scale.EncodableStruct +import io.novasama.substrate_sdk_android.scale.Schema +import io.novasama.substrate_sdk_android.scale.compactInt +import io.novasama.substrate_sdk_android.scale.dataType.EnumType +import io.novasama.substrate_sdk_android.scale.dataType.list +import io.novasama.substrate_sdk_android.scale.dataType.scalable +import io.novasama.substrate_sdk_android.scale.enum +import io.novasama.substrate_sdk_android.scale.schema +import io.novasama.substrate_sdk_android.scale.string +import io.novasama.substrate_sdk_android.scale.uint32 +import io.novasama.substrate_sdk_android.scale.uint8 +import io.novasama.substrate_sdk_android.scale.vector import java.math.BigInteger object RuntimeMetadataSchemaV14 : Schema() { @@ -37,19 +37,19 @@ val EncodableStruct.type get() = get(PortableType.type) object RegistryType : Schema() { - val path by vector(jp.co.soramitsu.fearless_utils.scale.dataType.string) + val path by vector(io.novasama.substrate_sdk_android.scale.dataType.string) val params by vector(TypeParameter) val def by enum( scalable(TypeDefComposite), scalable(TypeDefVariant), scalable(TypeDefSequence), scalable(TypeDefArray), - list(jp.co.soramitsu.fearless_utils.scale.dataType.compactInt), + list(io.novasama.substrate_sdk_android.scale.dataType.compactInt), EnumType(TypeDefEnum::class.java), scalable(TypeDefCompact), scalable(TypeDefBitSequence), ) - val docs by vector(jp.co.soramitsu.fearless_utils.scale.dataType.string) + val docs by vector(io.novasama.substrate_sdk_android.scale.dataType.string) } val EncodableStruct.path @@ -120,7 +120,7 @@ object TypeDefVariantItem : Schema() { val name by string() val fields2 by vector(TypeDefCompositeField) val index by uint8() - val docs by vector(jp.co.soramitsu.fearless_utils.scale.dataType.string) + val docs by vector(io.novasama.substrate_sdk_android.scale.dataType.string) } object TypeDefComposite : Schema() { @@ -144,7 +144,7 @@ object TypeDefCompositeField : Schema() { val name by string().optional() val type by compactInt() val typeName by string().optional() - val docs by vector(jp.co.soramitsu.fearless_utils.scale.dataType.string) + val docs by vector(io.novasama.substrate_sdk_android.scale.dataType.string) } object TypeParameter : Schema() { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/Delegate.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/Delegate.kt similarity index 83% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/Delegate.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/Delegate.kt index 15d5a517..c5d4a78a 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/Delegate.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/Delegate.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.scale +package io.novasama.substrate_sdk_android.scale -import jp.co.soramitsu.fearless_utils.scale.dataType.DataType -import jp.co.soramitsu.fearless_utils.scale.dataType.optional +import io.novasama.substrate_sdk_android.scale.dataType.DataType +import io.novasama.substrate_sdk_android.scale.dataType.optional import kotlin.properties.ReadOnlyProperty import kotlin.reflect.KProperty diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/Dsl.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/Dsl.kt similarity index 70% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/Dsl.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/Dsl.kt index f0fb636f..c7b03c5f 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/Dsl.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/Dsl.kt @@ -1,25 +1,25 @@ @file:Suppress("unused", "EXPERIMENTAL_API_USAGE") -package jp.co.soramitsu.fearless_utils.scale - -import jp.co.soramitsu.fearless_utils.scale.dataType.DataType -import jp.co.soramitsu.fearless_utils.scale.dataType.EnumType -import jp.co.soramitsu.fearless_utils.scale.dataType.boolean -import jp.co.soramitsu.fearless_utils.scale.dataType.byte -import jp.co.soramitsu.fearless_utils.scale.dataType.byteArray -import jp.co.soramitsu.fearless_utils.scale.dataType.byteArraySized -import jp.co.soramitsu.fearless_utils.scale.dataType.compactInt -import jp.co.soramitsu.fearless_utils.scale.dataType.list -import jp.co.soramitsu.fearless_utils.scale.dataType.long -import jp.co.soramitsu.fearless_utils.scale.dataType.scalable -import jp.co.soramitsu.fearless_utils.scale.dataType.string -import jp.co.soramitsu.fearless_utils.scale.dataType.tuple -import jp.co.soramitsu.fearless_utils.scale.dataType.uint128 -import jp.co.soramitsu.fearless_utils.scale.dataType.uint16 -import jp.co.soramitsu.fearless_utils.scale.dataType.uint32 -import jp.co.soramitsu.fearless_utils.scale.dataType.uint64 -import jp.co.soramitsu.fearless_utils.scale.dataType.uint8 -import jp.co.soramitsu.fearless_utils.scale.dataType.union +package io.novasama.substrate_sdk_android.scale + +import io.novasama.substrate_sdk_android.scale.dataType.DataType +import io.novasama.substrate_sdk_android.scale.dataType.EnumType +import io.novasama.substrate_sdk_android.scale.dataType.boolean +import io.novasama.substrate_sdk_android.scale.dataType.byte +import io.novasama.substrate_sdk_android.scale.dataType.byteArray +import io.novasama.substrate_sdk_android.scale.dataType.byteArraySized +import io.novasama.substrate_sdk_android.scale.dataType.compactInt +import io.novasama.substrate_sdk_android.scale.dataType.list +import io.novasama.substrate_sdk_android.scale.dataType.long +import io.novasama.substrate_sdk_android.scale.dataType.scalable +import io.novasama.substrate_sdk_android.scale.dataType.string +import io.novasama.substrate_sdk_android.scale.dataType.tuple +import io.novasama.substrate_sdk_android.scale.dataType.uint128 +import io.novasama.substrate_sdk_android.scale.dataType.uint16 +import io.novasama.substrate_sdk_android.scale.dataType.uint32 +import io.novasama.substrate_sdk_android.scale.dataType.uint64 +import io.novasama.substrate_sdk_android.scale.dataType.uint8 +import io.novasama.substrate_sdk_android.scale.dataType.union import java.math.BigInteger import kotlin.reflect.KClass diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/ScaleStruct.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/ScaleStruct.kt similarity index 86% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/ScaleStruct.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/ScaleStruct.kt index a5290115..982c1b27 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/ScaleStruct.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/ScaleStruct.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.scale +package io.novasama.substrate_sdk_android.scale -import jp.co.soramitsu.fearless_utils.scale.dataType.DataType -import jp.co.soramitsu.fearless_utils.scale.dataType.optional +import io.novasama.substrate_sdk_android.scale.dataType.DataType +import io.novasama.substrate_sdk_android.scale.dataType.optional class Field(val dataType: DataType, val defaultValue: T? = null) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/Schema.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/Schema.kt similarity index 87% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/Schema.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/Schema.kt index 7c673f13..ab689109 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/Schema.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/Schema.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.scale +package io.novasama.substrate_sdk_android.scale import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter import io.emeraldpay.polkaj.scale.ScaleReader import io.emeraldpay.polkaj.scale.ScaleWriter -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.scale.dataType.DataType -import jp.co.soramitsu.fearless_utils.scale.dataType.optional +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.scale.dataType.DataType +import io.novasama.substrate_sdk_android.scale.dataType.optional import java.io.ByteArrayOutputStream @Suppress("UNCHECKED_CAST") diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Compound.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Compound.kt similarity index 96% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Compound.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Compound.kt index cece7b75..39974738 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Compound.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Compound.kt @@ -1,12 +1,12 @@ @file:Suppress("ClassName", "UNCHECKED_CAST") -package jp.co.soramitsu.fearless_utils.scale.dataType +package io.novasama.substrate_sdk_android.scale.dataType import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter import io.emeraldpay.polkaj.scale.writer.BoolWriter -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct -import jp.co.soramitsu.fearless_utils.scale.Schema +import io.novasama.substrate_sdk_android.scale.EncodableStruct +import io.novasama.substrate_sdk_android.scale.Schema class tuple( private val a: DataType, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/DataType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/DataType.kt similarity index 78% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/DataType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/DataType.kt index 79959d8e..c0acfdc6 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/DataType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/DataType.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.scale.dataType +package io.novasama.substrate_sdk_android.scale.dataType import io.emeraldpay.polkaj.scale.ScaleReader import io.emeraldpay.polkaj.scale.ScaleWriter diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Ext.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Ext.kt similarity index 76% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Ext.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Ext.kt index 416bdc78..e6574027 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Ext.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Ext.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.scale.dataType +package io.novasama.substrate_sdk_android.scale.dataType import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.extensions.toHexString +import io.novasama.substrate_sdk_android.extensions.toHexString import java.io.ByteArrayOutputStream fun DataType.toByteArray(value: T): ByteArray { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Numbers.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Numbers.kt similarity index 91% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Numbers.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Numbers.kt index e15022b7..571ef052 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Numbers.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Numbers.kt @@ -1,13 +1,13 @@ @file:Suppress("EXPERIMENTAL_API_USAGE") -package jp.co.soramitsu.fearless_utils.scale.dataType +package io.novasama.substrate_sdk_android.scale.dataType import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter import io.emeraldpay.polkaj.scale.reader.CompactBigIntReader -import jp.co.soramitsu.fearless_utils.extensions.fromUnsignedBytes -import jp.co.soramitsu.fearless_utils.scale.utils.CompactBigIntWriter -import jp.co.soramitsu.fearless_utils.scale.utils.toUnsignedBytes +import io.novasama.substrate_sdk_android.extensions.fromUnsignedBytes +import io.novasama.substrate_sdk_android.scale.utils.CompactBigIntWriter +import io.novasama.substrate_sdk_android.scale.utils.toUnsignedBytes import java.math.BigInteger import java.nio.ByteOrder diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Primitives.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Primitives.kt similarity index 96% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Primitives.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Primitives.kt index e4dfdfa6..a82a5036 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/dataType/Primitives.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/dataType/Primitives.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.scale.dataType +package io.novasama.substrate_sdk_android.scale.dataType import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/utils/CompactIntWriter.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/utils/CompactIntWriter.kt similarity index 95% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/utils/CompactIntWriter.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/utils/CompactIntWriter.kt index 3f9a233a..7e0bad85 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/utils/CompactIntWriter.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/utils/CompactIntWriter.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.scale.utils +package io.novasama.substrate_sdk_android.scale.utils import io.emeraldpay.polkaj.scale.CompactMode import io.emeraldpay.polkaj.scale.ScaleCodecWriter diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/utils/Ext.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/utils/Ext.kt similarity index 74% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/utils/Ext.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/utils/Ext.kt index 59071d21..d6dd06e3 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/scale/utils/Ext.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/scale/utils/Ext.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.scale.utils +package io.novasama.substrate_sdk_android.scale.utils import io.emeraldpay.polkaj.scale.ScaleCodecWriter diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/ss58/SS58Encoder.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/ss58/SS58Encoder.kt similarity index 85% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/ss58/SS58Encoder.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/ss58/SS58Encoder.kt index 538c3074..aa64d7c4 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/ss58/SS58Encoder.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/ss58/SS58Encoder.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.ss58 - -import jp.co.soramitsu.fearless_utils.encrypt.Base58 -import jp.co.soramitsu.fearless_utils.encrypt.json.copyBytes -import jp.co.soramitsu.fearless_utils.exceptions.AddressFormatException -import jp.co.soramitsu.fearless_utils.extensions.shl -import jp.co.soramitsu.fearless_utils.extensions.shr -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b256 -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b512 +package io.novasama.substrate_sdk_android.ss58 + +import io.novasama.substrate_sdk_android.encrypt.Base58 +import io.novasama.substrate_sdk_android.encrypt.json.copyBytes +import io.novasama.substrate_sdk_android.exceptions.AddressFormatException +import io.novasama.substrate_sdk_android.extensions.shl +import io.novasama.substrate_sdk_android.extensions.shr +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b256 +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b512 import java.lang.Exception import kotlin.experimental.or @@ -16,7 +16,7 @@ object SS58Encoder { private const val PREFIX_SIZE = 2 private const val PUBLIC_KEY_SIZE = 32 - private val base58 = Base58() + private val base58 = io.novasama.substrate_sdk_android.encrypt.Base58() @OptIn(ExperimentalUnsignedTypes::class) private fun getPrefixLenIdent(decodedByteArray: ByteArray): Pair { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/util/JsonExt.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/util/JsonExt.kt similarity index 78% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/util/JsonExt.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/util/JsonExt.kt index ffa9e8a1..8d04f46e 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/util/JsonExt.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/util/JsonExt.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.util +package io.novasama.substrate_sdk_android.util import com.google.gson.Gson import com.google.gson.reflect.TypeToken diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/CoroutineAdapter.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/CoroutineAdapter.kt similarity index 76% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/CoroutineAdapter.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/CoroutineAdapter.kt index 57c8f88b..6cf673c9 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/CoroutineAdapter.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/CoroutineAdapter.kt @@ -1,18 +1,18 @@ @file:Suppress("EXPERIMENTAL_API_USAGE") -package jp.co.soramitsu.fearless_utils.wsrpc - -import jp.co.soramitsu.fearless_utils.wsrpc.mappers.ResponseMapper -import jp.co.soramitsu.fearless_utils.wsrpc.request.DeliveryType -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.UnsubscribeMethodResolver -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage.MultiplexerCallback -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage.StorageSubscriptionMultiplexer.Builder -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage.StorageSubscriptionMultiplexer.Change -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse -import jp.co.soramitsu.fearless_utils.wsrpc.socket.StateObserver -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.State -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +package io.novasama.substrate_sdk_android.wsrpc + +import io.novasama.substrate_sdk_android.wsrpc.mappers.ResponseMapper +import io.novasama.substrate_sdk_android.wsrpc.request.DeliveryType +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.UnsubscribeMethodResolver +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage.MultiplexerCallback +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage.StorageSubscriptionMultiplexer.Builder +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage.StorageSubscriptionMultiplexer.Change +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.socket.StateObserver +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.State +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.channels.awaitClose diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/SocketService.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/SocketService.kt similarity index 86% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/SocketService.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/SocketService.kt index 5a8fdf3e..3a95f344 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/SocketService.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/SocketService.kt @@ -1,32 +1,32 @@ -package jp.co.soramitsu.fearless_utils.wsrpc +package io.novasama.substrate_sdk_android.wsrpc import com.google.gson.Gson import com.neovisionaries.ws.client.WebSocketFactory import com.neovisionaries.ws.client.WebSocketState -import jp.co.soramitsu.fearless_utils.wsrpc.exception.ConnectionClosedException -import jp.co.soramitsu.fearless_utils.wsrpc.interceptor.WebSocketResponseInterceptor -import jp.co.soramitsu.fearless_utils.wsrpc.interceptor.shouldDeliver -import jp.co.soramitsu.fearless_utils.wsrpc.logging.Logger -import jp.co.soramitsu.fearless_utils.wsrpc.mappers.nonNull -import jp.co.soramitsu.fearless_utils.wsrpc.mappers.stringIdMapper -import jp.co.soramitsu.fearless_utils.wsrpc.recovery.Reconnector -import jp.co.soramitsu.fearless_utils.wsrpc.request.BatchSendable -import jp.co.soramitsu.fearless_utils.wsrpc.request.DeliveryType -import jp.co.soramitsu.fearless_utils.wsrpc.request.RequestExecutor -import jp.co.soramitsu.fearless_utils.wsrpc.request.SingleSendable -import jp.co.soramitsu.fearless_utils.wsrpc.request.base.RpcRequest -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse -import jp.co.soramitsu.fearless_utils.wsrpc.socket.ObservableState -import jp.co.soramitsu.fearless_utils.wsrpc.socket.RpcSocket -import jp.co.soramitsu.fearless_utils.wsrpc.socket.RpcSocketListener -import jp.co.soramitsu.fearless_utils.wsrpc.socket.StateObserver -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.Event -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.State -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.RespondableSubscription -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.wsrpc.exception.ConnectionClosedException +import io.novasama.substrate_sdk_android.wsrpc.interceptor.WebSocketResponseInterceptor +import io.novasama.substrate_sdk_android.wsrpc.interceptor.shouldDeliver +import io.novasama.substrate_sdk_android.wsrpc.logging.Logger +import io.novasama.substrate_sdk_android.wsrpc.mappers.nonNull +import io.novasama.substrate_sdk_android.wsrpc.mappers.stringIdMapper +import io.novasama.substrate_sdk_android.wsrpc.recovery.Reconnector +import io.novasama.substrate_sdk_android.wsrpc.request.BatchSendable +import io.novasama.substrate_sdk_android.wsrpc.request.DeliveryType +import io.novasama.substrate_sdk_android.wsrpc.request.RequestExecutor +import io.novasama.substrate_sdk_android.wsrpc.request.SingleSendable +import io.novasama.substrate_sdk_android.wsrpc.request.base.RpcRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.socket.ObservableState +import io.novasama.substrate_sdk_android.wsrpc.socket.RpcSocket +import io.novasama.substrate_sdk_android.wsrpc.socket.RpcSocketListener +import io.novasama.substrate_sdk_android.wsrpc.socket.StateObserver +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.Event +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.State +import io.novasama.substrate_sdk_android.wsrpc.subscription.RespondableSubscription +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange class SocketService( val jsonMapper: Gson, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/exception/ConnectionClosedException.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/exception/ConnectionClosedException.kt similarity index 65% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/exception/ConnectionClosedException.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/exception/ConnectionClosedException.kt index c04ab261..895d4781 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/exception/ConnectionClosedException.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/exception/ConnectionClosedException.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.exception +package io.novasama.substrate_sdk_android.wsrpc.exception class ConnectionClosedException : Exception() { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/exception/RpcException.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/exception/RpcException.kt similarity index 60% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/exception/RpcException.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/exception/RpcException.kt index ffb65c12..489e9b4d 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/exception/RpcException.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/exception/RpcException.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.exception +package io.novasama.substrate_sdk_android.wsrpc.exception import java.lang.Exception diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/interceptor/WebSocketResponseInterceptor.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/interceptor/WebSocketResponseInterceptor.kt similarity index 73% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/interceptor/WebSocketResponseInterceptor.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/interceptor/WebSocketResponseInterceptor.kt index de767a94..bc4de952 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/interceptor/WebSocketResponseInterceptor.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/interceptor/WebSocketResponseInterceptor.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.interceptor +package io.novasama.substrate_sdk_android.wsrpc.interceptor -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse interface WebSocketResponseInterceptor { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/logging/Logger.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/logging/Logger.kt similarity index 61% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/logging/Logger.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/logging/Logger.kt index 6d7a74e5..348529a0 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/logging/Logger.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/logging/Logger.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.logging +package io.novasama.substrate_sdk_android.wsrpc.logging interface Logger { fun log(message: String?) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/Base.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/mappers/Base.kt similarity index 84% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/Base.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/mappers/Base.kt index 577a7eb7..552f1b6e 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/Base.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/mappers/Base.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.mappers +package io.novasama.substrate_sdk_android.wsrpc.mappers import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.wsrpc.exception.RpcException -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.exception.RpcException +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse class NullableContainer(val result: R?) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/Types.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/mappers/Types.kt similarity index 86% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/Types.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/mappers/Types.kt index 29e6a821..9c44f50b 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/Types.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/mappers/Types.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.mappers +package io.novasama.substrate_sdk_android.wsrpc.mappers import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct -import jp.co.soramitsu.fearless_utils.scale.Schema -import jp.co.soramitsu.fearless_utils.wsrpc.exception.RpcException -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.scale.EncodableStruct +import io.novasama.substrate_sdk_android.scale.Schema +import io.novasama.substrate_sdk_android.wsrpc.exception.RpcException +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse /** * Mark that the result is always non-null and null result means that error happened diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/recovery/ReconnectStrategy.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/recovery/ReconnectStrategy.kt similarity index 93% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/recovery/ReconnectStrategy.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/recovery/ReconnectStrategy.kt index 747f07b0..51900140 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/recovery/ReconnectStrategy.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/recovery/ReconnectStrategy.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.recovery +package io.novasama.substrate_sdk_android.wsrpc.recovery import kotlin.math.pow diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/recovery/Reconnector.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/recovery/Reconnector.kt similarity index 94% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/recovery/Reconnector.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/recovery/Reconnector.kt index 6be89016..5a05f950 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/recovery/Reconnector.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/recovery/Reconnector.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.recovery +package io.novasama.substrate_sdk_android.wsrpc.recovery import java.util.concurrent.Executors import java.util.concurrent.Future diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/DeliveryType.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/DeliveryType.kt similarity index 87% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/DeliveryType.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/DeliveryType.kt index 9fcb5fb2..70ea8353 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/DeliveryType.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/DeliveryType.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request +package io.novasama.substrate_sdk_android.wsrpc.request enum class DeliveryType { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/RequestExecutor.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/RequestExecutor.kt similarity index 91% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/RequestExecutor.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/RequestExecutor.kt index 0b2f36d1..8c39df3e 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/RequestExecutor.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/RequestExecutor.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request +package io.novasama.substrate_sdk_android.wsrpc.request import java.util.concurrent.ExecutorService import java.util.concurrent.Executors diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/SingleSendable.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/SingleSendable.kt similarity index 75% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/SingleSendable.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/SingleSendable.kt index b9ed3f39..a26b3a53 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/SingleSendable.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/SingleSendable.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request +package io.novasama.substrate_sdk_android.wsrpc.request -import jp.co.soramitsu.fearless_utils.wsrpc.SocketService -import jp.co.soramitsu.fearless_utils.wsrpc.request.base.RpcRequest -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse -import jp.co.soramitsu.fearless_utils.wsrpc.socket.RpcSocket -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine +import io.novasama.substrate_sdk_android.wsrpc.SocketService +import io.novasama.substrate_sdk_android.wsrpc.request.base.RpcRequest +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.socket.RpcSocket +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine internal class SingleSendable( val request: RpcRequest, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/base/RpcRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/base/RpcRequest.kt similarity index 55% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/base/RpcRequest.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/base/RpcRequest.kt index 38d0f3b4..1e220144 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/base/RpcRequest.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/base/RpcRequest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.base +package io.novasama.substrate_sdk_android.wsrpc.request.base -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest sealed class RpcRequest(val id: Int) { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/RuntimeRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/RuntimeRequest.kt similarity index 82% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/RuntimeRequest.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/RuntimeRequest.kt index 871abba9..176b2e9f 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/RuntimeRequest.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/RuntimeRequest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime +package io.novasama.substrate_sdk_android.wsrpc.request.runtime import com.google.gson.annotations.SerializedName import kotlin.random.Random diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/UnsubscribeMethodResolver.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/UnsubscribeMethodResolver.kt similarity index 89% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/UnsubscribeMethodResolver.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/UnsubscribeMethodResolver.kt index ba7382cf..774a769a 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/UnsubscribeMethodResolver.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/UnsubscribeMethodResolver.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime +package io.novasama.substrate_sdk_android.wsrpc.request.runtime object UnsubscribeMethodResolver { diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/account/AccountInfoRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/account/AccountInfoRequest.kt new file mode 100644 index 00000000..44764820 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/account/AccountInfoRequest.kt @@ -0,0 +1,10 @@ +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.account + +import io.novasama.substrate_sdk_android.runtime.Module +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage.GetStorageRequest + +class AccountInfoRequest(publicKey: ByteArray) : GetStorageRequest( + listOf( + Module.System.Account.storageKey(publicKey) + ) +) diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/author/PendingExtrinsicsRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/author/PendingExtrinsicsRequest.kt new file mode 100644 index 00000000..a1e14fd8 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/author/PendingExtrinsicsRequest.kt @@ -0,0 +1,7 @@ +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.author + +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest + +private const val METHOD = "author_pendingExtrinsics" + +class PendingExtrinsicsRequest : RuntimeRequest(METHOD, listOf()) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/author/SubmitExtrinsicRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/author/SubmitExtrinsicRequest.kt similarity index 66% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/author/SubmitExtrinsicRequest.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/author/SubmitExtrinsicRequest.kt index 9574b4b0..3ac1cd67 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/author/SubmitExtrinsicRequest.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/author/SubmitExtrinsicRequest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.author +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.author -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest class SubmitExtrinsicRequest(extrinsic: String) : RuntimeRequest( method = "author_submitExtrinsic", diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/chain/RuntimeVersionRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/chain/RuntimeVersionRequest.kt similarity index 56% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/chain/RuntimeVersionRequest.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/chain/RuntimeVersionRequest.kt index e7ee58b0..29d40169 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/chain/RuntimeVersionRequest.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/chain/RuntimeVersionRequest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.chain +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.chain -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest private const val METHOD = "chain_getRuntimeVersion" diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/chain/SubscribeRuntimeVersionRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/chain/SubscribeRuntimeVersionRequest.kt similarity index 65% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/chain/SubscribeRuntimeVersionRequest.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/chain/SubscribeRuntimeVersionRequest.kt index 48caaf0a..5f5d24bb 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/chain/SubscribeRuntimeVersionRequest.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/chain/SubscribeRuntimeVersionRequest.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.chain +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.chain -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.notValidResult +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.notValidResult object SubscribeRuntimeVersionRequest : RuntimeRequest( method = "chain_subscribeRuntimeVersion", diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/GetStorageRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/GetStorageRequest.kt new file mode 100644 index 00000000..57a46c9f --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/GetStorageRequest.kt @@ -0,0 +1,8 @@ +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage + +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest + +open class GetStorageRequest(keys: List) : RuntimeRequest( + method = "state_getStorage", + keys +) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexer.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexer.kt similarity index 82% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexer.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexer.kt index b026dac4..2b52b896 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexer.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexer.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage -import jp.co.soramitsu.fearless_utils.wsrpc.SocketService -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.UnsubscribeMethodResolver -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.wsrpc.SocketService +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.UnsubscribeMethodResolver +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange typealias MultiplexerCallback = SocketService.ResponseListener diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/SubscribeStorageRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/SubscribeStorageRequest.kt similarity index 72% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/SubscribeStorageRequest.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/SubscribeStorageRequest.kt index 4dc4fc11..cddab40a 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/SubscribeStorageRequest.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/SubscribeStorageRequest.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.RuntimeRequest -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.notValidResult +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.notValidResult class SubscribeStorageRequest(storageKeys: List) : RuntimeRequest( "state_subscribeStorage", diff --git a/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/system/NodeNetworkTypeRequest.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/system/NodeNetworkTypeRequest.kt new file mode 100644 index 00000000..cbca73c9 --- /dev/null +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/system/NodeNetworkTypeRequest.kt @@ -0,0 +1,7 @@ +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.system + +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.RuntimeRequest + +private const val METHOD = "system_chain" + +class NodeNetworkTypeRequest : RuntimeRequest(METHOD, listOf()) diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/response/RpcResponse.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/response/RpcResponse.kt similarity index 86% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/response/RpcResponse.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/response/RpcResponse.kt index a13e72b0..344c1196 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/response/RpcResponse.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/response/RpcResponse.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.response +package io.novasama.substrate_sdk_android.wsrpc.response import com.google.gson.annotations.SerializedName diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/socket/ObservableState.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/socket/ObservableState.kt similarity index 84% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/socket/ObservableState.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/socket/ObservableState.kt index c3e05b5a..dab9c711 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/socket/ObservableState.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/socket/ObservableState.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.socket +package io.novasama.substrate_sdk_android.wsrpc.socket -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.State +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.State typealias StateObserver = (State) -> Unit diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/socket/RpcSocket.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/socket/RpcSocket.kt similarity index 90% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/socket/RpcSocket.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/socket/RpcSocket.kt index 0245b378..00b04a58 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/socket/RpcSocket.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/socket/RpcSocket.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.socket +package io.novasama.substrate_sdk_android.wsrpc.socket import com.google.gson.Gson import com.neovisionaries.ws.client.WebSocket @@ -7,11 +7,11 @@ import com.neovisionaries.ws.client.WebSocketException import com.neovisionaries.ws.client.WebSocketFactory import com.neovisionaries.ws.client.WebSocketFrame import com.neovisionaries.ws.client.WebSocketState -import jp.co.soramitsu.fearless_utils.util.fromJson -import jp.co.soramitsu.fearless_utils.wsrpc.logging.Logger -import jp.co.soramitsu.fearless_utils.wsrpc.request.base.RpcRequest -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.util.fromJson +import io.novasama.substrate_sdk_android.wsrpc.logging.Logger +import io.novasama.substrate_sdk_android.wsrpc.request.base.RpcRequest +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange import java.util.concurrent.TimeUnit interface RpcSocketListener { diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/state/SocketStateMachine.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/state/SocketStateMachine.kt similarity index 97% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/state/SocketStateMachine.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/state/SocketStateMachine.kt index 02cc6914..286113f4 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/state/SocketStateMachine.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/state/SocketStateMachine.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.state +package io.novasama.substrate_sdk_android.wsrpc.state -import jp.co.soramitsu.fearless_utils.wsrpc.SocketService -import jp.co.soramitsu.fearless_utils.wsrpc.request.DeliveryType -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse -import jp.co.soramitsu.fearless_utils.wsrpc.socket.RpcSocket -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.wsrpc.SocketService +import io.novasama.substrate_sdk_android.wsrpc.request.DeliveryType +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.socket.RpcSocket +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange typealias Transition = Pair> diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/subscription/RespondableSubscription.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/subscription/RespondableSubscription.kt similarity index 52% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/subscription/RespondableSubscription.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/subscription/RespondableSubscription.kt index 45007b5f..3218a5e6 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/subscription/RespondableSubscription.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/subscription/RespondableSubscription.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.subscription +package io.novasama.substrate_sdk_android.wsrpc.subscription -import jp.co.soramitsu.fearless_utils.wsrpc.SocketService.ResponseListener -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.wsrpc.SocketService.ResponseListener +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange class RespondableSubscription( override val id: String, diff --git a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/subscription/response/SubscriptionChange.kt b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/subscription/response/SubscriptionChange.kt similarity index 86% rename from fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/subscription/response/SubscriptionChange.kt rename to substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/subscription/response/SubscriptionChange.kt index df18c725..85914136 100644 --- a/fearless-utils/src/main/java/jp/co/soramitsu/fearless_utils/wsrpc/subscription/response/SubscriptionChange.kt +++ b/substrate-sdk-android/src/main/java/io/novasama/substrate_sdk_android/wsrpc/subscription/response/SubscriptionChange.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.subscription.response +package io.novasama.substrate_sdk_android.wsrpc.subscription.response class SubscriptionChange( val jsonrpc: String, diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/Assertions.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/Assertions.kt similarity index 84% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/Assertions.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/Assertions.kt index 79e2f436..e90a91d5 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/Assertions.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/Assertions.kt @@ -1,6 +1,4 @@ -package jp.co.soramitsu.fearless_utils - -import org.junit.Assert.assertEquals +package io.novasama.substrate_sdk_android fun assertListEquals( expected: List, diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/MockitoHelpers.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/MockitoHelpers.kt similarity index 94% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/MockitoHelpers.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/MockitoHelpers.kt index 423eaf21..9cef847e 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/MockitoHelpers.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/MockitoHelpers.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils +package io.novasama.substrate_sdk_android import org.mockito.Mockito diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/common/Assertions.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/common/Assertions.kt similarity index 94% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/common/Assertions.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/common/Assertions.kt index 29e58ec4..d842c89d 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/common/Assertions.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/common/Assertions.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.common +package io.novasama.substrate_sdk_android.common import org.junit.Assert import kotlin.contracts.ExperimentalContracts diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/common/Math.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/common/Math.kt similarity index 84% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/common/Math.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/common/Math.kt index 7fef1904..479e6746 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/common/Math.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/common/Math.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.common +package io.novasama.substrate_sdk_android.common /** * Complexity: O(n * log(n)) diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/common/NetworkTypes.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/common/NetworkTypes.kt similarity index 90% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/common/NetworkTypes.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/common/NetworkTypes.kt index ea5548ed..9baa6da1 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/common/NetworkTypes.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/common/NetworkTypes.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.common +package io.novasama.substrate_sdk_android.common internal object TestAddressBytes { const val KUSAMA: Short = 2 diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/ECDSAUtilsTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/ECDSAUtilsTest.kt similarity index 85% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/ECDSAUtilsTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/ECDSAUtilsTest.kt index 59a77515..60dc24ca 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/ECDSAUtilsTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/ECDSAUtilsTest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.encrypt.keypair.ECDSAUtils +import io.novasama.substrate_sdk_android.encrypt.keypair.ECDSAUtils import org.bouncycastle.util.encoders.Hex import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/EthereumKeypairDerivationTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/EthereumKeypairDerivationTest.kt similarity index 69% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/EthereumKeypairDerivationTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/EthereumKeypairDerivationTest.kt index 77751100..e4240fb3 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/EthereumKeypairDerivationTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/EthereumKeypairDerivationTest.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.encrypt.keypair.ethereum.EthereumKeypairFactory -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.getResourceReader -import jp.co.soramitsu.fearless_utils.encrypt.junction.BIP32JunctionDecoder -import jp.co.soramitsu.fearless_utils.encrypt.mnemonic.MnemonicTestCase -import jp.co.soramitsu.fearless_utils.encrypt.seed.ethereum.EthereumSeedFactory +import io.novasama.substrate_sdk_android.encrypt.keypair.ethereum.EthereumKeypairFactory +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.getResourceReader +import io.novasama.substrate_sdk_android.encrypt.junction.BIP32JunctionDecoder +import io.novasama.substrate_sdk_android.encrypt.mnemonic.MnemonicTestCase +import io.novasama.substrate_sdk_android.encrypt.seed.ethereum.EthereumSeedFactory import org.junit.Assert import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/JsonSeedDecoderTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/JsonSeedDecoderTest.kt similarity index 92% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/JsonSeedDecoderTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/JsonSeedDecoderTest.kt index efd57bd0..563c628d 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/JsonSeedDecoderTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/JsonSeedDecoderTest.kt @@ -1,15 +1,15 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.common.TestAddressBytes -import jp.co.soramitsu.fearless_utils.common.TestGeneses -import jp.co.soramitsu.fearless_utils.common.assertInstance -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.encrypt.json.JsonSeedDecoder -import jp.co.soramitsu.fearless_utils.encrypt.json.JsonSeedDecodingException.IncorrectPasswordException -import jp.co.soramitsu.fearless_utils.encrypt.json.JsonSeedDecodingException.InvalidJsonException -import jp.co.soramitsu.fearless_utils.encrypt.model.NetworkTypeIdentifier -import jp.co.soramitsu.fearless_utils.extensions.toHexString +import io.novasama.substrate_sdk_android.common.TestAddressBytes +import io.novasama.substrate_sdk_android.common.TestGeneses +import io.novasama.substrate_sdk_android.common.assertInstance +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.encrypt.json.JsonSeedDecoder +import io.novasama.substrate_sdk_android.encrypt.json.JsonSeedDecodingException.IncorrectPasswordException +import io.novasama.substrate_sdk_android.encrypt.json.JsonSeedDecodingException.InvalidJsonException +import io.novasama.substrate_sdk_android.encrypt.model.NetworkTypeIdentifier +import io.novasama.substrate_sdk_android.extensions.toHexString import org.bouncycastle.util.encoders.Hex import org.junit.Assert.assertArrayEquals import org.junit.Assert.assertEquals diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/JsonSeedEncoderTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/JsonSeedEncoderTest.kt similarity index 79% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/JsonSeedEncoderTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/JsonSeedEncoderTest.kt index 02d3e84a..38ebdee6 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/JsonSeedEncoderTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/JsonSeedEncoderTest.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.TestData -import jp.co.soramitsu.fearless_utils.common.TestAddressBytes -import jp.co.soramitsu.fearless_utils.common.TestGeneses -import jp.co.soramitsu.fearless_utils.encrypt.json.JsonSeedDecoder -import jp.co.soramitsu.fearless_utils.encrypt.json.JsonSeedEncoder -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.SubstrateKeypairFactory -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.toAddress +import io.novasama.substrate_sdk_android.TestData +import io.novasama.substrate_sdk_android.common.TestAddressBytes +import io.novasama.substrate_sdk_android.common.TestGeneses +import io.novasama.substrate_sdk_android.encrypt.json.JsonSeedDecoder +import io.novasama.substrate_sdk_android.encrypt.json.JsonSeedEncoder +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.SubstrateKeypairFactory +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.toAddress import org.junit.Assert.assertArrayEquals import org.junit.Assert.assertEquals import org.junit.Ignore diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/KeyFactoryTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/KeyFactoryTest.kt similarity index 77% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/KeyFactoryTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/KeyFactoryTest.kt index db46539e..9d972572 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/KeyFactoryTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/KeyFactoryTest.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.TestData -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.SubstrateKeypairFactory +import io.novasama.substrate_sdk_android.TestData +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.SubstrateKeypairFactory import org.bouncycastle.util.encoders.Hex import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/LocalSubstrateKeypairDerivationTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/LocalSubstrateKeypairDerivationTest.kt similarity index 72% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/LocalSubstrateKeypairDerivationTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/LocalSubstrateKeypairDerivationTest.kt index 88895568..1b6531df 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/LocalSubstrateKeypairDerivationTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/LocalSubstrateKeypairDerivationTest.kt @@ -1,7 +1,5 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType -import jp.co.soramitsu.fearless_utils.encrypt.SubstrateKeypairDerivationTest import org.junit.Test import org.junit.runner.RunWith import org.mockito.junit.MockitoJUnitRunner diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/SignatureVerifierTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/SignatureVerifierTest.kt similarity index 91% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/SignatureVerifierTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/SignatureVerifierTest.kt index 6a945919..186c0c6b 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/SignatureVerifierTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/SignatureVerifierTest.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.TestData -import jp.co.soramitsu.fearless_utils.encrypt.Signer.MessageHashing -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.ECDSASubstrateKeypairFactory -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.Ed25519SubstrateKeypairFactory -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.Sr25519SubstrateKeypairFactory +import io.novasama.substrate_sdk_android.TestData +import io.novasama.substrate_sdk_android.encrypt.Signer.MessageHashing +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.ECDSASubstrateKeypairFactory +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.Ed25519SubstrateKeypairFactory +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.Sr25519SubstrateKeypairFactory import org.junit.Assert.assertEquals import org.junit.Ignore import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/SignerTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/SignerTest.kt similarity index 76% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/SignerTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/SignerTest.kt index 74203927..51eb887a 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/SignerTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/SignerTest.kt @@ -1,10 +1,8 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt -import jp.co.soramitsu.fearless_utils.TestData -import jp.co.soramitsu.fearless_utils.encrypt.keypair.BaseKeypair -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.SubstrateKeypairFactory -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString +import io.novasama.substrate_sdk_android.encrypt.keypair.BaseKeypair +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/junction/BIP32JunctionDecoderTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/junction/BIP32JunctionDecoderTest.kt similarity index 87% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/junction/BIP32JunctionDecoderTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/junction/BIP32JunctionDecoderTest.kt index 53c7685a..6774bff1 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/junction/BIP32JunctionDecoderTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/junction/BIP32JunctionDecoderTest.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.encrypt.junction +package io.novasama.substrate_sdk_android.encrypt.junction -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.encrypt.junction.BIP32JunctionDecoder.DecodingError.InvalidBIP32Junction -import jp.co.soramitsu.fearless_utils.encrypt.junction.JunctionDecoder.DecodingError.InvalidStart +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.encrypt.junction.BIP32JunctionDecoder.DecodingError.InvalidBIP32Junction +import io.novasama.substrate_sdk_android.encrypt.junction.JunctionDecoder.DecodingError.InvalidStart import org.junit.Test // trick compiler to not to complain about 0x80 being too large to fit into Byte diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/junction/JunctionTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/junction/JunctionTest.kt similarity index 83% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/junction/JunctionTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/junction/JunctionTest.kt index 3d9b8d3b..fdbceb9f 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/junction/JunctionTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/junction/JunctionTest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.junction +package io.novasama.substrate_sdk_android.encrypt.junction -import jp.co.soramitsu.fearless_utils.assertListEquals +import io.novasama.substrate_sdk_android.assertListEquals import org.junit.Assert.assertEquals abstract class JunctionTest { diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/junction/SubstrateJunctionDecoderTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/junction/SubstrateJunctionDecoderTest.kt similarity index 90% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/junction/SubstrateJunctionDecoderTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/junction/SubstrateJunctionDecoderTest.kt index 76c169b3..b9a66a21 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/junction/SubstrateJunctionDecoderTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/junction/SubstrateJunctionDecoderTest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.junction +package io.novasama.substrate_sdk_android.encrypt.junction -import jp.co.soramitsu.fearless_utils.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.fromHex import org.junit.Test class SubstrateJunctionDecoderTest : JunctionTest() { diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/SeedTestCase.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/keypair/SeedTestCase.kt similarity index 75% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/SeedTestCase.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/keypair/SeedTestCase.kt index 5f58f44d..01b5eb97 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/SeedTestCase.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/keypair/SeedTestCase.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair +package io.novasama.substrate_sdk_android.encrypt.keypair import com.google.gson.annotations.SerializedName diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/EthereumKeypairFactoryTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/EthereumKeypairFactoryTest.kt similarity index 71% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/EthereumKeypairFactoryTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/EthereumKeypairFactoryTest.kt index dd8afa7f..daa6428d 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/keypair/ethereum/EthereumKeypairFactoryTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/keypair/ethereum/EthereumKeypairFactoryTest.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.encrypt.keypair.ethereum +package io.novasama.substrate_sdk_android.encrypt.keypair.ethereum import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.encrypt.keypair.SeedTestCase -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.getResourceReader -import jp.co.soramitsu.fearless_utils.encrypt.junction.BIP32JunctionDecoder +import io.novasama.substrate_sdk_android.encrypt.keypair.SeedTestCase +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.getResourceReader +import io.novasama.substrate_sdk_android.encrypt.junction.BIP32JunctionDecoder import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/MnemonicCreatorTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/MnemonicCreatorTest.kt similarity index 90% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/MnemonicCreatorTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/MnemonicCreatorTest.kt index 2a2fb9c5..db0f57f5 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/MnemonicCreatorTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/MnemonicCreatorTest.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt.mnemonic +package io.novasama.substrate_sdk_android.encrypt.mnemonic -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/qr/QrSharingTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/qr/QrSharingTest.kt similarity index 90% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/qr/QrSharingTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/qr/QrSharingTest.kt index d2420a8c..bc58ea0a 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/qr/QrSharingTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/qr/QrSharingTest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.encrypt.qr +package io.novasama.substrate_sdk_android.encrypt.qr -import jp.co.soramitsu.fearless_utils.any +import io.novasama.substrate_sdk_android.any import junit.framework.TestCase.assertEquals import org.junit.Before import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/qr/SubstrateQrFormatTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/qr/SubstrateQrFormatTest.kt similarity index 88% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/qr/SubstrateQrFormatTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/qr/SubstrateQrFormatTest.kt index b6ad1915..6061c514 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/qr/SubstrateQrFormatTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/qr/SubstrateQrFormatTest.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.encrypt.qr +package io.novasama.substrate_sdk_android.encrypt.qr -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.encrypt.qr.QrFormat.Payload -import jp.co.soramitsu.fearless_utils.encrypt.qr.formats.SubstrateQrFormat -import jp.co.soramitsu.fearless_utils.extensions.fromHex +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.encrypt.qr.QrFormat.Payload +import io.novasama.substrate_sdk_android.encrypt.qr.formats.SubstrateQrFormat +import io.novasama.substrate_sdk_android.extensions.fromHex import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/qr/formats/AddressQrFormatTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/qr/formats/AddressQrFormatTest.kt similarity index 74% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/qr/formats/AddressQrFormatTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/qr/formats/AddressQrFormatTest.kt index d2a3b70e..f0caabdc 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/encrypt/qr/formats/AddressQrFormatTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/encrypt/qr/formats/AddressQrFormatTest.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.encrypt.qr.formats +package io.novasama.substrate_sdk_android.encrypt.qr.formats -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.encrypt.qr.QrFormat +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.encrypt.qr.QrFormat import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/EthereumKtTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/EthereumKtTest.kt similarity index 97% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/EthereumKtTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/EthereumKtTest.kt index a5820aef..fb42a1b2 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/EthereumKtTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/EthereumKtTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.extensions +package io.novasama.substrate_sdk_android.extensions import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/KotlinExtensionsTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/KotlinExtensionsTest.kt similarity index 96% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/KotlinExtensionsTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/KotlinExtensionsTest.kt index 321c848d..d2a3a760 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/KotlinExtensionsTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/KotlinExtensionsTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.extensions +package io.novasama.substrate_sdk_android.extensions import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/SnakeToCamelCaseTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/SnakeToCamelCaseTest.kt similarity index 88% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/SnakeToCamelCaseTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/SnakeToCamelCaseTest.kt index 2219fc02..b0a0a3eb 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/SnakeToCamelCaseTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/SnakeToCamelCaseTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.extensions +package io.novasama.substrate_sdk_android.extensions import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/SplitByteArrayTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/SplitByteArrayTest.kt similarity index 97% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/SplitByteArrayTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/SplitByteArrayTest.kt index 4615cfb4..ed082c77 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/extensions/SplitByteArrayTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/extensions/SplitByteArrayTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.extensions +package io.novasama.substrate_sdk_android.extensions import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/hash/HasherTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/hash/HasherTest.kt similarity index 88% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/hash/HasherTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/hash/HasherTest.kt index c6ca4c43..ed238aff 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/hash/HasherTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/hash/HasherTest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.hash +package io.novasama.substrate_sdk_android.hash -import jp.co.soramitsu.fearless_utils.hash.Hasher.blake2b256 +import io.novasama.substrate_sdk_android.hash.Hasher.blake2b256 import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/BaseIntegrationTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/BaseIntegrationTest.kt similarity index 59% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/BaseIntegrationTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/BaseIntegrationTest.kt index a9e0dbb1..6c544bd5 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/BaseIntegrationTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/BaseIntegrationTest.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.integration +package io.novasama.substrate_sdk_android.integration import com.google.gson.Gson import com.neovisionaries.ws.client.WebSocketFactory -import jp.co.soramitsu.fearless_utils.wsrpc.SocketService -import jp.co.soramitsu.fearless_utils.wsrpc.StdoutLogger -import jp.co.soramitsu.fearless_utils.wsrpc.recovery.ConstantReconnectStrategy -import jp.co.soramitsu.fearless_utils.wsrpc.recovery.Reconnector -import jp.co.soramitsu.fearless_utils.wsrpc.request.RequestExecutor +import io.novasama.substrate_sdk_android.wsrpc.SocketService +import io.novasama.substrate_sdk_android.wsrpc.StdoutLogger +import io.novasama.substrate_sdk_android.wsrpc.recovery.ConstantReconnectStrategy +import io.novasama.substrate_sdk_android.wsrpc.recovery.Reconnector +import io.novasama.substrate_sdk_android.wsrpc.request.RequestExecutor import org.junit.After import org.junit.Before diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/Common.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/Common.kt similarity index 71% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/Common.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/Common.kt index 956a0209..24df2465 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/Common.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/Common.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.integration +package io.novasama.substrate_sdk_android.integration -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.extrinsic.ExtrinsicBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.extrinsic.ExtrinsicBuilder import java.math.BigInteger const val KUSAMA_URL = "wss://kusama-rpc.polkadot.io" diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/CompoundSubscriptionTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/CompoundSubscriptionTest.kt similarity index 68% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/CompoundSubscriptionTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/CompoundSubscriptionTest.kt index f9c6ff5e..8ea0b3c7 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/CompoundSubscriptionTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/CompoundSubscriptionTest.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.integration +package io.novasama.substrate_sdk_android.integration -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage.StorageSubscriptionMultiplexer -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage.subscribeUsing -import jp.co.soramitsu.fearless_utils.wsrpc.subscribe +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage.StorageSubscriptionMultiplexer +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage.subscribeUsing +import io.novasama.substrate_sdk_android.wsrpc.subscribe import kotlinx.coroutines.flow.first import kotlinx.coroutines.runBlocking import org.junit.Ignore diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/account/AccountBalanceRequestTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/account/AccountBalanceRequestTest.kt similarity index 68% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/account/AccountBalanceRequestTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/account/AccountBalanceRequestTest.kt index 29ea684e..eb6f8df1 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/account/AccountBalanceRequestTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/account/AccountBalanceRequestTest.kt @@ -1,11 +1,10 @@ -package jp.co.soramitsu.fearless_utils.integration.account - -import jp.co.soramitsu.fearless_utils.integration.BaseIntegrationTest -import jp.co.soramitsu.fearless_utils.integration.WESTEND_URL -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.toAccountId -import jp.co.soramitsu.fearless_utils.wsrpc.executeAsync -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.account.AccountInfoRequest +package io.novasama.substrate_sdk_android.integration.account + +import io.novasama.substrate_sdk_android.integration.BaseIntegrationTest +import io.novasama.substrate_sdk_android.integration.WESTEND_URL +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.toAccountId +import io.novasama.substrate_sdk_android.wsrpc.executeAsync +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.account.AccountInfoRequest import kotlinx.coroutines.runBlocking import org.bouncycastle.util.encoders.Hex import org.junit.Ignore diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/author/PendingExtrinsicsTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/author/PendingExtrinsicsTest.kt similarity index 64% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/author/PendingExtrinsicsTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/author/PendingExtrinsicsTest.kt index 030c5123..893e238d 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/author/PendingExtrinsicsTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/author/PendingExtrinsicsTest.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.integration.author +package io.novasama.substrate_sdk_android.integration.author -import jp.co.soramitsu.fearless_utils.integration.BaseIntegrationTest -import jp.co.soramitsu.fearless_utils.wsrpc.executeAsync -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.author.PendingExtrinsicsRequest +import io.novasama.substrate_sdk_android.integration.BaseIntegrationTest +import io.novasama.substrate_sdk_android.wsrpc.executeAsync +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.author.PendingExtrinsicsRequest import kotlinx.coroutines.runBlocking import org.junit.Ignore import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/chain/RuntimeVersionRequestTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/chain/RuntimeVersionRequestTest.kt similarity index 60% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/chain/RuntimeVersionRequestTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/chain/RuntimeVersionRequestTest.kt index f1a76643..2c9a46ad 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/chain/RuntimeVersionRequestTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/chain/RuntimeVersionRequestTest.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.integration.chain - -import jp.co.soramitsu.fearless_utils.integration.BaseIntegrationTest -import jp.co.soramitsu.fearless_utils.wsrpc.executeAsync -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.chain.RuntimeVersionRequest -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.chain.SubscribeRuntimeVersionRequest -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.chain.runtimeVersionChange -import jp.co.soramitsu.fearless_utils.wsrpc.subscriptionFlow +package io.novasama.substrate_sdk_android.integration.chain + +import io.novasama.substrate_sdk_android.integration.BaseIntegrationTest +import io.novasama.substrate_sdk_android.wsrpc.executeAsync +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.chain.RuntimeVersionRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.chain.SubscribeRuntimeVersionRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.chain.runtimeVersionChange +import io.novasama.substrate_sdk_android.wsrpc.subscriptionFlow import kotlinx.coroutines.flow.first import kotlinx.coroutines.runBlocking import org.junit.Ignore diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/extrinsic/SendIntegrationTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/extrinsic/SendIntegrationTest.kt similarity index 54% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/extrinsic/SendIntegrationTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/extrinsic/SendIntegrationTest.kt index cf5387c7..20d94257 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/extrinsic/SendIntegrationTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/extrinsic/SendIntegrationTest.kt @@ -1,22 +1,20 @@ -package jp.co.soramitsu.fearless_utils.integration.extrinsic - -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.keypair.BaseKeypair -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.integration.BaseIntegrationTest -import jp.co.soramitsu.fearless_utils.integration.WESTEND_URL -import jp.co.soramitsu.fearless_utils.integration.transfer -import jp.co.soramitsu.fearless_utils.runtime.RealRuntimeProvider -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.multiAddressFromId -import jp.co.soramitsu.fearless_utils.runtime.extrinsic.ExtrinsicBuilder -import jp.co.soramitsu.fearless_utils.runtime.extrinsic.Nonce -import jp.co.soramitsu.fearless_utils.runtime.extrinsic.signer.KeyPairSigner -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.publicKeyToSubstrateAccountId -import jp.co.soramitsu.fearless_utils.wsrpc.executeAsync -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.author.SubmitExtrinsicRequest -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.chain.RuntimeVersion +package io.novasama.substrate_sdk_android.integration.extrinsic + +import io.novasama.substrate_sdk_android.encrypt.EncryptionType +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.keypair.BaseKeypair +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.integration.BaseIntegrationTest +import io.novasama.substrate_sdk_android.integration.WESTEND_URL +import io.novasama.substrate_sdk_android.integration.transfer +import io.novasama.substrate_sdk_android.runtime.RealRuntimeProvider +import io.novasama.substrate_sdk_android.runtime.extrinsic.ExtrinsicBuilder +import io.novasama.substrate_sdk_android.runtime.extrinsic.Nonce +import io.novasama.substrate_sdk_android.runtime.extrinsic.signer.KeyPairSigner +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.publicKeyToSubstrateAccountId +import io.novasama.substrate_sdk_android.wsrpc.executeAsync +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.author.SubmitExtrinsicRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.chain.RuntimeVersion import kotlinx.coroutines.runBlocking import org.junit.Ignore import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/system/NodeNetworkTypeRequestTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/system/NodeNetworkTypeRequestTest.kt similarity index 65% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/system/NodeNetworkTypeRequestTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/system/NodeNetworkTypeRequestTest.kt index c493d035..42a819c6 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/integration/system/NodeNetworkTypeRequestTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/integration/system/NodeNetworkTypeRequestTest.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.integration.system +package io.novasama.substrate_sdk_android.integration.system -import jp.co.soramitsu.fearless_utils.integration.BaseIntegrationTest -import jp.co.soramitsu.fearless_utils.wsrpc.executeAsync -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.system.NodeNetworkTypeRequest +import io.novasama.substrate_sdk_android.integration.BaseIntegrationTest +import io.novasama.substrate_sdk_android.wsrpc.executeAsync +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.system.NodeNetworkTypeRequest import kotlinx.coroutines.runBlocking import org.junit.Assert.assertEquals import org.junit.Ignore diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/Common.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/Common.kt similarity index 69% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/Common.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/Common.kt index dddfaf02..2d99db2a 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/Common.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/Common.kt @@ -1,20 +1,20 @@ -package jp.co.soramitsu.fearless_utils.runtime +package io.novasama.substrate_sdk_android.runtime import com.google.gson.Gson import com.google.gson.stream.JsonReader -import jp.co.soramitsu.fearless_utils.getFileContentFromResources -import jp.co.soramitsu.fearless_utils.getResourceReader -import jp.co.soramitsu.fearless_utils.runtime.definitions.TypeDefinitionParser -import jp.co.soramitsu.fearless_utils.runtime.definitions.TypeDefinitionsTree -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeResolver -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.GenericsExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.v13Preset -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.v14Preset -import jp.co.soramitsu.fearless_utils.runtime.definitions.v14.TypesParserV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadataReader -import jp.co.soramitsu.fearless_utils.runtime.metadata.builder.VersionedRuntimeBuilder -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.RuntimeMetadataSchemaV14 +import io.novasama.substrate_sdk_android.getFileContentFromResources +import io.novasama.substrate_sdk_android.getResourceReader +import io.novasama.substrate_sdk_android.runtime.definitions.TypeDefinitionParser +import io.novasama.substrate_sdk_android.runtime.definitions.TypeDefinitionsTree +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeResolver +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.GenericsExtension +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.registry.v13Preset +import io.novasama.substrate_sdk_android.runtime.definitions.registry.v14Preset +import io.novasama.substrate_sdk_android.runtime.definitions.v14.TypesParserV14 +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadataReader +import io.novasama.substrate_sdk_android.runtime.metadata.builder.VersionedRuntimeBuilder +import io.novasama.substrate_sdk_android.runtime.metadata.v14.RuntimeMetadataSchemaV14 object RealRuntimeProvider { diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/ModulesTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/ModulesTest.kt similarity index 92% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/ModulesTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/ModulesTest.kt index ec7d3acf..4664ba0a 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/ModulesTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/ModulesTest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.runtime +package io.novasama.substrate_sdk_android.runtime -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.toAccountId +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.toAccountId import org.bouncycastle.util.encoders.Hex import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/ParsingExtKtTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/ParsingExtKtTest.kt similarity index 96% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/ParsingExtKtTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/ParsingExtKtTest.kt index 4325a892..00351b45 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/ParsingExtKtTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/ParsingExtKtTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions +package io.novasama.substrate_sdk_android.runtime.definitions import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/TypeDefinitionParserTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/TypeDefinitionParserTest.kt similarity index 85% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/TypeDefinitionParserTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/TypeDefinitionParserTest.kt index 91101b58..6f844a8c 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/TypeDefinitionParserTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/TypeDefinitionParserTest.kt @@ -1,29 +1,29 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions +package io.novasama.substrate_sdk_android.runtime.definitions import com.google.gson.Gson import com.google.gson.stream.JsonReader -import jp.co.soramitsu.fearless_utils.common.assertInstance -import jp.co.soramitsu.fearless_utils.getResourceReader -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeResolver -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePreset -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.type -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.typePreset -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.unknownTypes -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.v13Preset -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.CollectionEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.FixedArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Option -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.SetType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Tuple -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Vec -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.FixedByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u64 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.stub.FakeType +import io.novasama.substrate_sdk_android.common.assertInstance +import io.novasama.substrate_sdk_android.getResourceReader +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeResolver +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePreset +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.registry.type +import io.novasama.substrate_sdk_android.runtime.definitions.registry.typePreset +import io.novasama.substrate_sdk_android.runtime.definitions.registry.unknownTypes +import io.novasama.substrate_sdk_android.runtime.definitions.registry.v13Preset +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.CollectionEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.FixedArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Option +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.SetType +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Tuple +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Vec +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u64 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.stub.FakeType import org.junit.Assert.assertEquals import org.junit.Ignore import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/aliases/HasCompactAliasTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/aliases/HasCompactAliasTest.kt similarity index 58% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/aliases/HasCompactAliasTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/aliases/HasCompactAliasTest.kt index 5081b6f8..e180bb58 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/aliases/HasCompactAliasTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/aliases/HasCompactAliasTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.aliases +package io.novasama.substrate_sdk_android.runtime.definitions.aliases import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/extensions/GenericsExtensionTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/extensions/GenericsExtensionTest.kt similarity index 66% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/extensions/GenericsExtensionTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/extensions/GenericsExtensionTest.kt index 4efc14d6..f8d0ffa5 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/extensions/GenericsExtensionTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/extensions/GenericsExtensionTest.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.registry.extensions +package io.novasama.substrate_sdk_android.runtime.definitions.registry.extensions -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.TypeProvider -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.GenericsExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.stub.FakeType +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.TypeProvider +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.GenericsExtension +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.stub.FakeType import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/extensions/HashMapExtensionTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/extensions/HashMapExtensionTest.kt similarity index 50% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/extensions/HashMapExtensionTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/extensions/HashMapExtensionTest.kt index b98c0aa8..dcd91a28 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/registry/extensions/HashMapExtensionTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/extensions/HashMapExtensionTest.kt @@ -1,20 +1,20 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.registry.extensions +package io.novasama.substrate_sdk_android.runtime.definitions.registry.extensions import com.google.gson.Gson import com.google.gson.stream.JsonReader -import jp.co.soramitsu.fearless_utils.common.assertInstance -import jp.co.soramitsu.fearless_utils.getResourceReader -import jp.co.soramitsu.fearless_utils.runtime.definitions.TypeDefinitionParser -import jp.co.soramitsu.fearless_utils.runtime.definitions.TypeDefinitionsTree -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeResolver -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.TypeProvider -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.HashMapExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.v13Preset -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Tuple -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Vec -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.stub.FakeType +import io.novasama.substrate_sdk_android.common.assertInstance +import io.novasama.substrate_sdk_android.getResourceReader +import io.novasama.substrate_sdk_android.runtime.definitions.TypeDefinitionParser +import io.novasama.substrate_sdk_android.runtime.definitions.TypeDefinitionsTree +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeResolver +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.TypeProvider +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.HashMapExtension +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.registry.v13Preset +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Tuple +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Vec +import io.novasama.substrate_sdk_android.runtime.definitions.types.stub.FakeType import org.junit.Assert import org.junit.Test diff --git a/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/extensions/VectorExtensionTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/extensions/VectorExtensionTest.kt new file mode 100644 index 00000000..0d0c98ee --- /dev/null +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/registry/extensions/VectorExtensionTest.kt @@ -0,0 +1,27 @@ +package io.novasama.substrate_sdk_android.runtime.definitions.registry.extensions + +import io.novasama.substrate_sdk_android.common.assertInstance +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.VectorExtension +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Vec +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.DynamicByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import org.junit.Test + +class VectorExtensionTest { + + @Test + fun `should create optimized type for u8`() { + val result = VectorExtension.createWrapper("A", TypeReference(u8)) + + assertInstance(result) + } + + @Test + fun `should create vec type for other type`() { + val result = VectorExtension.createWrapper("A", TypeReference(BooleanType)) + + assertInstance(result) + } +} \ No newline at end of file diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/BaseTypeTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/BaseTypeTest.kt similarity index 63% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/BaseTypeTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/BaseTypeTest.kt index fcc1dd57..2d8c01a4 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/BaseTypeTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/BaseTypeTest.kt @@ -1,19 +1,19 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types +package io.novasama.substrate_sdk_android.runtime.definitions.types -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeResolver -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.extentsions.GenericsExtension -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.v13Preset -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.metadata.ExtrinsicMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Event -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.FunctionArgument -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.MetadataFunction -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Module -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Storage +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeResolver +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.extentsions.GenericsExtension +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.registry.v13Preset +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.metadata.ExtrinsicMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.module.Event +import io.novasama.substrate_sdk_android.runtime.metadata.module.FunctionArgument +import io.novasama.substrate_sdk_android.runtime.metadata.module.MetadataFunction +import io.novasama.substrate_sdk_android.runtime.metadata.module.Module +import io.novasama.substrate_sdk_android.runtime.metadata.module.Storage import java.math.BigInteger abstract class BaseTypeTest { diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/TypeReferenceExtTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/TypeReferenceExtTest.kt similarity index 85% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/TypeReferenceExtTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/TypeReferenceExtTest.kt index 33c7b1af..a88844bb 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/TypeReferenceExtTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/TypeReferenceExtTest.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types +package io.novasama.substrate_sdk_android.runtime.definitions.types -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Alias -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Alias +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/CollectionEnumTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/CollectionEnumTest.kt similarity index 76% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/CollectionEnumTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/CollectionEnumTest.kt index b5262cf7..db104acd 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/CollectionEnumTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/CollectionEnumTest.kt @@ -1,8 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/DictEnumTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/DictEnumTest.kt similarity index 80% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/DictEnumTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/DictEnumTest.kt index 4ca4099b..6d004375 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/DictEnumTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/DictEnumTest.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Null -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u128 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite + +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Null +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u128 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/FixedArrayTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/FixedArrayTest.kt similarity index 69% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/FixedArrayTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/FixedArrayTest.kt index a9cfba16..36d9ef6c 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/FixedArrayTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/FixedArrayTest.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/OptionTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/OptionTest.kt similarity index 77% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/OptionTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/OptionTest.kt index 3dbc8618..cc023196 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/OptionTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/OptionTest.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite - -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite + +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/SetTypeTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/SetTypeTest.kt similarity index 76% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/SetTypeTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/SetTypeTest.kt index 214c4243..e08ecebc 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/SetTypeTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/SetTypeTest.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/StructTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/StructTest.kt similarity index 68% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/StructTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/StructTest.kt index c482faec..f4e96172 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/StructTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/StructTest.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite + +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/TupleTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/TupleTest.kt similarity index 64% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/TupleTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/TupleTest.kt index b43684d9..1b02d9ae 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/TupleTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/TupleTest.kt @@ -1,11 +1,11 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite + +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/VecTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/VecTest.kt similarity index 67% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/VecTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/VecTest.kt index 7d689428..159d6ddb 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/composite/VecTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/composite/VecTest.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite +package io.novasama.substrate_sdk_android.runtime.definitions.types.composite -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/BitVecTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/BitVecTest.kt similarity index 84% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/BitVecTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/BitVecTest.kt index b3cac914..ae104c12 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/BitVecTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/BitVecTest.kt @@ -1,9 +1,8 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/DataTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/DataTest.kt similarity index 71% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/DataTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/DataTest.kt index 25b62b55..b5e41c22 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/DataTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/DataTest.kt @@ -1,16 +1,16 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.common.assertInstance -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypePresetBuilder -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.common.assertInstance +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypePresetBuilder +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/EraTypeTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/EraTypeTest.kt similarity index 76% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/EraTypeTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/EraTypeTest.kt index f4bb8e44..fc36019c 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/EraTypeTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/EraTypeTest.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.common.assertInstance -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Era.Companion.getPeriodPhaseFromBlockPeriod -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.common.assertInstance +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Era.Companion.getPeriodPhaseFromBlockPeriod +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ExtrinsicTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ExtrinsicTest.kt similarity index 76% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ExtrinsicTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ExtrinsicTest.kt index dac45146..29a38da3 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ExtrinsicTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ExtrinsicTest.kt @@ -1,17 +1,17 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.encrypt.SignatureWrapper -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.runtime.RealRuntimeProvider -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Extrinsic.EncodingInstance.* -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.instances.AddressInstanceConstructor -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.instances.SignatureInstanceConstructor -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex -import jp.co.soramitsu.fearless_utils.runtime.metadata.call -import jp.co.soramitsu.fearless_utils.runtime.metadata.module +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.encrypt.SignatureWrapper +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.runtime.RealRuntimeProvider +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Extrinsic.EncodingInstance.* +import io.novasama.substrate_sdk_android.runtime.definitions.types.instances.AddressInstanceConstructor +import io.novasama.substrate_sdk_android.runtime.definitions.types.instances.SignatureInstanceConstructor +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.metadata.call +import io.novasama.substrate_sdk_android.runtime.metadata.module import org.junit.Assert.assertEquals import org.junit.Test import java.math.BigInteger diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericCallTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericCallTest.kt similarity index 76% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericCallTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericCallTest.kt index 82428d60..9b26589b 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericCallTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericCallTest.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex -import jp.co.soramitsu.fearless_utils.runtime.metadata.call -import jp.co.soramitsu.fearless_utils.runtime.metadata.module +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.metadata.call +import io.novasama.substrate_sdk_android.runtime.metadata.module import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericEventTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericEventTest.kt similarity index 74% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericEventTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericEventTest.kt index b7ce0605..5d2fe88c 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/GenericEventTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/GenericEventTest.kt @@ -1,13 +1,12 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex -import jp.co.soramitsu.fearless_utils.runtime.metadata.call -import jp.co.soramitsu.fearless_utils.runtime.metadata.event -import jp.co.soramitsu.fearless_utils.runtime.metadata.module +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.metadata.event +import io.novasama.substrate_sdk_android.runtime.metadata.module import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/HashTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/HashTest.kt similarity index 77% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/HashTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/HashTest.kt index 2d169a79..55100bad 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/HashTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/HashTest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.common.assertThrows +import io.novasama.substrate_sdk_android.common.assertThrows import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/OpaqueCallTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/OpaqueCallTest.kt similarity index 64% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/OpaqueCallTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/OpaqueCallTest.kt index 5005e29b..15f1c9de 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/OpaqueCallTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/OpaqueCallTest.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex -import jp.co.soramitsu.fearless_utils.runtime.metadata.call -import jp.co.soramitsu.fearless_utils.runtime.metadata.module +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.metadata.call +import io.novasama.substrate_sdk_android.runtime.metadata.module import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ResultTypeTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ResultTypeTest.kt similarity index 57% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ResultTypeTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ResultTypeTest.kt index 9bb77893..4c81558e 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/ResultTypeTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/ResultTypeTest.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.TypeReference -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u32 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.TypeReference +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u32 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u8 +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex import org.junit.Assert import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/SignedExtrasTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/SignedExtrasTest.kt similarity index 86% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/SignedExtrasTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/SignedExtrasTest.kt index 3bf2ebfb..fc50bc5e 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/generics/SignedExtrasTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/generics/SignedExtrasTest.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics - -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.errors.EncodeDecodeException -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex -import jp.co.soramitsu.fearless_utils.runtime.metadata.ExtrinsicMetadata -import jp.co.soramitsu.fearless_utils.runtime.metadata.RuntimeMetadata +package io.novasama.substrate_sdk_android.runtime.definitions.types.generics + +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.errors.EncodeDecodeException +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.metadata.ExtrinsicMetadata +import io.novasama.substrate_sdk_android.runtime.metadata.RuntimeMetadata import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/IntTypeTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/IntTypeTest.kt similarity index 65% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/IntTypeTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/IntTypeTest.kt index 24d230a8..ca606349 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/definitions/types/primitives/IntTypeTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/definitions/types/primitives/IntTypeTest.kt @@ -1,12 +1,10 @@ -package jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives +package io.novasama.substrate_sdk_android.runtime.definitions.types.primitives -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.BaseTypeTest +import io.novasama.substrate_sdk_android.runtime.definitions.types.BaseTypeTest import org.junit.Test -import java.math.BigInteger -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.i64 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.toHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.toHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex import org.junit.Assert.assertEquals class IntTypeTest : BaseTypeTest() { diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/ExtrinsicBuilderTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/extrinsic/ExtrinsicBuilderTest.kt similarity index 90% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/ExtrinsicBuilderTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/extrinsic/ExtrinsicBuilderTest.kt index 02731186..765e21d4 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/extrinsic/ExtrinsicBuilderTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/extrinsic/ExtrinsicBuilderTest.kt @@ -1,20 +1,20 @@ -package jp.co.soramitsu.fearless_utils.runtime.extrinsic - -import jp.co.soramitsu.fearless_utils.encrypt.EncryptionType -import jp.co.soramitsu.fearless_utils.encrypt.MultiChainEncryption -import jp.co.soramitsu.fearless_utils.encrypt.keypair.BaseKeypair -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.integration.transfer -import jp.co.soramitsu.fearless_utils.runtime.RealRuntimeProvider -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.fromHex -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Era -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Extrinsic -import jp.co.soramitsu.fearless_utils.runtime.extrinsic.signer.KeyPairSigner -import jp.co.soramitsu.fearless_utils.runtime.metadata.SignedExtensionValue -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.publicKeyToSubstrateAccountId -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.toAccountId -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.chain.RuntimeVersion +package io.novasama.substrate_sdk_android.runtime.extrinsic + +import io.novasama.substrate_sdk_android.encrypt.EncryptionType +import io.novasama.substrate_sdk_android.encrypt.MultiChainEncryption +import io.novasama.substrate_sdk_android.encrypt.keypair.BaseKeypair +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.integration.transfer +import io.novasama.substrate_sdk_android.runtime.RealRuntimeProvider +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.types.fromHex +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Era +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Extrinsic +import io.novasama.substrate_sdk_android.runtime.extrinsic.signer.KeyPairSigner +import io.novasama.substrate_sdk_android.runtime.metadata.SignedExtensionValue +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.publicKeyToSubstrateAccountId +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.toAccountId +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.chain.RuntimeVersion import kotlinx.coroutines.test.runBlockingTest import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/metadata/Metadata14Test.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/metadata/Metadata14Test.kt similarity index 73% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/metadata/Metadata14Test.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/metadata/Metadata14Test.kt index b1e57f61..b7020177 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/metadata/Metadata14Test.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/metadata/Metadata14Test.kt @@ -1,41 +1,37 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata - -import jp.co.soramitsu.fearless_utils.common.assertInstance -import jp.co.soramitsu.fearless_utils.common.assertNotInstance -import jp.co.soramitsu.fearless_utils.common.median -import jp.co.soramitsu.fearless_utils.getFileContentFromResources -import jp.co.soramitsu.fearless_utils.runtime.definitions.dynamic.DynamicTypeResolver -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.unknownTypes -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.v14Preset -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Alias -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.DictEnum -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.FixedArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Option -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Struct -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Tuple -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.composite.Vec -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Null -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.DynamicByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.FixedByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.UIntType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u32 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u64 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u128 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.GenericCall -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Data -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u8 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.i64 -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.skipAliases -import jp.co.soramitsu.fearless_utils.runtime.definitions.v14.TypesParserV14 -import jp.co.soramitsu.fearless_utils.runtime.metadata.builder.VersionedRuntimeBuilder -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntryType -import jp.co.soramitsu.fearless_utils.runtime.metadata.v14.RuntimeMetadataSchemaV14 -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot +package io.novasama.substrate_sdk_android.runtime.metadata + +import io.novasama.substrate_sdk_android.common.assertInstance +import io.novasama.substrate_sdk_android.common.assertNotInstance +import io.novasama.substrate_sdk_android.common.median +import io.novasama.substrate_sdk_android.getFileContentFromResources +import io.novasama.substrate_sdk_android.runtime.definitions.dynamic.DynamicTypeResolver +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.registry.unknownTypes +import io.novasama.substrate_sdk_android.runtime.definitions.registry.v14Preset +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Alias +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.DictEnum +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Option +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Struct +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Tuple +import io.novasama.substrate_sdk_android.runtime.definitions.types.composite.Vec +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Null +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.DynamicByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.FixedByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u32 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u64 +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u128 +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.GenericCall +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Data +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.i64 +import io.novasama.substrate_sdk_android.runtime.definitions.types.skipAliases +import io.novasama.substrate_sdk_android.runtime.definitions.v14.TypesParserV14 +import io.novasama.substrate_sdk_android.runtime.metadata.builder.VersionedRuntimeBuilder +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntryType +import io.novasama.substrate_sdk_android.runtime.metadata.v14.RuntimeMetadataSchemaV14 +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot import org.junit.Assert.assertEquals import org.junit.Assert.assertNotNull import org.junit.Assert.assertNull -import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.junit.MockitoJUnitRunner diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/metadata/MetadataTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/metadata/MetadataTest.kt similarity index 86% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/metadata/MetadataTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/metadata/MetadataTest.kt index 9c6343dd..7f21ed61 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/metadata/MetadataTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/metadata/MetadataTest.kt @@ -1,13 +1,13 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata - -import jp.co.soramitsu.fearless_utils.common.assertInstance -import jp.co.soramitsu.fearless_utils.getFileContentFromResources -import jp.co.soramitsu.fearless_utils.runtime.RealRuntimeProvider -import jp.co.soramitsu.fearless_utils.runtime.definitions.registry.TypeRegistry -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.stub.FakeType -import jp.co.soramitsu.fearless_utils.runtime.metadata.builder.VersionedRuntimeBuilder -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntryType -import jp.co.soramitsu.fearless_utils.scale.EncodableStruct +package io.novasama.substrate_sdk_android.runtime.metadata + +import io.novasama.substrate_sdk_android.common.assertInstance +import io.novasama.substrate_sdk_android.getFileContentFromResources +import io.novasama.substrate_sdk_android.runtime.RealRuntimeProvider +import io.novasama.substrate_sdk_android.runtime.definitions.registry.TypeRegistry +import io.novasama.substrate_sdk_android.runtime.definitions.types.stub.FakeType +import io.novasama.substrate_sdk_android.runtime.metadata.builder.VersionedRuntimeBuilder +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntryType +import io.novasama.substrate_sdk_android.scale.EncodableStruct import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataExtKtTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataExtKtTest.kt similarity index 84% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataExtKtTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataExtKtTest.kt index cb3366bd..23616f39 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/runtime/metadata/RuntimeMetadataExtKtTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/runtime/metadata/RuntimeMetadataExtKtTest.kt @@ -1,17 +1,17 @@ -package jp.co.soramitsu.fearless_utils.runtime.metadata - -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.hash.Hasher.xxHash128 -import jp.co.soramitsu.fearless_utils.runtime.RuntimeSnapshot -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.generics.Null -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.BooleanType -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.DynamicByteArray -import jp.co.soramitsu.fearless_utils.runtime.definitions.types.primitives.u32 -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntry -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.StorageEntryType -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.MetadataFunction -import jp.co.soramitsu.fearless_utils.runtime.metadata.module.Module +package io.novasama.substrate_sdk_android.runtime.metadata + +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.hash.Hasher.xxHash128 +import io.novasama.substrate_sdk_android.runtime.RuntimeSnapshot +import io.novasama.substrate_sdk_android.runtime.definitions.types.generics.Null +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.BooleanType +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.DynamicByteArray +import io.novasama.substrate_sdk_android.runtime.definitions.types.primitives.u32 +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntry +import io.novasama.substrate_sdk_android.runtime.metadata.module.StorageEntryType +import io.novasama.substrate_sdk_android.runtime.metadata.module.MetadataFunction +import io.novasama.substrate_sdk_android.runtime.metadata.module.Module import org.junit.Assert.assertArrayEquals import org.junit.Assert.assertEquals import org.junit.Test @@ -19,7 +19,6 @@ import org.junit.runner.RunWith import org.mockito.Mock import org.mockito.Mockito import org.mockito.junit.MockitoJUnitRunner -import java.math.BigInteger private val MODULE_NAME = "Test" private val CALL_NAME = "Test" diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/scale/ScaleStructTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/scale/ScaleStructTest.kt similarity index 81% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/scale/ScaleStructTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/scale/ScaleStructTest.kt index 5335ad18..9e037d7b 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/scale/ScaleStructTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/scale/ScaleStructTest.kt @@ -1,31 +1,30 @@ @file:Suppress("EXPERIMENTAL_API_USAGE") -package jp.co.soramitsu.fearless_utils.scale +package io.novasama.substrate_sdk_android.scale import io.emeraldpay.polkaj.scale.ScaleCodecReader import io.emeraldpay.polkaj.scale.ScaleCodecWriter -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.scale.Account.address -import jp.co.soramitsu.fearless_utils.scale.Account.balance -import jp.co.soramitsu.fearless_utils.scale.Account.something -import jp.co.soramitsu.fearless_utils.scale.AccountData.feeFrozen -import jp.co.soramitsu.fearless_utils.scale.AccountData.free -import jp.co.soramitsu.fearless_utils.scale.AccountData.miscFrozen -import jp.co.soramitsu.fearless_utils.scale.AccountData.reserved -import jp.co.soramitsu.fearless_utils.scale.AccountInfo.data -import jp.co.soramitsu.fearless_utils.scale.AccountInfo.nonce -import jp.co.soramitsu.fearless_utils.scale.AccountInfo.refCount -import jp.co.soramitsu.fearless_utils.scale.Address.publicKey -import jp.co.soramitsu.fearless_utils.scale.Balance.value -import jp.co.soramitsu.fearless_utils.scale.DefaultValues.bigInteger -import jp.co.soramitsu.fearless_utils.scale.DefaultValues.bytes -import jp.co.soramitsu.fearless_utils.scale.DefaultValues.text -import jp.co.soramitsu.fearless_utils.scale.Vector.numbers -import jp.co.soramitsu.fearless_utils.scale.dataType.DataType -import jp.co.soramitsu.fearless_utils.scale.dataType.compactInt -import jp.co.soramitsu.fearless_utils.scale.dataType.scalable -import jp.co.soramitsu.fearless_utils.scale.dataType.string -import jp.co.soramitsu.fearless_utils.scale.dataType.uint16 +import io.novasama.substrate_sdk_android.scale.Account.address +import io.novasama.substrate_sdk_android.scale.Account.balance +import io.novasama.substrate_sdk_android.scale.Account.something +import io.novasama.substrate_sdk_android.scale.AccountData.feeFrozen +import io.novasama.substrate_sdk_android.scale.AccountData.free +import io.novasama.substrate_sdk_android.scale.AccountData.miscFrozen +import io.novasama.substrate_sdk_android.scale.AccountData.reserved +import io.novasama.substrate_sdk_android.scale.AccountInfo.data +import io.novasama.substrate_sdk_android.scale.AccountInfo.nonce +import io.novasama.substrate_sdk_android.scale.AccountInfo.refCount +import io.novasama.substrate_sdk_android.scale.Address.publicKey +import io.novasama.substrate_sdk_android.scale.Balance.value +import io.novasama.substrate_sdk_android.scale.DefaultValues.bigInteger +import io.novasama.substrate_sdk_android.scale.DefaultValues.bytes +import io.novasama.substrate_sdk_android.scale.DefaultValues.text +import io.novasama.substrate_sdk_android.scale.Vector.numbers +import io.novasama.substrate_sdk_android.scale.dataType.DataType +import io.novasama.substrate_sdk_android.scale.dataType.compactInt +import io.novasama.substrate_sdk_android.scale.dataType.scalable +import io.novasama.substrate_sdk_android.scale.dataType.string +import io.novasama.substrate_sdk_android.scale.dataType.uint16 import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Test @@ -34,8 +33,8 @@ import org.mockito.junit.MockitoJUnitRunner import java.math.BigDecimal import java.math.BigInteger import java.math.MathContext -import jp.co.soramitsu.fearless_utils.scale.dataType.boolean as Bool -import jp.co.soramitsu.fearless_utils.scale.dataType.uint8 as Uint8 +import io.novasama.substrate_sdk_android.scale.dataType.boolean as Bool +import io.novasama.substrate_sdk_android.scale.dataType.uint8 as Uint8 object OnlyCompact : Schema() { val compact by compactInt() diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/scale/dataType/EnumTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/scale/dataType/EnumTest.kt similarity index 69% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/scale/dataType/EnumTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/scale/dataType/EnumTest.kt index e0dc789e..8d702a85 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/scale/dataType/EnumTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/scale/dataType/EnumTest.kt @@ -1,9 +1,8 @@ -package jp.co.soramitsu.fearless_utils.scale.dataType +package io.novasama.substrate_sdk_android.scale.dataType -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.scale.Schema -import jp.co.soramitsu.fearless_utils.scale.enum -import jp.co.soramitsu.fearless_utils.scale.toHexString +import io.novasama.substrate_sdk_android.scale.Schema +import io.novasama.substrate_sdk_android.scale.enum +import io.novasama.substrate_sdk_android.scale.toHexString import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/scale/dataType/UintTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/scale/dataType/UintTest.kt similarity index 94% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/scale/dataType/UintTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/scale/dataType/UintTest.kt index 51b3da74..98ea2a2c 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/scale/dataType/UintTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/scale/dataType/UintTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.scale.dataType +package io.novasama.substrate_sdk_android.scale.dataType import org.junit.Assert.assertArrayEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/ss58/SS58EncoderTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/ss58/SS58EncoderTest.kt similarity index 72% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/ss58/SS58EncoderTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/ss58/SS58EncoderTest.kt index 9b373798..28ad71c5 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/ss58/SS58EncoderTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/ss58/SS58EncoderTest.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.ss58 +package io.novasama.substrate_sdk_android.ss58 import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.extensions.fromHex -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.getResourceReader -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.addressPrefix -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.toAccountId -import jp.co.soramitsu.fearless_utils.ss58.SS58Encoder.toAddress +import io.novasama.substrate_sdk_android.extensions.fromHex +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.getResourceReader +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.addressPrefix +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.toAccountId +import io.novasama.substrate_sdk_android.ss58.SS58Encoder.toAddress import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/MockSocketFactory.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/MockSocketFactory.kt similarity index 87% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/MockSocketFactory.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/MockSocketFactory.kt index 85cf3a6e..309e7d4f 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/MockSocketFactory.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/MockSocketFactory.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc +package io.novasama.substrate_sdk_android.wsrpc import com.neovisionaries.ws.client.WebSocket import com.neovisionaries.ws.client.WebSocketFactory diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/StdoutLogger.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/StdoutLogger.kt similarity index 62% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/StdoutLogger.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/StdoutLogger.kt index dd35512d..2964b2ac 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/StdoutLogger.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/StdoutLogger.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.wsrpc +package io.novasama.substrate_sdk_android.wsrpc -import jp.co.soramitsu.fearless_utils.wsrpc.logging.Logger +import io.novasama.substrate_sdk_android.wsrpc.logging.Logger object StdoutLogger : Logger { override fun log(message: String?) { diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/SubscribedCallbackTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/SubscribedCallbackTest.kt similarity index 82% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/SubscribedCallbackTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/SubscribedCallbackTest.kt index 13678cdb..b34e2127 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/SubscribedCallbackTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/SubscribedCallbackTest.kt @@ -1,10 +1,10 @@ -package jp.co.soramitsu.fearless_utils.wsrpc +package io.novasama.substrate_sdk_android.wsrpc import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.any -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.any +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/MappersTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/mappers/MappersTest.kt similarity index 84% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/MappersTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/mappers/MappersTest.kt index 68341449..018e6397 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/MappersTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/mappers/MappersTest.kt @@ -1,15 +1,15 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.mappers +package io.novasama.substrate_sdk_android.wsrpc.mappers import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.scale.Schema -import jp.co.soramitsu.fearless_utils.scale.bool -import jp.co.soramitsu.fearless_utils.scale.invoke -import jp.co.soramitsu.fearless_utils.scale.toHexString -import jp.co.soramitsu.fearless_utils.scale.uint32 -import jp.co.soramitsu.fearless_utils.wsrpc.exception.RpcException -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcError -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.scale.Schema +import io.novasama.substrate_sdk_android.scale.bool +import io.novasama.substrate_sdk_android.scale.invoke +import io.novasama.substrate_sdk_android.scale.toHexString +import io.novasama.substrate_sdk_android.scale.uint32 +import io.novasama.substrate_sdk_android.wsrpc.exception.RpcException +import io.novasama.substrate_sdk_android.wsrpc.response.RpcError +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/StringIdMapperTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/mappers/StringIdMapperTest.kt similarity index 84% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/StringIdMapperTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/mappers/StringIdMapperTest.kt index e300355e..dcf68476 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/mappers/StringIdMapperTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/mappers/StringIdMapperTest.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.mappers +package io.novasama.substrate_sdk_android.wsrpc.mappers import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse import org.junit.Assert.* import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/AccountRequestTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/AccountRequestTest.kt similarity index 88% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/AccountRequestTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/AccountRequestTest.kt index 941aa90d..7df94daf 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/AccountRequestTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/AccountRequestTest.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request +package io.novasama.substrate_sdk_android.wsrpc.request import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.account.AccountInfoRequest +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.account.AccountInfoRequest import org.bouncycastle.util.encoders.Hex import org.junit.Assert.assertEquals import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/Common.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/Common.kt similarity index 68% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/Common.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/Common.kt index 7687cf81..45c230bf 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/Common.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/Common.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime +package io.novasama.substrate_sdk_android.wsrpc.request.runtime -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange internal fun createFakeChange( result: Any, diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/UnsubscribeMethodResolverTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/UnsubscribeMethodResolverTest.kt similarity index 88% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/UnsubscribeMethodResolverTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/UnsubscribeMethodResolverTest.kt index 5cb3090b..5e10b0be 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/UnsubscribeMethodResolverTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/UnsubscribeMethodResolverTest.kt @@ -1,6 +1,6 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime +package io.novasama.substrate_sdk_android.wsrpc.request.runtime -import jp.co.soramitsu.fearless_utils.common.assertThrows +import io.novasama.substrate_sdk_android.common.assertThrows import org.junit.Assert.* import org.junit.Test import java.lang.IllegalArgumentException diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/chain/SubscribeRuntimeVersionTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/chain/SubscribeRuntimeVersionTest.kt similarity index 75% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/chain/SubscribeRuntimeVersionTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/chain/SubscribeRuntimeVersionTest.kt index 12eef95c..54fdb647 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/chain/SubscribeRuntimeVersionTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/chain/SubscribeRuntimeVersionTest.kt @@ -1,8 +1,7 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.chain +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.chain -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.createFakeChange -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage.storageChange +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.createFakeChange import org.junit.Assert.* import org.junit.Test import java.lang.IllegalArgumentException diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexerTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexerTest.kt similarity index 91% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexerTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexerTest.kt index 65783f72..4c753017 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexerTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/StorageSubscriptionMultiplexerTest.kt @@ -1,9 +1,9 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage -import jp.co.soramitsu.fearless_utils.any -import jp.co.soramitsu.fearless_utils.argThat -import jp.co.soramitsu.fearless_utils.wsrpc.SocketService -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +import io.novasama.substrate_sdk_android.any +import io.novasama.substrate_sdk_android.argThat +import io.novasama.substrate_sdk_android.wsrpc.SocketService +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange import org.junit.Test import org.mockito.BDDMockito.given import org.mockito.BDDMockito.verify diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/SubscribeStorageTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/SubscribeStorageTest.kt similarity index 80% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/SubscribeStorageTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/SubscribeStorageTest.kt index eba16259..139ffc91 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/request/runtime/storage/SubscribeStorageTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/request/runtime/storage/SubscribeStorageTest.kt @@ -1,7 +1,7 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.storage +package io.novasama.substrate_sdk_android.wsrpc.request.runtime.storage -import jp.co.soramitsu.fearless_utils.common.assertThrows -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.createFakeChange +import io.novasama.substrate_sdk_android.common.assertThrows +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.createFakeChange import org.junit.Assert.assertEquals import org.junit.Test import java.lang.IllegalArgumentException diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/response/ResponseTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/response/ResponseTest.kt similarity index 95% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/response/ResponseTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/response/ResponseTest.kt index f82b258d..7960da1f 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/response/ResponseTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/response/ResponseTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.response +package io.novasama.substrate_sdk_android.wsrpc.response import com.google.gson.Gson import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/state/SocketStateMachineTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/state/SocketStateMachineTest.kt similarity index 93% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/state/SocketStateMachineTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/state/SocketStateMachineTest.kt index 03b6741c..4a9c54ff 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/state/SocketStateMachineTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/state/SocketStateMachineTest.kt @@ -1,25 +1,24 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.state - -import jp.co.soramitsu.fearless_utils.common.assertInstance -import jp.co.soramitsu.fearless_utils.wsrpc.SocketService -import jp.co.soramitsu.fearless_utils.wsrpc.SocketService.* -import jp.co.soramitsu.fearless_utils.wsrpc.request.DeliveryType -import jp.co.soramitsu.fearless_utils.wsrpc.request.runtime.createFakeChange -import jp.co.soramitsu.fearless_utils.wsrpc.response.RpcResponse -import jp.co.soramitsu.fearless_utils.wsrpc.socket.RpcSocket -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.Event -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.Sendable -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect.Connect -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect.Disconnect -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect.RespondSendablesError -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect.RespondToSubscription -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect.ResponseToSendable -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect.ScheduleReconnect -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect.SendSendables -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.SideEffect.Unsubscribe -import jp.co.soramitsu.fearless_utils.wsrpc.state.SocketStateMachine.State -import jp.co.soramitsu.fearless_utils.wsrpc.subscription.response.SubscriptionChange +package io.novasama.substrate_sdk_android.wsrpc.state + +import io.novasama.substrate_sdk_android.common.assertInstance +import io.novasama.substrate_sdk_android.wsrpc.SocketService.* +import io.novasama.substrate_sdk_android.wsrpc.request.DeliveryType +import io.novasama.substrate_sdk_android.wsrpc.request.runtime.createFakeChange +import io.novasama.substrate_sdk_android.wsrpc.response.RpcResponse +import io.novasama.substrate_sdk_android.wsrpc.socket.RpcSocket +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.Event +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.Sendable +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect.Connect +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect.Disconnect +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect.RespondSendablesError +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect.RespondToSubscription +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect.ResponseToSendable +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect.ScheduleReconnect +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect.SendSendables +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.SideEffect.Unsubscribe +import io.novasama.substrate_sdk_android.wsrpc.state.SocketStateMachine.State +import io.novasama.substrate_sdk_android.wsrpc.subscription.response.SubscriptionChange import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test diff --git a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/subscription/response/SubscriptionChangeTest.kt b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/subscription/response/SubscriptionChangeTest.kt similarity index 94% rename from fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/subscription/response/SubscriptionChangeTest.kt rename to substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/subscription/response/SubscriptionChangeTest.kt index 1d5a5212..4f888ac9 100644 --- a/fearless-utils/src/test/java/jp/co/soramitsu/fearless_utils/wsrpc/subscription/response/SubscriptionChangeTest.kt +++ b/substrate-sdk-android/src/test/java/io/novasama/substrate_sdk_android/wsrpc/subscription/response/SubscriptionChangeTest.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.wsrpc.subscription.response +package io.novasama.substrate_sdk_android.wsrpc.subscription.response import com.google.gson.Gson import org.junit.Assert.assertEquals diff --git a/fearless-utils/src/test/resources/crypto/BIP32HDKD.json b/substrate-sdk-android/src/test/resources/crypto/BIP32HDKD.json similarity index 100% rename from fearless-utils/src/test/resources/crypto/BIP32HDKD.json rename to substrate-sdk-android/src/test/resources/crypto/BIP32HDKD.json diff --git a/fearless-utils/src/test/resources/crypto/BIP32HDKDEtalon.json b/substrate-sdk-android/src/test/resources/crypto/BIP32HDKDEtalon.json similarity index 100% rename from fearless-utils/src/test/resources/crypto/BIP32HDKDEtalon.json rename to substrate-sdk-android/src/test/resources/crypto/BIP32HDKDEtalon.json diff --git a/fearless-utils/src/test/resources/crypto/ecdsaHDKD.json b/substrate-sdk-android/src/test/resources/crypto/ecdsaHDKD.json similarity index 100% rename from fearless-utils/src/test/resources/crypto/ecdsaHDKD.json rename to substrate-sdk-android/src/test/resources/crypto/ecdsaHDKD.json diff --git a/fearless-utils/src/test/resources/crypto/ed25519HDKD.json b/substrate-sdk-android/src/test/resources/crypto/ed25519HDKD.json similarity index 100% rename from fearless-utils/src/test/resources/crypto/ed25519HDKD.json rename to substrate-sdk-android/src/test/resources/crypto/ed25519HDKD.json diff --git a/fearless-utils/src/test/resources/default.json b/substrate-sdk-android/src/test/resources/default.json similarity index 100% rename from fearless-utils/src/test/resources/default.json rename to substrate-sdk-android/src/test/resources/default.json diff --git a/fearless-utils/src/test/resources/gov2_testnet_runtime_v14 b/substrate-sdk-android/src/test/resources/gov2_testnet_runtime_v14 similarity index 100% rename from fearless-utils/src/test/resources/gov2_testnet_runtime_v14 rename to substrate-sdk-android/src/test/resources/gov2_testnet_runtime_v14 diff --git a/fearless-utils/src/test/resources/kusama.json b/substrate-sdk-android/src/test/resources/kusama.json similarity index 100% rename from fearless-utils/src/test/resources/kusama.json rename to substrate-sdk-android/src/test/resources/kusama.json diff --git a/fearless-utils/src/test/resources/kusama_metadata b/substrate-sdk-android/src/test/resources/kusama_metadata similarity index 100% rename from fearless-utils/src/test/resources/kusama_metadata rename to substrate-sdk-android/src/test/resources/kusama_metadata diff --git a/fearless-utils/src/test/resources/kusama_metadata_v14 b/substrate-sdk-android/src/test/resources/kusama_metadata_v14 similarity index 100% rename from fearless-utils/src/test/resources/kusama_metadata_v14 rename to substrate-sdk-android/src/test/resources/kusama_metadata_v14 diff --git a/fearless-utils/src/test/resources/polkadot.json b/substrate-sdk-android/src/test/resources/polkadot.json similarity index 100% rename from fearless-utils/src/test/resources/polkadot.json rename to substrate-sdk-android/src/test/resources/polkadot.json diff --git a/fearless-utils/src/test/resources/polkadot_metadata_v14 b/substrate-sdk-android/src/test/resources/polkadot_metadata_v14 similarity index 100% rename from fearless-utils/src/test/resources/polkadot_metadata_v14 rename to substrate-sdk-android/src/test/resources/polkadot_metadata_v14 diff --git a/fearless-utils/src/test/resources/sora2.json b/substrate-sdk-android/src/test/resources/sora2.json similarity index 100% rename from fearless-utils/src/test/resources/sora2.json rename to substrate-sdk-android/src/test/resources/sora2.json diff --git a/fearless-utils/src/test/resources/sora2_metadata b/substrate-sdk-android/src/test/resources/sora2_metadata similarity index 100% rename from fearless-utils/src/test/resources/sora2_metadata rename to substrate-sdk-android/src/test/resources/sora2_metadata diff --git a/fearless-utils/src/test/resources/ss58/ss58_tests.json b/substrate-sdk-android/src/test/resources/ss58/ss58_tests.json similarity index 100% rename from fearless-utils/src/test/resources/ss58/ss58_tests.json rename to substrate-sdk-android/src/test/resources/ss58/ss58_tests.json diff --git a/fearless-utils/src/test/resources/statemine.json b/substrate-sdk-android/src/test/resources/statemine.json similarity index 100% rename from fearless-utils/src/test/resources/statemine.json rename to substrate-sdk-android/src/test/resources/statemine.json diff --git a/fearless-utils/src/test/resources/statemine_metadata b/substrate-sdk-android/src/test/resources/statemine_metadata similarity index 100% rename from fearless-utils/src/test/resources/statemine_metadata rename to substrate-sdk-android/src/test/resources/statemine_metadata diff --git a/fearless-utils/src/test/resources/westend.json b/substrate-sdk-android/src/test/resources/westend.json similarity index 100% rename from fearless-utils/src/test/resources/westend.json rename to substrate-sdk-android/src/test/resources/westend.json diff --git a/fearless-utils/src/test/resources/westend_metadata b/substrate-sdk-android/src/test/resources/westend_metadata similarity index 100% rename from fearless-utils/src/test/resources/westend_metadata rename to substrate-sdk-android/src/test/resources/westend_metadata diff --git a/fearless-utils/src/test/resources/westend_metadata_v14 b/substrate-sdk-android/src/test/resources/westend_metadata_v14 similarity index 100% rename from fearless-utils/src/test/resources/westend_metadata_v14 rename to substrate-sdk-android/src/test/resources/westend_metadata_v14 diff --git a/fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/Resources.kt b/substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/Resources.kt similarity index 90% rename from fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/Resources.kt rename to substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/Resources.kt index e5f410b7..d620fe77 100644 --- a/fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/Resources.kt +++ b/substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/Resources.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils +package io.novasama.substrate_sdk_android import java.io.BufferedReader import java.io.InputStreamReader diff --git a/fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/TestData.kt b/substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/TestData.kt similarity index 92% rename from fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/TestData.kt rename to substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/TestData.kt index f6bb3467..451ba1b4 100644 --- a/fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/TestData.kt +++ b/substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/TestData.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils +package io.novasama.substrate_sdk_android import org.bouncycastle.util.encoders.Hex diff --git a/fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/encrypt/SubstrateKeypairDerivationTest.kt b/substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/encrypt/SubstrateKeypairDerivationTest.kt similarity index 71% rename from fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/encrypt/SubstrateKeypairDerivationTest.kt rename to substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/encrypt/SubstrateKeypairDerivationTest.kt index 76054077..9724540f 100644 --- a/fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/encrypt/SubstrateKeypairDerivationTest.kt +++ b/substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/encrypt/SubstrateKeypairDerivationTest.kt @@ -1,12 +1,12 @@ -package jp.co.soramitsu.fearless_utils.encrypt +package io.novasama.substrate_sdk_android.encrypt import com.google.gson.Gson -import jp.co.soramitsu.fearless_utils.encrypt.keypair.substrate.SubstrateKeypairFactory -import jp.co.soramitsu.fearless_utils.extensions.toHexString -import jp.co.soramitsu.fearless_utils.getResourceReader -import jp.co.soramitsu.fearless_utils.encrypt.junction.SubstrateJunctionDecoder -import jp.co.soramitsu.fearless_utils.encrypt.mnemonic.MnemonicTestCase -import jp.co.soramitsu.fearless_utils.encrypt.seed.substrate.SubstrateSeedFactory +import io.novasama.substrate_sdk_android.encrypt.keypair.substrate.SubstrateKeypairFactory +import io.novasama.substrate_sdk_android.extensions.toHexString +import io.novasama.substrate_sdk_android.getResourceReader +import io.novasama.substrate_sdk_android.encrypt.junction.SubstrateJunctionDecoder +import io.novasama.substrate_sdk_android.encrypt.mnemonic.MnemonicTestCase +import io.novasama.substrate_sdk_android.encrypt.seed.substrate.SubstrateSeedFactory import org.junit.Assert abstract class SubstrateKeypairDerivationTest { diff --git a/fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/MnemonicTestCase.kt b/substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/MnemonicTestCase.kt similarity index 76% rename from fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/MnemonicTestCase.kt rename to substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/MnemonicTestCase.kt index 096c67db..0ac48494 100644 --- a/fearless-utils/src/testShared/java/jp/co/soramitsu/fearless_utils/encrypt/mnemonic/MnemonicTestCase.kt +++ b/substrate-sdk-android/src/testShared/java/io/novasama/substrate_sdk_android/encrypt/mnemonic/MnemonicTestCase.kt @@ -1,4 +1,4 @@ -package jp.co.soramitsu.fearless_utils.encrypt.mnemonic +package io.novasama.substrate_sdk_android.encrypt.mnemonic import com.google.gson.annotations.SerializedName