The Wallet object used to have a guarenteed lifetime longer than the App
singleton, but then we started allowing people to delete their wallet
(argh!).
Also "external" modules, especially living outside of the main tree,
would be much more stable if they can avoid using raw pointers for core
concepts like the Wallet.
In some locales the group separator is a unicode character that does not
fit in an 8 byte string, causing misrenderings.
We now assume that things fit in 16 bit characters which should fit all
living languages.
This moves the decision if it is importing out of the wallet and we stop
using a broken heuristic.
Also cleanup the API usage of the hd masterkey format in the wallet
header.
this changes the call for historicalPrice() to now take the (int based)
timestamp as a ref and we change that to the actually found timestamp
upon success.
This is purely a future-proofing measure, don't accept transactions that
are likely to be handled differently than todays transactions.
Since the May 2023 upgrade versions other than 1 or two are not allowed
on-chain, but before that some version 4 transactions were mined (and some
negative numbered ones longer ago).
Talks about a version 10 transaction has started, so make sure this software,
if it is still running at someone's machine, will already reject higher
version transactions because we can't know if they are compatible or not.
This upstream refactor stopped passing in the pool by pointer and
now wraps it in a shared_ptr.
A lot less 'address-of' operators and generally cleaner code are
the result.
The CPP now does more of the (heavy) lifting and the UI layer can
ignore
most of the details with regards to there being digits behind the
separator for fiat at all.
The internal change is that the fiat based values are always processed
in cents, even if the cents are not displayed. This solves incorrect
display and generally removes special cases.
This is a long overdue cleanup around the ideas of entering
numbers in Flowee Pay.
The core dataclass BitcoinValue now keeps track where the number
came from, either user input or some calculation. This allows
us to have the Fiat and the Coin price stay in sync without weird
problems.
The one we type uses a string, the price field that we are not typing in
is then a slave and we follow the auto-generated number as the
source.
This solves a host of known issues:
* Editing of value objects is much more consistnnt and predictable now.
* Switching to a different fiat type now properly re-calculates the
values that are slaved. So if the primary is a BCH value then the fiat
value gets the new exhange rate instantly applied.
* Switching to a different fiat type properly applies having a separator
So if you go from euro to Japanese yen, we now remove the separator
and the numbers behind it.
* Changing the app setting from BCH to mBCH now properly updates all
amounts. Notice that the user-typed string wins, if you typed 2 and
then change to mBCH we assume you wanted 2, not 2000.
* Paste now works more logcally.
* Cursor is no longer sometimes invisible, requiring backspace to make
it show up.
And last we now protect against too large numbers. It is seen as an
error to type a number above 21 million BCH.
Fixes#19
This sets up a basic system for creating modules on top of the flowee
pay static lib in a way that is ensured to be isolated (modules can't
accidentally use each other's classes)
The setup is made such that the buildsystem does the hard work on
plugging in a new module, making it so that all you need to do is create
a new dir and a "{something}ModuleInfo.h" file and it will get compiled
in.
The point there is to make it not have any merge conflicts and just make
it dead easy to get started.
This fixes some cornercases and makes the test
a) properly data-driven (don't use 'today').
b) much more extensive.
This also removes some duplicate code and fixes some bugs in the actual
model it tests.
In our wallet we very rarely end up in a situation where we have to ask
the same transactions twice from a peer due to us having generated a
bunch of new keys from a HD wallet in the middle of a series we asked
that peer. Making the filter we sent at the start of the series be
outdated halfway through.
This is now handled properly.
This adds a unit test which tests that we now reach the right balance
and can add the same block multiple times without it failing.
Fixes: #12
Slowly the amount of cpp sources has been growing to the point
where its just too much to store in the root of the project.
I think they are more happy in a subdir as well, getting an elevated
position for themselves.
This new allows a value to be set as a number, for instance from the
user reading a QR code, and the "typed-value" is created from this
in order to allow the user to edit it instead of overwrite it.
For mined transactions we now use the historical fiat price of BCH
instead of the current.
This will give us a much more stable and historically accurate view of
our transactions.
Fixes: #7