Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
valentunn committed Nov 19, 2024
1 parent ae76b9f commit 5c1bc09
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ class ExtrinsicBuilder(
DefaultSignedExtensions.CHECK_GENESIS to genesisHash,
DefaultSignedExtensions.CHECK_SPEC_VERSION to runtimeVersion.specVersion.toBigInteger(),
DefaultSignedExtensions.CHECK_TX_VERSION to
runtimeVersion.transactionVersion.toBigInteger(),
runtimeVersion.transactionVersion.toBigInteger(),
DefaultSignedExtensions.CHECK_METADATA_HASH to
checkMetadataHash.toSignedExtensionValue().includedInSignature
checkMetadataHash.toSignedExtensionValue().includedInSignature
)

val custom = _customSignedExtensions.mapValues { (_, extensionValues) ->
Expand Down Expand Up @@ -208,7 +208,7 @@ class ExtrinsicBuilder(
DefaultSignedExtensions.CHECK_TX_PAYMENT to tip,
DefaultSignedExtensions.CHECK_NONCE to runtime.encodeNonce(nonce.nonce),
DefaultSignedExtensions.CHECK_METADATA_HASH to
checkMetadataHash.toSignedExtensionValue().includedInExtrinsic
checkMetadataHash.toSignedExtensionValue().includedInExtrinsic
)

val custom = _customSignedExtensions.mapValues { (_, extensionValues) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import io.novasama.substrate_sdk_android.runtime.metadata.module.RuntimeApi
import io.novasama.substrate_sdk_android.runtime.metadata.module.RuntimeApiMethod
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.wsrpc.request.runtime.RuntimeRequest
import io.novasama.substrate_sdk_android.wsrpc.request.runtime.state.StateCallRequest
import java.io.ByteArrayOutputStream

Expand Down Expand Up @@ -266,7 +265,7 @@ fun RuntimeApiMethod.createRequest(
inputValues: Map<String, Any?>
): StateCallRequest {
return StateCallRequest(
runtimeRpcName = "${apiName}_${name}",
runtimeRpcName = "${apiName}_$name",
encodedArguments = encodeInputs(runtime, inputValues)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package io.novasama.substrate_sdk_android.runtime.metadata
import io.emeraldpay.polkaj.scale.ScaleCodecReader
import io.novasama.substrate_sdk_android.extensions.fromHex
import io.novasama.substrate_sdk_android.runtime.metadata.v14.PostV14MetadataSchema
import io.novasama.substrate_sdk_android.runtime.metadata.v14.PostV14PalletMetadataSchema
import io.novasama.substrate_sdk_android.runtime.metadata.v14.RuntimeMetadataSchemaV14
import io.novasama.substrate_sdk_android.runtime.metadata.v15.RuntimeMetadataSchemaV15
import io.novasama.substrate_sdk_android.scale.EncodableStruct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ object V15RuntimeBuilder : RuntimeBuilder {
apiName = parentName
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ class RuntimeApiMethod(
class RuntimeApiMethodParam(
val name: String,
val type: Type<*>?,
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import io.novasama.substrate_sdk_android.runtime.metadata.v14.PostV14PalletMetad
import io.novasama.substrate_sdk_android.runtime.metadata.v14.SignedExtensionMetadataV14
import io.novasama.substrate_sdk_android.runtime.metadata.v14.StorageMetadataV14
import io.novasama.substrate_sdk_android.scale.EncodableStruct
import io.novasama.substrate_sdk_android.scale.Field
import io.novasama.substrate_sdk_android.scale.Schema
import io.novasama.substrate_sdk_android.scale.compactInt
import io.novasama.substrate_sdk_android.scale.dataType.string
Expand Down Expand Up @@ -60,7 +59,7 @@ object RuntimeApiMetadataV15 : Schema<RuntimeApiMetadataV15>() {
val docs by vector(string)
}

object RuntimeApiMethodMetadata: Schema<RuntimeApiMethodMetadata>() {
object RuntimeApiMethodMetadata : Schema<RuntimeApiMethodMetadata>() {

val name by string()

Expand Down Expand Up @@ -102,4 +101,4 @@ val EncodableStruct<RuntimeApiMethodParamMetadata>.name: String
get() = get(RuntimeApiMethodParamMetadata.name)

val EncodableStruct<RuntimeApiMethodParamMetadata>.type: BigInteger
get() = get(RuntimeApiMethodParamMetadata.type)
get() = get(RuntimeApiMethodParamMetadata.type)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.novasama.substrate_sdk_android.scale

import io.novasama.substrate_sdk_android.scale.dataType.DataType
import io.novasama.substrate_sdk_android.scale.dataType.optional
import io.novasama.substrate_sdk_android.scale.dataType.string

class Field<T>(val dataType: DataType<T>, val defaultValue: T? = null)

Expand Down Expand Up @@ -42,4 +41,4 @@ class EncodableStruct<out S : Schema<out S>>(val schema: S) {

fun <S : Schema<S>> EncodableStruct<S>.toHexString() = schema.toHexString(this)

fun <S : Schema<S>> EncodableStruct<S>.toByteArray() = schema.toByteArray(this)
fun <S : Schema<S>> EncodableStruct<S>.toByteArray() = schema.toByteArray(this)
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,4 @@ class keyedUnion(val dataTypes: Map<Int, DataType<*>>) : DataType<Pair<Int, Any?
writer.write(uint8, typeIndex.toUByte())
writer.write(type, originalValue)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ class StateCallRequest(
) : RuntimeRequest(
"state_call",
listOf(runtimeRpcName, encodedArguments)
)
)

0 comments on commit 5c1bc09

Please sign in to comment.