the-nft-company / flow-jvm-sdk

Apache License 2.0
13 stars 25 forks source link

Fix android signature incorrect issue #12

Closed lmcmz closed 2 years ago

lmcmz commented 2 years ago

Closes: #5, #8, #11

Description

Hi,

I'm the maintainer of flow-swift SDK. While I using this library in android, it always got some signature error. When I dig deeper into the issue, I found the issue might relate to the incorrect order of RLP encoding. Once I added the RLP annotation in order, it works fine.

Here is a quick example:

// Flow Swift ✅
[
  [
    "0x7472616e73616374696f6e207b0a202065786563757465207b0a202020206c6f67282241207472616e73616374696f6e2068617070656e656422290a20207d0a7d",
    [],
    "0x2e1c36286ee035ad70a605635a4ebb98a342fc0c95bb03fea031a10ff542c7c1",
    "0x03e8",
    "0x4f05d22690e07938",
    "0x01",
    "0x09",
    "0x4f05d22690e07938",
    []
  ],
  []
]

// Flow JVM ❌
[
    [
      [],
      [],
      "0x03e8",
      "0x4f05d22690e07938",
      "0x4f05d22690e07938",
      "0x01",
      "0x09",
      "0x2e1c36286ee035ad70a605635a4ebb98a342fc0c95bb03fea031a10ff542c7c1",
      "0x7472616e73616374696f6e207b0a202065786563757465207b0a20202020206c6f67282241207472616e73616374696f6e2068617070656e656422290a20207d0a7d"
    ],
    []
  ]

For contributor use:

github-actions[bot] commented 2 years ago

Unit Test Results

  8 files  ±0    8 suites  ±0   28s :stopwatch: ±0s 33 tests ±0  33 :heavy_check_mark: ±0  0 :zzz: ±0  0 :x: ±0 

Results for commit 4b2896ca. ± Comparison against base commit 4b2896ca.