-
Notifications
You must be signed in to change notification settings - Fork 149
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
Wownero integration #2 #1260
base: main
Are you sure you want to change the base?
Wownero integration #2 #1260
Conversation
55bd72d
to
f1bbf03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just spotted a couple places that were 12 instead of 11
trocador supports wownero iirc. So i think it can stay (would need to add wownero to the list of swappable coins) |
@OmarHatem28 please look into
|
Hi @nahuhh thanks for helping in reviewing this PR I am currently in the review process but I might submit my current comments so far until I complete the review. I will review the Polyseed PR afterwards but @sanderfoobar can't we make both seed types (normal, polyseed) supported? Also, like @nahuhh suggested, can you please remove the Accounts feature and all its related files, and update the PR with the latest main to resolve the conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for android/app/src/main/java/com/cakewallet/wownero/
since there won't be a separate app for wownero and it would be included in Cake Wallet
@@ -86,6 +86,8 @@ class PreSeedPage extends BasePage { | |||
if (moneroSeedType == SeedType.polyseed) | |||
return 16; | |||
return 25; | |||
case WalletType.wownero: | |||
return 16; // always polyseed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is it always polyseed, when it's waiting for a PR on polyseed library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently using monero's polyseed (so likely creates invalid seeds)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I know, wownero doesn't use accounts, so there should be no need for this or any account related changes/addition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cw_wownero
is a copy of cw_monero
which is then modified to support Wownero. As such, there are things in there that do not necessarily reflect reality, such as supporting accounts (that are not exposed to the user) or references to 'seed type' (while there is only polyseed). This is done in favor of not changing Dart class/function signatures, as doing that involves actual Dart development. This PR was largely done in my free-time, and I don't have ambitions to become a Dart developer ;)). My assumption was that Cake would take the PR, take a few days to clean it up, and finish it. This was not the case.
For now ill skip this, because I don't want to possibly get stuck in (what would be trivial for others) Dart stuff when I'm on a schedule (limited time available). Can pick this up later when I have a better understanding of what needs to done in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, not needed
import 'package:cake_wallet/haven/haven.dart'; | ||
import 'package:cw_monero/api/wallet.dart' as monero_wallet; | ||
import 'package:cw_wownero/api/wallet.dart' as wownero_wallet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will throw an exception when building Monero.com
app as it will not include this package, please use the wownero
instance instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure where this instance is that I should be using instead.
Thanks guys. So currently I have a client that has been requiring my time, and I should be finished in a few days, at which point Ill look at this PR again. |
Hi @sanderfoobar We're excited about the changes you've proposed and adding Wownero, and we would love to see this PR integrated into Cake. |
Thanks, I'm continuing my efforts starting from tomorrow or so. Finishing up some other work. |
ddac9eb
to
69716bd
Compare
And then rebased to latest |
@OmarHatem28 to proceed and properly test, from cake side, we need cake-tech/polyseed_dart#1 |
@nahuhh merged |
69716bd
to
5fbbb77
Compare
int32_t account_size() | ||
{ | ||
std::vector<Monero::SubaddressAccountRow *> _accocunts = m_account->getAll(); | ||
return _accocunts.size(); | ||
} | ||
|
||
int64_t *account_get_all() | ||
{ | ||
std::vector<Monero::SubaddressAccountRow *> _accocunts = m_account->getAll(); | ||
size_t size = _accocunts.size(); | ||
int64_t *accocunts = (int64_t *)malloc(size * sizeof(int64_t)); | ||
|
||
for (int i = 0; i < size; i++) | ||
{ | ||
Monero::SubaddressAccountRow *row = _accocunts[i]; | ||
AccountRow *_row = new AccountRow(row->getRowId(), strdup(row->getLabel().c_str())); | ||
accocunts[i] = reinterpret_cast<int64_t>(_row); | ||
} | ||
|
||
return accocunts; | ||
} | ||
|
||
void account_add_row(char *label) | ||
{ | ||
m_account->addRow(std::string(label)); | ||
} | ||
|
||
void account_set_label_row(uint32_t account_index, char *label) | ||
{ | ||
m_account->setLabel(account_index, label); | ||
} | ||
|
||
void account_refresh() | ||
{ | ||
m_account->refresh(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OmarHatem28
idk where to remove accounts. Can you guys handle
Removing accounts- Adding to fiat api
- Adding to exchange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I removed accounts, at least visually. There's still code related to accounts, but that's because we're using account 0 by default.
edit: lets see what @OmarHatem28 thinks about the current situation regarding accounts.
Thanks @nahuhh Rebased against latest I tested:
I enabled the buy/exchange options, but need confirmation these actually work (don't know which providers they integrate with). Regarding the fiat API, this is on Cake's side, it can be fetched from coingecko: $ curl -s 'https://api.coingecko.com/api/v3/coins/wownero?tickers=false&community_data=false&developer_data=false&sparkline=false' | jq '.market_data.current_price.usd'
0.120241 Edit: maybe the fiat API already supports WOW, I'm not sure without API key. |
5fbbb77
to
c20092a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
soon, no more tm
need from cake for release:
|
Pinging @OmarHatem28 ty |
Hey! There is a little detail that I've encountered when a combination of wownero and monero is used together in one process as a shared library. The issue is as follows
I've encountered this issue on linux while working on another wallet that uses cw libraries, I'm not sure if this is the case with cake in this PR (I'll check it once I have some more time), but this is something that may cause issue. |
@MrCyjaneK thanks for sharing this issue, we will check if it's indeed the case in #1345, alongside the other fixes, feel free to try the APK in there and share your insights on the PR if you find anything missing or should be fixed or needs enhancements. |
I am now wondering if this is not already happening between all monero-like |
@sanderfoobar up to my current knowledge it is. |
Continuation of #362
Wownero support. Uses Polyseed this time (we are phasing out
wownero-seed
).I tested: sending/receiving/history on both Android (arm64) and Android emulator (x86_64).
Notes:
There are still some to-do's:
1. Fiat <-> WOW calculations
Probably requires #361
2. Accounts runtime error
Dashboard -> Receive -> Accounts
gives an error. Fix would be to leave out the accounts feature in its entirety just like last PR - as we do not use the account feature in Wownero. Would be nice if someone could exclude this feature whencoin type == wownero
.3. Exchange button
The exchange button at the dashboard for WOW should (probably) not be active.
4. iOS/macos untested
Untested - getting the iOS emulator to run is a bit difficult with the certificates and all.
5. pubspec
I updated
watcher
to1.1.0
.6. Docker fixes
The following had some issues:
I fixed various things in
scripts/docker
:build_haven.sh
interpreter changed to/bin/bash
byacc
toapt get
inDockerfile
, it is needed for libunbound to compile correctly7. Wownero branch
Changes to Wownero to facilitate Cake using wow's wallet2 API went into a branch called cake-fixes. The build script
build_wownero.sh
is pinned to a commit hash.8. Polyseed
Waiting on:
Current situation is that create wallet generates a Polyseed with the Monero coin type.