Related to https://github.com/status-im/status-desktop/issues/3725.
Introduce `type PendingTransaction` in `status/types/transaction.nim`. Refactor
`proc buyPack` in `status/stickers.nim` to return an instance of that type
instead of `string`. Eliminate unnecessary threading of `var success` argument
through successive calls in favor of tracking `success` in a field on
`PendingTransaction`.
---
NOTES
Several files in this project have "sticker" in their names or make reference
to "sticker". All those were reviewed as candidates for changes
logically-related to the purpose of this PR:
`status/accounts.nim`
`status/chat.nim`
`status/chat/stickers.nim`
`status/eth/contracts.nim`
`status/eth/stickers.nim`
`status/status.nim`
`status/statusgo_backend/chat.nim`
`status/statusgo_backend/edn_helpers.nim`
`status/stickers.nim`
`status/types/message.nim`
`status/types/pending_transaction_type.nim`
`status/types/setting.nim`
`status/types/sticker.nim`
`status/utils.nim`
`status/wallet/collectibles.nim`
`sendStickerMessage` in `status/statusgo_backend/chat.nim` returns `string` but
refactoring it seems out of scope for this set of changes.
A comment has been left in `status/stickers.nim` re: an additional refactor
that can be made to simplify `trackPendingTransaction` as called by
`buyPack`. The refactor will involve changes in other modules as well.
`type Message` in `status/types/message.nim` has a `sticker*: string` field
that doesn't seem to be made use of by the Nim side of status-desktop, but it
it is made use of by desktop's QML side (see:
`status-desktop/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml`). In the
future it may be preferable to use a different type, or a type alias for
`string`.
`decodeContentHash` in `status/utils.nim` could return an instance of `type
Cid` without converting it to a string, leaving it up to call sites in
status-lib and status-desktop to convert to `string`.
`getStickers` in `status/wallet/collectibles.nim` returns `string`, used by
`{.slot.}` procs in status-desktop (see Nim sources in
`status-desktop/src/app`) that expose the JSON data (as `string`) to
QML. Refactoring the return value seems out of scope for this PR, given ongoing
refactors in status-desktop's front-end architecture.
* refactor: Group profile function and eth function together
* refactor: group eth backend
* refactor: Move various eth call to eth backend
* refactor: move accounts call to account backend
* refactor: permission
Closes#65.
There's still some work to be done. With the changes in this PR, this project's
Makefile is a bit of a hybrid between the approaches in the Makefiles of
status-desktop and nim-status. In the future, as this project's tests expand in
scope, the logic in the Makefile, `nim_status_lib.nimble`, and/or
`.github/workflows/test.yml` may need to be revised.
abstract backend; add mock backend and testing
move bookmarks to backend wrapper
move bookmarks to backend wrapper
move bookmarks to backend wrapper
working version
cleanup
add mock backend
add nimble task & test folder
add evn.sh
make test run; implement bookmark method in the mock
add nim unit test
removing duplicated statement that was causing tests to run twice
re-enable other initilizations in the status object; support specifying backend in the constructor
update bookmark test
update bookmark test
update nimble and makefile
update nimble and makefile
update bookmarks test
remove old browser file
fixes#3659
Wallet2 needs its own event otherwise they wallet1/2 mixes
and as not everything is implemented in wallet2, it crashes
In this particular case, the account is added into wallet1 but trigger
an event intercepted by wallet2, wallet2 doesn't have the new account
and crash
This check is here, because of issue#3490, that was happening due to different
messages' order (received from status go). We were emitting always a message on
index 0, what in some cases was not the reply message (doesn't contain "responseTo"
value). This should be handled in status-go but since that part is used by mobile
also and it is working for them, change is applied here.
Fixes: #3490
* refactor: move eth logic out of libstatus wrapper
* move signing phrases out of status go wrapper (libstatus)
* move logic related methods out of libstatus
move logic related methods out of libstatus
move logic related methods out of libstatus
fix sorting