Skip to content

Instantly share code, notes, and snippets.

View meta address
0x58EDA274693875321cB61bDEF7805bC0e1E6e59d
@mirceanis
mirceanis / mnemonicProviderTest.kt
Created Jan 29, 2018
demo code for issue #20 on kethereum
View mnemonicProviderTest.kt
package com.example
import org.junit.Test
import org.kethereum.bip39.Mnemonic
//run as an android instrumented test
@Test
fun testJwtComponents() {
//causes crash because the provider is not initialized yet
@mirceanis
mirceanis / SuspendExtensionTest.kt
Created Aug 6, 2018
Mocking suspend functions that wrap callbacks - works as long as they're not extensions
View SuspendExtensionTest.kt
import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.doReturn
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.whenever
import kotlinx.coroutines.experimental.runBlocking
import org.junit.Assert
import org.junit.Test
import kotlin.coroutines.experimental.suspendCoroutine
/**
@mirceanis
mirceanis / detachFd.kt
Created Nov 15, 2018
pass file across JNI boundary
View detachFd.kt
val target = File(context.getFilesDir(), "my-file")
val fd = ParcelFileDescriptor.open(target, ParcelFileDescriptor.MODE_READ_WRITE).detachFd()
//fd is an int that's ok to be passed to native code
@mirceanis
mirceanis / ArbitrarySerializationTests.kt
Last active Jul 23, 2019
(de)serialization for arbitrary trees using kotlinx.serialization
View ArbitrarySerializationTests.kt
@file:Suppress("MemberVisibilityCanBePrivate", "EXPERIMENTAL_API_USAGE")
import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.*
import kotlinx.serialization.modules.getContextualOrDefault
import org.junit.Test
class ArbitrarySerializationTests {
View keybase.md

Keybase proof

I hereby claim:

  • I am mirceanis on github.
  • I am mirceanis (https://keybase.io/mirceanis) on keybase.
  • I have a public key ASBwHPMnGgDLxUH5CMq_j1RN-7rfMrhTQVRfxqoBHgWO1wo

To claim this, I am signing this object:

@mirceanis
mirceanis / more-snapps-per-address.ts
Last active Jan 21, 2022
[BUG] snarkyjs 0.2.0 allows multiple snapps to be deployed to the same address with shared state
View more-snapps-per-address.ts
import {
Field,
isReady,
method,
Mina,
Party,
PrivateKey,
PublicKey,
shutdown,
SmartContract,