Commit graph

242 commits

Author SHA1 Message Date
Ilya Kitaev
8df820b301 - testnet option added to api; 2016-06-23 15:49:07 +03:00
Ilya Kitaev
94eaeb50b2 wallet2::store() implemented within wallet2::store_to 2016-06-23 15:40:48 +03:00
Ilya Kitaev
f1c4a376af Wallet::createTransaction: added mixin_count param 2016-06-20 22:56:30 +03:00
Ilya Kitaev
3318addafa double/string to monero integer convertion methods 2016-06-16 16:42:33 +03:00
Ilya Kitaev
3ac20a46b3 wallet::default_mixin exposed to public interface as
Wallet::setDefaultMixin, Wallet::defaultMixin;
wallet::create_transaction_2 used in Wallet::createTransaction
2016-06-10 13:52:10 +03:00
Ilya Kitaev
c554055ce4 Wallet::filename, Wallet::keysFilename, tests for move wallet 2016-06-10 12:51:09 +03:00
Ilya Kitaev
2facbe77e4 Wallet API : WalletManager::findWallets() added 2016-06-03 14:52:58 +03:00
Ilya Kitaev
ec949c383c scripts for faster test wallets generation 2016-06-01 17:06:10 +03:00
Ilya Kitaev
7f3d28fe1b regenerated test wallets, basic functions got broken 2016-05-27 13:35:00 +03:00
Ilya Kitaev
bc4584c1ff Merge remote-tracking branch 'upstream/master' 2016-05-27 11:33:08 +03:00
moneroexample
de030d99a5 fix: error: -Werror=misleading-indentation
Compilation of bitmonero on Arch with gcc 6.1 results in the following
error:

/home/mwo/bitmonero/tests/unit_tests/hardfork.cpp: In member function ‘virtual void TestDB::set_hard_fork_version(uint64_t, uint8_t)’:
/home/mwo/bitmonero/tests/unit_tests/hardfork.cpp:132:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
     if (versions.size() <= height) versions.resize(height+1); versions[height] = version;

