test: eip1581

This commit is contained in:
Richard Ramos 2020-11-20 09:12:58 -04:00
parent 60f697a03a
commit 02b80a7db8
No known key found for this signature in database
GPG Key ID: 80D4B01265FDFE8F
1 changed files with 9 additions and 0 deletions

View File

@ -1,7 +1,16 @@
import ../../nim_status/lib/account
import stew/[results]
import secp256k1
import eth/keys
import byteutils
let seed = getSeed(Mnemonic "panda eyebrow bullet gorilla call smoke muffin taste mesh discover soft ostrich alcohol speed nation flash devote level hobby quick inner drive ghost inside")
# This derivation path will generate a private key corresponding to wallet i=0
assert $(derive(seed, KeyPath "m/44'/60'/0'/0/0").get()) == "ff1e68eb7bf2f48651c47ef0177eb815857322257c5894bb4cfd1176c9989314"
# This derivation path will generate a status public key
let pk = derive(seed, KeyPath "m/43'/60'/1581'/0'/0").get()
assert($pk == "38ac4da490b5c48a06d0a2fe7900c56b6639b88f6f71303590f28047411981c2")
assert($pk.toPublicKey() == "04ac5a45f2a90052cee10b22b74832f2deb814d58e35aa3f01a249160615a238aef3a34ba86e1817fc8c5a6e93e3c5f159f6c46e922c85d47bafc4b78e07718279")