Skip to content
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

Wallet::balance(), Wallet::createTransaction(), PendingTransaction::commit() tests failed #1

Closed
mbg033 opened this issue May 27, 2016 · 1 comment
Assignees
Labels

Comments

@mbg033
Copy link
Owner

mbg033 commented May 27, 2016

Essential wallet api functionality got broken, probably due changes in underlying libwallet code:

[mbg033@ubuntu ~/.../libwallet_api_tests$] ./libwallet_api_tests 
[==========] Running 5 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 5 tests from WalletTest1
[ RUN      ] WalletTest1.WalletShowsBalance
[       OK ] WalletTest1.WalletShowsBalance (0 ms)
[ RUN      ] WalletTest1.WalletRefresh
2016-Jun-02 10:31:12.716103 Loaded wallet keys file, with public address: 9x8PgsYAVCdTr8tSm1QwuVc4Kt6QDDhkh335gGLXq4xz64z3voiXTXbXm8vxRjS9GGEYajL4VZ8kpcLRLLXZSnqhRQrLRjA
2016-Jun-02 10:31:12.716271 Trying to decrypt cache data
2016-Jun-02 10:31:12.930303 Refresh done, blocks received: 11, balance: 100.000000000000, unlocked: 100.000000000000
[       OK ] WalletTest1.WalletRefresh (282 ms)
[ RUN      ] WalletTest1.WalletTransaction
2016-Jun-02 10:31:12.987136 Loaded wallet keys file, with public address: 9x8PgsYAVCdTr8tSm1QwuVc4Kt6QDDhkh335gGLXq4xz64z3voiXTXbXm8vxRjS9GGEYajL4VZ8kpcLRLLXZSnqhRQrLRjA
2016-Jun-02 10:31:12.987237 Trying to decrypt cache data
2016-Jun-02 10:31:13.126287 Refresh done, blocks received: 0, balance: 100.000000000000, unlocked: 100.000000000000
2016-Jun-02 10:31:13.172136 Loaded wallet keys file, with public address: 9y5yFaimvqrT11C9AKx6LPgD9g8iXGjrfeJBa8uh2qke4rjdXfFApERV73XurKsehZTx2yZTH12dP4CFK9kny9GaEnGes7x
2016-Jun-02 10:31:13.172247 Trying to decrypt cache data
2016-Jun-02 10:31:13.526028 amount=100.000000000000, real_output=4, real_output_in_tx_index=2, indexes: 7 11 14 16 21 
2016-Jun-02 10:31:13.766039 amount=100.000000000000, real_output=4, real_output_in_tx_index=2, indexes: 9 12 15 18 21 
2016-Jun-02 10:31:13.930311 Refresh done, blocks received: 0, balance: 100.000000000000, unlocked: 100.000000000000
2016-Jun-02 10:31:13.930349 m_pending_tx size: 1
2016-Jun-02 10:31:14.010101 Transaction successfully sent. <<96c5165eb3e1019ed37049f00da60a640d1cfdec8e6603ff739b65c50cd7677c>>
Commission: 0.010000000000 (dust sent to dust addr: 0.000000000000)
Balance: 89.990000000000
Unlocked: 0.000000000000
Please, wait for confirmation for your balance to be unlocked.
[       OK ] WalletTest1.WalletTransaction (1082 ms)
[ RUN      ] WalletTest1.WalletHistory
2016-Jun-02 10:31:14.071784 Loaded wallet keys file, with public address: 9x8PgsYAVCdTr8tSm1QwuVc4Kt6QDDhkh335gGLXq4xz64z3voiXTXbXm8vxRjS9GGEYajL4VZ8kpcLRLLXZSnqhRQrLRjA
2016-Jun-02 10:31:14.071936 Trying to decrypt cache data
2016-Jun-02 10:31:14.290121 Refresh done, blocks received: 0, balance: 89.990000000000, unlocked: 0.000000000000
d: in, pe: false, bh: 3318, a: 100.000000000000, f: 0.000000000000, h: 48e3ef1d7f5467715cb6b8b631c54549a77fd8ea77398ddd0e89fd80bdb5b30b, pid: 0000000000000000
d: out, pe: true, bh: 0, a: 10.010000000000, f: 0.010000000000, h: 96c5165eb3e1019ed37049f00da60a640d1cfdec8e6603ff739b65c50cd7677c, pid: 0000000000000000
[       OK ] WalletTest1.WalletHistory (249 ms)
[ RUN      ] WalletTest1.WalletTransactionAndHistory
[       OK ] WalletTest1.WalletTransactionAndHistory (0 ms)
[----------] 5 tests from WalletTest1 (1613 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 1 test case ran. (1613 ms total)
[  PASSED  ] 5 tests.

  YOU HAVE 8 DISABLED TESTS

[mbg033@ubuntu ~/.../libwallet_api_tests$] ./libwallet_api_tests 
[==========] Running 5 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 5 tests from WalletTest1
[ RUN      ] WalletTest1.WalletShowsBalance
[       OK ] WalletTest1.WalletShowsBalance (0 ms)
[ RUN      ] WalletTest1.WalletRefresh
2016-Jun-02 10:31:25.811320 Loaded wallet keys file, with public address: 9x8PgsYAVCdTr8tSm1QwuVc4Kt6QDDhkh335gGLXq4xz64z3voiXTXbXm8vxRjS9GGEYajL4VZ8kpcLRLLXZSnqhRQrLRjA
2016-Jun-02 10:31:25.811485 Trying to decrypt cache data
2016-Jun-02 10:31:26.026461 Received money: 0.090000000000, with tx: <96c5165eb3e1019ed37049f00da60a640d1cfdec8e6603ff739b65c50cd7677c>
2016-Jun-02 10:31:26.026944 Received money: 0.900000000000, with tx: <96c5165eb3e1019ed37049f00da60a640d1cfdec8e6603ff739b65c50cd7677c>
2016-Jun-02 10:31:26.027412 Received money: 9.000000000000, with tx: <96c5165eb3e1019ed37049f00da60a640d1cfdec8e6603ff739b65c50cd7677c>
2016-Jun-02 10:31:26.027879 Received money: 80.000000000000, with tx: <96c5165eb3e1019ed37049f00da60a640d1cfdec8e6603ff739b65c50cd7677c>
2016-Jun-02 10:31:26.027924 Spent money: 100.000000000000, with tx: <96c5165eb3e1019ed37049f00da60a640d1cfdec8e6603ff739b65c50cd7677c>
2016-Jun-02 10:31:26.106092 Refresh done, blocks received: 3, balance: 89.990000000000, unlocked: 0.000000000000
[       OK ] WalletTest1.WalletRefresh (364 ms)
[ RUN      ] WalletTest1.WalletTransaction
2016-Jun-02 10:31:26.183015 Loaded wallet keys file, with public address: 9x8PgsYAVCdTr8tSm1QwuVc4Kt6QDDhkh335gGLXq4xz64z3voiXTXbXm8vxRjS9GGEYajL4VZ8kpcLRLLXZSnqhRQrLRjA
2016-Jun-02 10:31:26.183131 Trying to decrypt cache data
2016-Jun-02 10:31:26.314163 Refresh done, blocks received: 0, balance: 89.990000000000, unlocked: 0.000000000000
2016-Jun-02 10:31:26.353987 Loaded wallet keys file, with public address: 9y5yFaimvqrT11C9AKx6LPgD9g8iXGjrfeJBa8uh2qke4rjdXfFApERV73XurKsehZTx2yZTH12dP4CFK9kny9GaEnGes7x
2016-Jun-02 10:31:26.354087 Trying to decrypt cache data
2016-Jun-02 10:31:26.626022 ERROR /home/mbg033/dev/monero/bitmonero/src/wallet/wallet2.h:627 found_money < needed_money. THROW EXCEPTION: error::not_enough_money
2016-Jun-02 10:31:26.626068 /home/mbg033/dev/monero/bitmonero/src/wallet/wallet2.h:627:N5tools5error16not_enough_moneyE: not enough money, available = 0.000000000000, tx_amount = 10.000000000000, fee = 0.000000000000
/home/mbg033/dev/monero/bitmonero/tests/libwallet_api_tests/main.cpp:366: Failure
Value of: transaction->status() == Bitmonero::PendingTransaction::Status_Ok
  Actual: false
Expected: true
[  FAILED  ] WalletTest1.WalletTransaction (491 ms)
[ RUN      ] WalletTest1.WalletHistory
2016-Jun-02 10:31:26.655858 Loaded wallet keys file, with public address: 9x8PgsYAVCdTr8tSm1QwuVc4Kt6QDDhkh335gGLXq4xz64z3voiXTXbXm8vxRjS9GGEYajL4VZ8kpcLRLLXZSnqhRQrLRjA
2016-Jun-02 10:31:26.655965 Trying to decrypt cache data
2016-Jun-02 10:31:26.794078 Refresh done, blocks received: 0, balance: 89.990000000000, unlocked: 0.000000000000
d: in, pe: false, bh: 3318, a: 100.000000000000, f: 0.000000000000, h: 48e3ef1d7f5467715cb6b8b631c54549a77fd8ea77398ddd0e89fd80bdb5b30b, pid: 0000000000000000
d: out, pe: false, bh: 3355, a: 10.000000000000, f: 0.010000000000, h: 96c5165eb3e1019ed37049f00da60a640d1cfdec8e6603ff739b65c50cd7677c, pid: 0000000000000000
[       OK ] WalletTest1.WalletHistory (168 ms)
[ RUN      ] WalletTest1.WalletTransactionAndHistory
[       OK ] WalletTest1.WalletTransactionAndHistory (0 ms)
[----------] 5 tests from WalletTest1 (1023 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 1 test case ran. (1023 ms total)
[  PASSED  ] 4 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] WalletTest1.WalletTransaction

 1 FAILED TEST
  YOU HAVE 8 DISABLED TESTS

simplewallet before running tests:

[mbg033@ubuntu ~/.../testnet$] ./open_wallet_1.sh 
Creating the logger system
Monero 'Hydrogen Helix' (v0.9.4.0-8b0d22a)
Logging at log level 0 to /home/mbg033/dev/monero/testnet/wallet_01.log
Opened wallet: 9x8PgsYAVCdTr8tSm1QwuVc4Kt6QDDhkh335gGLXq4xz64z3voiXTXbXm8vxRjS9GGEYajL4VZ8kpcLRLLXZSnqhRQrLRjA
**********************************************************************
Use "help" command to see the list of available commands.
**********************************************************************
Height 3318, transaction <48e3ef1d7f5467715cb6b8b631c54549a77fd8ea77398ddd0e89fd80bdb5b30b>, received 100.000000000000
[wallet 9x8Pgs]: balance
Balance: 100.000000000000, unlocked balance: 0.000000000000
[wallet 9x8Pgs]: refresh
Starting refresh...
Refresh done, blocks received: 17                               
Balance: 100.000000000000, unlocked balance: 100.000000000000
[wallet 9x8Pgs]: q

simplewallet after running tests:

[mbg033@ubuntu ~/.../testnet$] ./open_wallet_1.sh 
Creating the logger system
Monero 'Hydrogen Helix' (v0.9.4.0-8b0d22a)
Logging at log level 0 to /home/mbg033/dev/monero/testnet/wallet_01.log
Opened wallet: 9x8PgsYAVCdTr8tSm1QwuVc4Kt6QDDhkh335gGLXq4xz64z3voiXTXbXm8vxRjS9GGEYajL4VZ8kpcLRLLXZSnqhRQrLRjA
**********************************************************************
Use "help" command to see the list of available commands.
**********************************************************************
[wallet 9x8Pgs]: refresh
Starting refresh...
Refresh done, blocks received: 0                                
Balance: 89.990000000000, unlocked balance: 89.990000000000
[wallet 9x8Pgs]: transfer 9y5yFaimvqrT11C9AKx6LPgD9g8iXGjrfeJBa8uh2qke4rjdXfFApERV73XurKsehZTx2yZTH12dP4CFK9kny9GaEnGes7x 10
Money successfully sent, transaction <a14a4fc0ed581d79f691d8c02790ae5265a206f99da2f323f2c26cbc87e90a22>
[wallet 9x8Pgs]: transfer 9y5yFaimvqrT11C9AKx6LPgD9g8iXGjrfeJBa8uh2qke4rjdXfFApERV73XurKsehZTx2yZTH12dP4CFK9kny9GaEnGes7x 10
Error: not enough money to transfer, available only 0.000000000000, transaction amount 10.000000000000 = 10.000000000000 + 0.000000000000 (fee)
Height 3414, transaction <a14a4fc0ed581d79f691d8c02790ae5265a206f99da2f323f2c26cbc87e90a22>, received 0.070000000000
Height 3414, transaction <a14a4fc0ed581d79f691d8c02790ae5265a206f99da2f323f2c26cbc87e90a22>, received 0.900000000000
Height 3414, transaction <a14a4fc0ed581d79f691d8c02790ae5265a206f99da2f323f2c26cbc87e90a22>, received 9.000000000000
Height 3414, transaction <a14a4fc0ed581d79f691d8c02790ae5265a206f99da2f323f2c26cbc87e90a22>, received 70.000000000000
Height 3414, transaction <a14a4fc0ed581d79f691d8c02790ae5265a206f99da2f323f2c26cbc87e90a22>, spent 9.000000000000
Height 3414, transaction <a14a4fc0ed581d79f691d8c02790ae5265a206f99da2f323f2c26cbc87e90a22>, spent 0.900000000000
Height 3414, transaction <a14a4fc0ed581d79f691d8c02790ae5265a206f99da2f323f2c26cbc87e90a22>, spent 0.090000000000
Height 3414, transaction <a14a4fc0ed581d79f691d8c02790ae5265a206f99da2f323f2c26cbc87e90a22>, spent 80.000000000000
[wallet 9x8Pgs]: refresh
Starting refresh...
Refresh done, blocks received: 8                                
Balance: 79.970000000000, unlocked balance: 79.970000000000
[wallet 9x8Pgs]: 

@mbg033 mbg033 self-assigned this May 27, 2016
@mbg033 mbg033 added the bug label May 27, 2016
@mbg033
Copy link
Owner Author

mbg033 commented Jun 2, 2016

not a bug:
"well if the „change“ of the coins you send has less than 6 confirmations then it can fail
this is complicated, it depends on the „inputs“ the wallet used for sending
see if u pay someone 50 usd and you have just 100usd bill in your wallet then u give him 100 and u get 50 back, but to use this 50 again in the case of monero it needs to be confirmed on the blockchain with 10 confirmations (6 was wrong)
normally the unlocked balance should show the available funds"

@mbg033 mbg033 closed this as completed Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant