weixin_39627201
weixin_39627201
2020-11-22 11:37

咨询下,示例里面有eos签名的,但是data看起来是一个16进制,确认下是否把字典转成16进制data进行sign。

///主要这里的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"]) )

该提问来源于开源项目:consenlabs/token-core-ios

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

5条回答