status-im / status-go

The Status module that consumes go-ethereum
https://status.im
Mozilla Public License 2.0
727 stars 247 forks source link

fix(wallet)_: properly use amount in erc1155 transfers #6015

Closed dlipicar closed 3 weeks ago

dlipicar commented 3 weeks ago

Fixes https://github.com/status-im/status-desktop/issues/16664

https://github.com/user-attachments/assets/e129b31a-4ce2-43d2-a190-9c29653bb730

status-im-auto commented 3 weeks ago

Jenkins Builds

:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: af7fe9f3 #1 2024-10-30 22:57:25 ~4 min linux :package:zip
:heavy_check_mark: af7fe9f3 #1 2024-10-30 22:58:05 ~5 min android :package:aar
:heavy_check_mark: af7fe9f3 #1 2024-10-30 22:59:02 ~6 min tests-rpc :page_facing_up:log
:heavy_check_mark: af7fe9f3 #1 2024-10-30 22:59:06 ~6 min ios :package:zip
:heavy_check_mark: af7fe9f3 #1 2024-10-30 23:26:44 ~33 min tests :page_facing_up:log
:heavy_check_mark: 432cc363 #2 2024-10-31 11:56:10 ~2 min android :package:aar
:heavy_check_mark: 432cc363 #2 2024-10-31 11:56:29 ~2 min linux :package:zip
:heavy_check_mark: 432cc363 #2 2024-10-31 11:59:06 ~5 min ios :package:zip
:heavy_check_mark: 432cc363 #2 2024-10-31 11:59:18 ~5 min tests-rpc :page_facing_up:log
:heavy_check_mark: 432cc363 #2 2024-10-31 12:26:45 ~32 min tests :page_facing_up:log
codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 35.71429% with 9 lines in your changes missing coverage. Please review.

Please upload report for BASE (release/3.4.x@635f19e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...vices/wallet/transfer/transaction_manager_route.go 0.00% 3 Missing :warning:
...let/router/pathprocessor/processor_bridge_celar.go 0.00% 2 Missing :warning:
...allet/router/pathprocessor/processor_bridge_hop.go 0.00% 2 Missing :warning:
...s/wallet/router/pathprocessor/processor_erc1155.go 0.00% 1 Missing :warning:
...es/wallet/router/pathprocessor/processor_erc721.go 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/3.4.x #6015 +/- ## ================================================ Coverage ? 47.65% ================================================ Files ? 843 Lines ? 138184 Branches ? 0 ================================================ Hits ? 65849 Misses ? 64559 Partials ? 7776 ``` | [Flag](https://app.codecov.io/gh/status-im/status-go/pull/6015/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | Coverage Δ | | |---|---|---| | [functional](https://app.codecov.io/gh/status-im/status-go/pull/6015/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | `10.61% <35.71%> (?)` | | | [unit](https://app.codecov.io/gh/status-im/status-go/pull/6015/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | `46.97% <35.71%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/status-im/status-go/pull/6015?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | Coverage Δ | | |---|---|---| | [node/status\_node\_services.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=node%2Fstatus_node_services.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bm9kZS9zdGF0dXNfbm9kZV9zZXJ2aWNlcy5nbw==) | `71.19% <ø> (ø)` | | | [services/wallet/api.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=services%2Fwallet%2Fapi.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-c2VydmljZXMvd2FsbGV0L2FwaS5nbw==) | `37.19% <100.00%> (ø)` | | | [...let/router/pathprocessor/processor\_stickers\_buy.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=services%2Fwallet%2Frouter%2Fpathprocessor%2Fprocessor_stickers_buy.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-c2VydmljZXMvd2FsbGV0L3JvdXRlci9wYXRocHJvY2Vzc29yL3Byb2Nlc3Nvcl9zdGlja2Vyc19idXkuZ28=) | `11.42% <100.00%> (ø)` | | | [services/wallet/router/router.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=services%2Fwallet%2Frouter%2Frouter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-c2VydmljZXMvd2FsbGV0L3JvdXRlci9yb3V0ZXIuZ28=) | `80.26% <100.00%> (ø)` | | | [services/wallet/service.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=services%2Fwallet%2Fservice.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-c2VydmljZXMvd2FsbGV0L3NlcnZpY2UuZ28=) | `96.55% <ø> (ø)` | | | [...s/wallet/router/pathprocessor/processor\_erc1155.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=services%2Fwallet%2Frouter%2Fpathprocessor%2Fprocessor_erc1155.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-c2VydmljZXMvd2FsbGV0L3JvdXRlci9wYXRocHJvY2Vzc29yL3Byb2Nlc3Nvcl9lcmMxMTU1Lmdv) | `4.34% <0.00%> (ø)` | | | [...es/wallet/router/pathprocessor/processor\_erc721.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=services%2Fwallet%2Frouter%2Fpathprocessor%2Fprocessor_erc721.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-c2VydmljZXMvd2FsbGV0L3JvdXRlci9wYXRocHJvY2Vzc29yL3Byb2Nlc3Nvcl9lcmM3MjEuZ28=) | `3.20% <0.00%> (ø)` | | | [...let/router/pathprocessor/processor\_bridge\_celar.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=services%2Fwallet%2Frouter%2Fpathprocessor%2Fprocessor_bridge_celar.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-c2VydmljZXMvd2FsbGV0L3JvdXRlci9wYXRocHJvY2Vzc29yL3Byb2Nlc3Nvcl9icmlkZ2VfY2VsYXIuZ28=) | `0.00% <0.00%> (ø)` | | | [...allet/router/pathprocessor/processor\_bridge\_hop.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=services%2Fwallet%2Frouter%2Fpathprocessor%2Fprocessor_bridge_hop.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-c2VydmljZXMvd2FsbGV0L3JvdXRlci9wYXRocHJvY2Vzc29yL3Byb2Nlc3Nvcl9icmlkZ2VfaG9wLmdv) | `11.71% <0.00%> (ø)` | | | [...vices/wallet/transfer/transaction\_manager\_route.go](https://app.codecov.io/gh/status-im/status-go/pull/6015?src=pr&el=tree&filepath=services%2Fwallet%2Ftransfer%2Ftransaction_manager_route.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-c2VydmljZXMvd2FsbGV0L3RyYW5zZmVyL3RyYW5zYWN0aW9uX21hbmFnZXJfcm91dGUuZ28=) | `42.78% <0.00%> (ø)` | |
friofry commented 3 weeks ago

Hi @pavloburykh

This fix changes the behaviour of BuildTransactionV2 which is only used in (buildTxForPath ->BuildTransactionsFromRoute -> BuildTransactionsFromRoute)

I've checked that desktop does indeed use the wallet_buildTransactionsFromRoute API call. But mobile doesn't use this endpoint (only wallet_buildTransaction or wallet_buildRawTransaction)

So mobile is not affected by this PR (nor by https://github.com/status-im/status-go/pull/6018).

pavloburykh commented 3 weeks ago

So mobile is not affected by this PR

@friofry thanks a lot for reviewing.

saledjenic commented 3 weeks ago

@dlipicar before merging this PR, could you merge first this one https://github.com/status-im/status-go/pull/6020 there are 2 changes: