Skip to content

Commit

Permalink
add kotlin plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Chen authored and Richard Chen committed Oct 16, 2018
1 parent 14bedd5 commit 38b5525
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
out
.gradle
/build
DS_Store
.DS_Store
*.iml
18 changes: 7 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
buildscript {
ext.kotlin_version = '1.2.60'
ext.springBootVersion = '1.5.6.RELEASE'
repositories {
mavenCentral()
}
Expand All @@ -18,14 +17,19 @@ plugins {
// Apply the java-library plugin to add support for Java Library
apply plugin: 'java-library'
apply plugin: "com.stehno.natives"

apply plugin: "kotlin"

// In this section you declare where to find the dependencies of your project
repositories {
jcenter()
mavenCentral()
}

jar {
baseName = 'wicc-wallet-utils'
version = '1.0.1'
}

dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
Expand Down Expand Up @@ -60,12 +64,4 @@ dependencies {

// 'test.useTestNG()' to your build script.
testCompile 'junit:junit:4.12'
}




jar {
baseName = 'wicc-wallet-utils'
version = "$version"
}
}
14 changes: 14 additions & 0 deletions src/test/kotlin/com/waykichain/wallet/TestWallet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ import org.bitcoinj.core.*
import org.junit.Test
import java.io.ByteArrayOutputStream
import org.slf4j.LoggerFactory
import com.google.common.base.Joiner
import org.bitcoinj.params.MainNetParams
import org.bitcoinj.wallet.DeterministicSeed
import org.bitcoinj.wallet.Wallet


/**
* @Author: Richard Chen
Expand Down Expand Up @@ -145,6 +150,15 @@ class TestWallet {
System.out.println(tx)
}

@Test
fun testHDWallet() {
val params = MainNetParams.get()
val wallet = Wallet(params)
val seedHex = wallet.keyChainSeed.toHexString()
val root = HDNode.fromSeedHex(seedHex)
println("Seed words are: " + Joiner.on(" ").join(seed.mnemonicCode!!))
println("Seed birthday is: " + seed.creationTimeSeconds)
}

@Test
fun testSnippet() {
Expand Down

0 comments on commit 38b5525

Please sign in to comment.