Skip to content

Commit

Permalink
Merge branch 'develop' into ETCM-127-it-regularsync
Browse files Browse the repository at this point in the history
  • Loading branch information
lemastero committed Oct 22, 2020
2 parents c63ef60 + 69932a3 commit 9dfb637
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/main/scala/io/iohk/ethereum/cli/CliCommands.scala
Expand Up @@ -4,6 +4,7 @@ import cats.implicits._
import com.monovore.decline.{Command, Opts}
import io.iohk.ethereum.crypto
import io.iohk.ethereum.crypto._
import io.iohk.ethereum.domain.Address
import io.iohk.ethereum.utils.ByteStringUtils
import java.security.SecureRandom
import org.bouncycastle.util.encoders.Hex
Expand Down Expand Up @@ -62,8 +63,9 @@ object CliCommands {

private def privKeyToAddress(privKey: Array[Byte]): String = {
val pubKey = pubKeyFromPrvKey(privKey)
val address = crypto.kec256(pubKey)
Hex.toHexString(address)
val address = Address(crypto.kec256(pubKey))

address.toUnprefixedString
}

val api: Command[String] = Command.apply(name = "cli", header = "Mantis CLI") {
Expand Down
6 changes: 3 additions & 3 deletions src/test/scala/io/iohk/ethereum/cli/CliCommandsSpec.scala
Expand Up @@ -90,9 +90,9 @@ object Fixture {
val privateKey2 = "00b11c32957057651d56cd83085ef3b259319057e0e887bd0fdaee657e6f75d1"
val privateKey3 = "00b11c32957057651d56cd83085ef3b259319057e0e887bd0fdaee657e6f75d2"

val address = "8b196738d90cf3d9fc299e0ec28e15ebdcbb0bdcb281d9d5084182c9c66d5d12"
val address2 = "add8c627e14480b36b30811758240d8acb282aae883043990d8a2d7e2e75cf3b"
val address3 = "1e9cd60cf3b2c902e60f809e604542f9a9fb55d3e8004ff122f662f88eb32b4a"
val address = "c28e15ebdcbb0bdcb281d9d5084182c9c66d5d12"
val address2 = "58240d8acb282aae883043990d8a2d7e2e75cf3b"
val address3 = "604542f9a9fb55d3e8004ff122f662f88eb32b4a"

val requestedBalance = 42

Expand Down

0 comments on commit 9dfb637

Please sign in to comment.