Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shortcuts for Web3Serializer #46

Closed
y9san9 opened this issue Aug 31, 2021 · 1 comment
Closed

Add shortcuts for Web3Serializer #46

y9san9 opened this issue Aug 31, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@y9san9
Copy link
Member

y9san9 commented Aug 31, 2021

abstract class Web3Deserializer : DeserializationStrategy {
    override fun descriptor = /* STRING */
    override fun decode(decoder) {
        val string = decoder.decodeString()
        return decode(string.chunked(size = PART_SIZE * 2).map { it.hexStringToByteArray() })
    }
    abstract fun decode(chunks: List<ByteArray>)
}

And other help classes for SerializationStrategy and KSerializer (composition of this twos), so I won't write boilerplate with chunked and converting to hex

@y9san9 y9san9 self-assigned this Aug 31, 2021
@y9san9 y9san9 added the enhancement New feature or request label Aug 31, 2021
@y9san9
Copy link
Member Author

y9san9 commented Sep 1, 2021

This issue is not related to the library 🙂

@y9san9 y9san9 closed this as completed Sep 1, 2021
anton6tak added a commit that referenced this issue Sep 2, 2021
anton6tak added a commit that referenced this issue Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant