File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
main/scala/io/iohk/ethereum/cli
test/scala/io/iohk/ethereum/cli Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import cats.implicits._
44import com .monovore .decline .{Command , Opts }
55import io .iohk .ethereum .crypto
66import io .iohk .ethereum .crypto ._
7+ import io .iohk .ethereum .domain .Address
78import io .iohk .ethereum .utils .ByteStringUtils
89import java .security .SecureRandom
910import org .bouncycastle .util .encoders .Hex
@@ -62,8 +63,9 @@ object CliCommands {
6263
6364 private def privKeyToAddress (privKey : Array [Byte ]): String = {
6465 val pubKey = pubKeyFromPrvKey(privKey)
65- val address = crypto.kec256(pubKey)
66- Hex .toHexString(address)
66+ val address = Address (crypto.kec256(pubKey))
67+
68+ address.toUnprefixedString
6769 }
6870
6971 val api : Command [String ] = Command .apply(name = " cli" , header = " Mantis CLI" ) {
Original file line number Diff line number Diff line change @@ -90,9 +90,9 @@ object Fixture {
9090 val privateKey2 = " 00b11c32957057651d56cd83085ef3b259319057e0e887bd0fdaee657e6f75d1"
9191 val privateKey3 = " 00b11c32957057651d56cd83085ef3b259319057e0e887bd0fdaee657e6f75d2"
9292
93- val address = " 8b196738d90cf3d9fc299e0ec28e15ebdcbb0bdcb281d9d5084182c9c66d5d12 "
94- val address2 = " add8c627e14480b36b30811758240d8acb282aae883043990d8a2d7e2e75cf3b "
95- val address3 = " 1e9cd60cf3b2c902e60f809e604542f9a9fb55d3e8004ff122f662f88eb32b4a "
93+ val address = " c28e15ebdcbb0bdcb281d9d5084182c9c66d5d12 "
94+ val address2 = " 58240d8acb282aae883043990d8a2d7e2e75cf3b "
95+ val address3 = " 604542f9a9fb55d3e8004ff122f662f88eb32b4a "
9696
9797 val requestedBalance = 42
9898
You can’t perform that action at this time.
0 commit comments