This can be fixed by simply unfolding this line into three lines.
2016-05-18 10:54:41 -04:00
Riccardo Spagni
e54e4d96a4
Merge pull request #831
9ef8c7b tests: fix tests broken by the removal of the block reward accumulation loop (moneromooo-monero)
a6e717e cn_deserialize: deserialize tx_extra too (moneromooo-monero)
3eff37f unit_tests: add a write_varint/read_varint test (moneromooo-monero)
7a66387 unit_tests: fix UNBOUND_LIBRARIES/UNBOUND_LIBRARY typo (moneromooo-monero)
d6bce4b core: move tx_extra parsing errors to log level 1 (moneromooo-monero)
2016-05-17 19:07:28 +02:00
Ilya Kitaev
9ae4e871a3 WalletListener::moneyReceived test 2016-05-17 12:16:11 +03:00
Ilya Kitaev
40087a745f WalletListener::moneySpent test 2016-05-16 13:11:44 +03:00
Ilya Kitaev
2d799097ca Merge remote-tracking branch 'upstream/master' 2016-05-12 15:14:30 +03:00
moneromooo-monero
9ef8c7b694
tests: fix tests broken by the removal of the block reward accumulation loop
The tests for rejection of unmixable outputs in v2 are commented out,
as there are no unmixable outputs created anymore. This should be
restored at some point.
2016-05-01 20:59:41 +01:00
moneromooo-monero
3eff37f931
unit_tests: add a write_varint/read_varint test 2016-05-01 11:42:31 +01:00
moneromooo-monero
7a663873ce
unit_tests: fix UNBOUND_LIBRARIES/UNBOUND_LIBRARY typo 2016-05-01 11:35:14 +01:00
Riccardo Spagni
30dce45643 Merge branch 'performance' of https://github.com/LMDB/bitmonero 2016-04-29 21:41:43 +02:00
Ilya Kitaev
93119344ec TransactionHistory continued 2016-04-29 16:26:14 +03:00
Ilya Kitaev
dce5374660 Merge remote-tracking branch 'upstream/master' into develop 2016-04-26 11:08:40 +03:00
Ilya Kitaev
53a97bdcd3 Wallet API: transaction history in progress 2016-04-22 13:33:09 +03:00
Ilya Kitaev
02c9df5de2 Wallet API : transaction history in progress 2016-04-22 13:21:08 +03:00
moneromooo-monero
672162d9e2
tests: fix compile failure on wallet2::transfer 2016-04-17 11:21:01 +01:00
Riccardo Spagni
b52148201b
Merge pull request #786
5092e45 tests: unbound API is only accessible in static builds (moneromooo-monero)
2016-04-14 16:26:29 +09:00
Riccardo Spagni
6bfb8799c3
Merge pull request #783
48d0747 wallet: better output selection for transfer/transfer_new (moneromooo-monero)
2016-04-14 16:25:38 +09:00
Ilya Kitaev
1774d9574b TODOs for Transaction/Transfer interface 2016-04-12 22:30:20 +03:00
Ilya Kitaev
d97e9ef8a5 Transaction API continued 2016-04-06 13:56:57 +03:00
Howard Chu
d7ea7d9a23 Merge branch 'performance' into master 2016-04-05 21:13:16 +01:00
Howard Chu
372acee723 Cleanup
drop obsolete remove_output()
fix get_output_key(global), fix crash in blockchain_dump
2016-04-05 21:05:24 +01:00
Ilya Kitaev
079fbd3d42 Wallet::createTransaction API introduced 2016-04-05 15:24:44 +03:00
Ilya Kitaev
ee5bb17f26 Wallet::transfer() continued 2016-04-04 14:56:17 +03:00
Javier Smooth
17cac41968
tests: fix build with older GCC 2016-04-02 22:05:56 +01:00
moneromooo-monero
5092e45e3f
tests: unbound API is only accessible in static builds 2016-04-02 16:02:18 +01:00
moneromooo-monero
48d0747d00
wallet: better output selection for transfer/transfer_new
This now requests the set of outputs that can be mixed first,
to avoid trying non dust but unmixable outputs, which we know
will fail.
2016-04-02 14:17:02 +01:00
Ilya Kitaev
830c19c934 Wallet::refresh + tests 2016-03-31 16:38:57 +03:00
Ilya Kitaev
2157a9ac48 testnet option, Wallet::balance(), Wallet::unlockedBalance() 2016-03-31 12:48:41 +03:00
Ilya Kitaev
df6026182a Merge remote-tracking branch 'upstream/master' 2016-03-31 12:01:19 +03:00
moneromooo-monero
34957fcbb9
tests: add test for needed OpenSSL algorithms in unbound
These can be compiled out of libunbound, leading to failure
to check DNSSEC validity.
2016-03-29 17:56:42 +01:00
moneromooo-monero
d5d46e6d6d
tests: obligatory hardfork unit build fix after interface change 2016-03-26 23:44:04 +00:00
moneromooo-monero
600a3cf0c0
New RPC and daemon command to get output histogram
This is a list of existing output amounts along with the number
of outputs of that amount in the blockchain.

The daemon command takes:
- no parameters: all outputs with at least 3 instances
- one parameter: all outputs with at least that many instances
- two parameters: all outputs within that many instances

The default starts at 3 to avoid massive spamming of all dust
outputs in the blockchain, and is the current minimum mixin
requirement.

An optional vector of amounts may be passed, to request
histogram only for those outputs.
2016-03-26 21:10:43 +00:00
Ilya Kitaev
8790904cf9 - testnet option added to api; 2016-03-25 17:06:30 +03:00
moneromooo-monero
4b425a397c
core_tests: fix compile failure with GCC 4.8.4
Reported and tested by smooth
2016-03-21 20:58:07 +00:00
Ilya Kitaev
2cce32995b wallet2::store() implemented within wallet2::store_to 2016-03-21 16:17:03 +03:00
moneromooo-monero
f7301c3563
Revert "Print stack trace upon exceptions"
Ain't nobody got time for link/cmake skullduggery.

This reverts commit fff238ec94.
2016-03-21 10:12:23 +00:00
moneromooo-monero
fff238ec94
Print stack trace upon exceptions
Useful for debugging users' logs
2016-03-19 21:48:36 +00:00
moneromooo-monero
498ad73729
tests: enable core tests again
They should not have been disabled in the first place
2016-03-17 22:14:08 +00:00
Ilya Kitaev
7df2baf6b0 fixed "undefined reference" for boost::system library 2016-03-16 15:33:39 +03:00
Ilya Kitaev
62606f11f5 Wallet::store_to(path, password) implemented; 2016-03-16 14:29:06 +03:00
Ilya Kitaev
19fcc74912 Wallet::address implemented 2016-03-16 14:29:06 +03:00
Ilya Kitaev
180ac6e438 WalletManager::recoveryWallet implemented 2016-03-16 14:29:06 +03:00
Ilya Kitaev
5a4f099540 Wallet::setPassword() method for wallet2_api 2016-03-16 14:29:06 +03:00
Ilya Kitaev
57d7ffc4d6 changes in wallet2_api + implemented WalletManager::openWallet 2016-03-16 14:27:57 +03:00
Ilya Kitaev
f1f9279d90 get_seed() included to interface 2016-03-16 14:27:57 +03:00
Ilya Kitaev
930bed7074 tests for wallet2_api 2016-03-16 14:27:57 +03:00
warptangent
dfca2ae1b5
unit_tests: fix hard fork unit test compilation
Match changed BlockchainDB function declaration.
2016-03-05 10:01:10 -08:00
Riccardo Spagni
95b3b09e11
Merge pull request #689
5ab33ca unit_tests: update test openalias address (moneromooo-monero)
2016-02-29 17:31:07 -05:00
moneromooo-monero
5ab33cabf6
unit_tests: update test openalias address
It was recently changed
2016-02-23 23:12:55 +00:00
moneromooo-monero
5e3557d2c3
move g_test_dbg_lock_sleep from a global to a function level static
This avoids the need to define that variable in every program
which uses epee.
2016-02-22 19:34:09 +00:00
Riccardo Spagni
8a6d93be25
Merge pull request #659
d56b2e5 core_tests: fix a compile problem with CLANG (moneromooo-monero)
2016-02-17 17:07:53 +02:00
moneromooo-monero
d56b2e5baf
core_tests: fix a compile problem with CLANG
It doesn't like const objects from classes that do not have
a user defined ctor, apparently.

Reported by othe.
2016-02-13 19:49:36 +00:00
moneromooo-monero
c7cfc764c4
Add the new test files
Forgot to add them before commit
2016-02-13 17:59:25 +00:00
moneromooo-monero
5cb03a15be
unit_tests: fix blockchain unit test after hard fork import fix 2016-02-08 20:58:43 +00:00
moneromooo-monero
a333c42cde
core_tests: add tests for hard fork behaviors (MRL-0004)
We also replace the --fakechain option with an optional structure
containing details about configuration for the core/blockchain,
for test purposes. This seems more future friendly.
2016-02-08 18:52:00 +00:00
moneromooo-monero
945fe90e08
core_tests: allow setting miner tx max_outs when creating a block 2016-02-08 18:50:08 +00:00
moneromooo-monero
8e4c2e6ebe
unit_tests: fix hard fork unit test compilation 2016-02-08 18:44:27 +00:00
Riccardo Spagni
cea6f6fb9c
Merge pull request #641
7658ac0 blockchain: revert handle_get_objects adding block id on tx not found (moneromooo-monero)
3a0f4d8 berkeleydb: fix delete/free mismatch (moneromooo-monero)
1642be2 minor bugfixes and refactoring (Thomas Winget)
098dcf2 unit_tests: fix mnemonics unit test testing invalid seeds (moneromooo-monero)
2016-02-08 18:31:42 +02:00
Riccardo Spagni
c1378881ef
Merge pull request #639
119eb10 unit_tests: fix hard fork unit tests and add a test for major too (moneromooo-monero)
64a2aa3 hardfork: allow passing chain height in get(height) for convenience (moneromooo-monero)
2016-02-08 18:29:03 +02:00
moneromooo-monero
098dcf2885
unit_tests: fix mnemonics unit test testing invalid seeds
Some word triplets, such as "mugged names nail", are not valid
results from any 32 bit value. If used to decode a 32 bit value,
the result will therefore encode to a different word triplet.

Fix this by using random words converted from an actual random
bitstring, ensuring we always get valid triplets.
2016-02-01 20:47:03 +00:00
moneromooo-monero
119eb10d7c
unit_tests: fix hard fork unit tests and add a test for major too 2016-02-01 20:07:15 +00:00
moneromooo-monero
6827061d5f
tests: fix compilation failure after V1 define rename 2016-01-31 22:11:57 +00:00
Riccardo Spagni
3b0f67c629
updated gtest (added missing files) 2016-01-25 21:19:57 +02:00
Riccardo Spagni
4df6aa5d12
updated gtest 2016-01-25 20:10:10 +02:00
me0wmix
28f95eb001 OpenBSD support for Monero. 2016-01-21 11:18:26 -07:00
Howard Chu
4cf6e2b2c3 Fix 30f92f5630
Needed to add the corresponding (dummy) method to unit test hardfork
2016-01-16 16:10:16 +00:00
moneromooo-monero
a8caab1af1
unit_tests: initialize db object in ctor, not open
open isn't actually called in those tests
2016-01-02 11:37:00 +00:00
Riccardo Spagni
de03926850
updated copyright year 2015-12-31 08:39:56 +02:00
Riccardo Spagni
be7a93f51f
Merge pull request #580
1813736 unit_tests: remove an unused variable (moneromooo-monero)
70dd346 unit_tests: fix hardfork test build (moneromooo-monero)
2015-12-31 08:18:27 +02:00
moneromooo-monero
1813736562
unit_tests: remove an unused variable 2015-12-30 17:30:54 +00:00
moneromooo-monero
70dd34634c
unit_tests: fix hardfork test build
The dummy blockchain class needed to have the newly added
is_read_only virtual function.
2015-12-30 17:30:01 +00:00
moneromooo-monero
b245215193
core_tests: deinit core before destroying it
This fixes a use after free by ioservice threads
2015-12-30 16:05:52 +00:00
moneromooo-monero
b90e14d927
tests: add a unit test for canonical decomposed amounts 2015-12-26 11:41:50 +00:00
moneromooo-monero
79beed221d
tests: fix various tests by using parameters better suited to monero
Either smaller coin values (as monero has smaller block rewards),
or pre-hard fork values (full reward zone), or post-Bytecoin values
(emission speed).
2015-12-25 22:26:34 +00:00
moneromooo-monero
d0a8362b6b
tests: fix some double spending tests
Some tests assume the first output in a transaction goes to the recipient.
However, it can be the change. When it is, the recipient's keys will not
recognize this output. To fix this, we send all we have, to ensure there
is no change, and the first output goes to the recipient.

I'm not sure why this worked with Cryptonote. The tests sent 17 coins,
which seems way smaller than the first Bytecoin block reward, so there
would have been change too. Maybe outputs were not shuffled originally.
2015-12-25 22:23:36 +00:00
moneromooo-monero
2358d0d5be
tests: use 255 as a "too high" block version
While the original cryptonote accepted only the current major
version, we can accept higher ones.
2015-12-25 22:22:12 +00:00
moneromooo-monero
81cb0fcdcc
blockchain: fix bitflipping test with quantized block rewards
Block reward may now be less than the full amount allowed.
This was breaking the bitflipping test.
We now keep track of whether a block which was accepted by the core
has a lower than allowed block reward, and allow this in the test.
2015-12-25 22:07:58 +00:00
moneromooo-monero
6c868595b7
unit_tests: fix hard fork tests
A couple stopped passing when the hard fork code was made
to reject incoming hard fork versions it did not know about.
2015-12-24 16:12:03 +00:00
moneromooo-monero
8b0200adf8
unit_tests: new test for IP blocking 2015-12-24 16:05:19 +00:00
moneromooo-monero
217792351d
Tone down a bit L0 logs during daemon sync 2015-12-14 00:36:37 +00:00
moneromooo-monero
cbded439f4
core_tests: fix ring_signature_1 tests
They were trying to send too much monero, and thus failing.
The parameters were set in such a way that the (simple) output
gathering code could fulfill them for 4 block rewards for the
original Bytecoin emission, but that does not work with monero
so we need to use smaller values.
2015-12-13 13:58:13 +00:00
moneromooo-monero
c3d208fcbe
core_tests: bump default test fee to 0.02 monero
The current monero consensus uses 0.01 per kB fees, so use enough
for 2 kB transactions for now. It'll probably have to be either
bumped further or changed to calculate the proper fee.
2015-12-13 13:56:15 +00:00
moneromooo-monero
10da0a0b7c
add a --fakechain argument for tests
The core tests use the blockchain, and reset it to be able
to add test data to it. This does not play nice with the
databases, since those will save that data without an explicit
save call.
We add a fakechain flag that the tests will set, which tells
the core and blockchain code to use a separate database, as
well as skip a few things like checkpoints and fixup, which
only make sense for real data.
2015-12-13 11:38:37 +00:00
moneromooo-monero
eee44e62bc
unit_tests: fix block reward test using post hard fork settings
This would fail, as the post hard fork settings would yield
different data, and the test expects pre hard fork data.
2015-12-13 11:18:59 +00:00
moneromooo-monero
44f1267a39
tests: fix a typo in test name 2015-12-13 11:10:33 +00:00
moneromooo-monero
f141869cac
tests: remove data-dir argument registration
It is already registered in cryptonote::core::init_options,
which we now call
2015-12-09 17:31:15 +00:00
moneromooo-monero
a3c5ca077c
blockchain_db: make the indexing base a BlockchainDB virtual function 2015-12-05 18:41:29 +00:00
moneromooo-monero
d887c18e33
hardfork: fix more major/minor issues
Also add some more tests, and rename some instances of
"version" and "add" for clarity.

NOTE: the starting height values are sometimes wrong.
I suspect this is due to the hard fork reorg code being
buggy, since they're good when syncing after the fact.
However, they're not actually used by the consensus code,
so I'm ignoring this for now, but this needs debugging.
2015-11-24 20:47:12 +00:00
moneromooo-monero
932994c0cb
Relay transactions when they linger too long in the pool
The last relayed time of a transaction is maintained, and
transactions will be relayed again if they are still in the
pool after a certain amount of time, which increases with
the transaction's age. All such transactions are resent,
whether or not they originated on the local node.
2015-11-21 00:56:21 +00:00
Riccardo Spagni
0d09e15a1c
Merge pull request #490
baf101e More changes for 2-min blocks Use the correct block time for realtime fuzz on locktime Use the correct block time to calculate next_difficulty on alt chains (will not work as-is with voting) Lock unit tests to original block time for now (Javier Smooth)
4fea1a5 Adjust difficulty target (2 min) and full reward zone (60 kbytes) for block version 2 (Javier Smooth)
2015-11-18 10:37:27 +02:00
moneromooo-monero
036d352210
tests: fix build error with CLANG 2015-11-17 16:33:00 +00:00