You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
` let json = """
{"version":3,"id":"8ea94370-4ce1-4fe4-b0ba-5bdeedb6d437","address":"950e813d1a6f5b256bd0679d90115522786cf1b1","crypto":{"ciphertext":"fefcd42e80087ba4c009100fcee3204b6ba039a430b8f7ba32417487d71245b3","cipherparams":{"iv":"132b360258db5b4b473302f863803438"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"4d731b14cc425cb6fae6274d19b8220df3fa995a271d2886644e0b7686b1e70d","n":131072,"r":8,"p":1},"mac":"8227957b5e800a692548bf32af8732c3cec6c18e20f7f7b930a9b8b14315ba32"}}
"""
let keystore = EthereumKeystoreV3(json)!
let data = try keystore.serialize()!
let key = try keystore.UNSAFE_getPrivateKeyData(password: "A1B2A1B2C4DDDE", account: keystore.addresses[0]).hex
let keystore2 = EthereumKeystoreV3(data)!
let data2 = try keystore2.serialize()!
let key2 = try keystore2.UNSAFE_getPrivateKeyData(password: "A1B2A1B2C4DDDE", account: keystore.addresses[0]).hex
`
I am trying to run below test but is failing and saying invalidAccountError
`func testImportAndExport() throws {
let json = """
{"version":3,"id":"8b60fda9-5f27-4478-9cc9-72059571aa6e","crypto":{"ciphertext":"d34e78640359a599970a58b3b4b7c987945e56c69411028ea62394e8d1ea7e4b","cipherparams":{"iv":"6e4a429a30807ab9202a9aefad152398"},"kdf":"scrypt","kdfparams":{"r":6,"p":1,"n":4096,"dklen":32,"salt":"0000000000000000000000000000000000000000000000000000000000000000"},"mac":"79888d6ce3a2a24d6b70d07ca9067b57e4a57bd9416a3abb336900cacf82e29a","cipher":"aes-128-cbc"},"address":"0b0f7a95485060973726d03e7c326a6542bcb55b"}
"""
let keystore = EthereumKeystoreV3(json)!
let data = try keystore.serialize()!
let key = try keystore.UNSAFE_getPrivateKeyData(password: "hello world", account: keystore.addresses[0]).hex
}`
is there anyone who can help me what I am doing wrong.
Regards,
Ashish
The text was updated successfully, but these errors were encountered: