-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
咨询下,示例里面有eos签名的,但是data看起来是一个16进制,确认下是否把字典转成16进制data进行sign。 #16
Comments
因为签名数据都有一个序列化的过程,而EOS数据的序列化不同于Ethereum和BTC,而是使用了比较特殊的序列化方式,并且在签名时额外附加了一下头信息。 |
{"compression": "none", |
序列化要用EOSJS这个库? |
嗯,目前因为EOS序列化比较特殊,所以目前暂时使用了这个库来加速开发。 |
This issue will be closed as it has not update for a long time. You can reopen it if you have any other problem |
///主要这里的data一开始看起来就是16进制,而不是一个字典明文,不太清楚这个16进制data如何加工得来?
//未处理的data 字典
{"compression": "none",
"transaction": {
"expiration": "
....//忽略
}
//示例
let wallet = try! WalletManager.importEOS(from: TestData.mnemonic, accountName: "", permissions: [], metadata: WalletMeta(chain: .eos, source: .mnemonic), encryptBy: TestData.password, at: BIP44.eosLedger)
let txs = [
EOSTransaction(
data: "c578065b93aec6a7c811000000000100a6823403ea3055000000572d3ccdcd01000000602a48b37400000000a8ed323225000000602a48b374208410425c95b1ca80969800000000000453595300000000046d656d6f00",
publicKeys: ["EOS88XhiiP7Cu5TmAUJqHbyuhyYgd6sei68AU266PyetDDAtjmYWF"],
chainID: TestData.eosChainID
)
]
let result = try! WalletManager.eosSignTransaction(walletID: wallet.walletID, txs: txs, password: TestData.password)
print(result[0])
XCTAssertEqual(1, result.count)
XCTAssertEqual(
result[0],
EOSSignResult(hash: "6af5b3ae9871c25e2de195168ed7423f455a68330955701e327f02276bb34088", signs: ["SIG_K1_KjZXm86HMVyUd59E15pCkrpn5uUPAAsjTxjEVRRueEvGciinxRS3sATmEEWdkb8hRNHhf6SXofsz4qzPdD6mfZ67FoqLxh"])
)
The text was updated successfully, but these errors were encountered: