Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsha256 committed Jul 31, 2014
2 parents 8bb6572 + 59725d6 commit 4bc1e18
Show file tree
Hide file tree
Showing 12 changed files with 314 additions and 14 deletions.
6 changes: 6 additions & 0 deletions BUILD_WIN32.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ run_cmake.bat (or run_cmake_x64.bat for 64bit development)
native compilers**. Look through the output and fix any errors. Then
hit **Generate**.

Please note that if you are targeting Windows XP platform you need to add the cache entry "CMAKE_GENERATOR_TOOLSET" to contain the "v120_xp" value before configuring.

Or you can run Cmake in command line:
> cd build
> cmake -G "Visual Studio 12" -T "v120_xp" -DINCLUDE_QT_WALLET ..\bitshares_toolkit
#### Build BitShares ####
* Launch *Visual Studio* and load `D:\BitShares\bin\BitShares.sln`
* Set Configuration to Win32 - RelWithDebInfo
Expand Down
7 changes: 5 additions & 2 deletions libraries/blockchain/chain_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@ namespace bts { namespace blockchain {
asset trading_volume(0, base_id);

omarket_status market_stat = _pending_state->get_market_status( _quote_id, _base_id );
if( !market_stat.valid() )
{
if( quote_asset->is_market_issued() ) FC_CAPTURE_AND_THROW( insufficient_depth, (market_stat) );
FC_ASSERT( market_stat.valid() );
}

while( get_next_bid() && get_next_ask() )
{

idump( (_current_bid)(_current_ask) );
price ask_price = _current_ask->get_price();
// this works for bids, asks, and shorts.... but in the case of a cover
Expand Down Expand Up @@ -256,7 +260,6 @@ namespace bts { namespace blockchain {
_current_ask->state.balance ) );
}


if( _current_bid->type == bid_order )
{
_current_bid->state.balance -= usd_paid_by_bid.amount;
Expand Down
2 changes: 2 additions & 0 deletions libraries/client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3135,10 +3135,12 @@ config load_config( const fc::path& datadir )

bool rpc_server_config::is_valid() const
{
#ifndef _WIN32
if (rpc_user.empty())
return false;
if (rpc_password.empty())
return false;
#endif
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion programs/qt_wallet
2 changes: 1 addition & 1 deletion programs/web_wallet
16 changes: 14 additions & 2 deletions run_vs.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
@echo off
call %~dp0\setenv.bat
start WDExpress.exe
rem start devenv.com

where WDExpress.exe
if %ERRORLEVEL% == 0 (
start WDExpress.exe
) else (
echo WDExpress.exe wasn't found
)

where devenv.com
if %ERRORLEVEL% == 0 (
start devenv.com
) else (
echo devenv.com wasn't found
)
10 changes: 5 additions & 5 deletions setenv.bat
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@echo off
set BITSHARES_ROOT=%~dp0..\
echo Using %BITSHARES_ROOT% as Bitshare root directory
echo Using %BITSHARES_ROOT% as Bitshares root directory

set OPENSSL_ROOT=%BITSHARES_ROOT%\OpenSSL
set OPENSSL_ROOT_DIR=%OPENSSL_ROOT%
set OPENSSL_INCLUDE_DIR=%OPENSSL_ROOT%\include
set DBROOTDIR=%BITSHARES_ROOT%\BerkeleyDB
set QTDIR=%BITSHARES_ROOT%\QT
set QTDIR=%BITSHARES_ROOT%\Qt5.3.1\5.3\msvc2013
set ICUROOT=%BITSHARES_ROOT%\ICU

set BOOST_ROOT=%BITSHARES_ROOT%\boost_1.55

set PATH="%APPDATA%\npm";%QTDIR%\bin;%ICUROOT%\bin;%ICUROOT%\lib;%BITSHARES_ROOT%\bin;%BITSHARES_ROOT%\Cmake\bin;%BITSHARES_ROOT%\boost\stage\lib;%PATH%
set PATH=%APPDATA%\npm;%QTDIR%\bin;%ICUROOT%\bin;%ICUROOT%\lib;%BITSHARES_ROOT%\bin;%BITSHARES_ROOT%\Cmake\bin;%BOOST_ROOT%\stage\lib;%PATH%
set CMAKE_PREFIX_PATH=%QTDIR%
set QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%\plugins\platforms

echo Setting up VS2013 environment...
call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat"

8 changes: 5 additions & 3 deletions setenv_x64.bat
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
@echo off
set BITSHARES_ROOT=%~dp0..\
echo Using %BITSHARES_ROOT% as Bitshare root directory
echo Using %BITSHARES_ROOT% as Bitshares root directory

set OPENSSL_ROOT=%BITSHARES_ROOT%\OpenSSL.x64
set OPENSSL_ROOT_DIR=%OPENSSL_ROOT%
set OPENSSL_INCLUDE_DIR=%OPENSSL_ROOT%\include
set DBROOTDIR=%BITSHARES_ROOT%\BerkeleyDB.x64

set QTDIR=%BITSHARES_ROOT%\Qt5.3.1_x64\5.3\msvc2013
set ICUROOT=%BITSHARES_ROOT%\ICU.x64
set BOOST_ROOT=%BITSHARES_ROOT%\boost_1.55.x64

set PATH=%BITSHARES_ROOT%\bin;%BITSHARES_ROOT%\Cmake\bin;%BITSHARES_ROOT%\boost\stage\lib;%PATH%
set PATH=%APPDATA%\npm;%QTDIR%\bin;%ICUROOT%\bin;%ICUROOT%\lib;%BITSHARES_ROOT%\bin;%BITSHARES_ROOT%\Cmake\bin;%BOOST_ROOT%\stage\lib;%PATH%
set CMAKE_PREFIX_PATH=%QTDIR%

echo Setting up VS2013 environment...
call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
Expand Down
111 changes: 111 additions & 0 deletions tests/regression_tests/parent_child_account/parent_child_account.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
default (unlocked) >>> debug_filter_output_for_tests true
OK
default (unlocked) >>> wallet_account_create parent
"XTS5drpKagoTFiMsg1urDXvrtY7Fkuyb4vkgBUCxrsnrer8ioRGrp"
default (unlocked) >>> wallet_account_create unregaccount
"XTS7wWv82L4JRAD6CH5bZCZgcqaFsJo2qDrNf5pDDqNkZtHviyf7b"
default (unlocked) >>> debug_enable_output false
>>> wallet_account_register parent delegate0 null 100
>>> debug_enable_output true
OK
default (unlocked) >>> debug_wait 2
OK
default (unlocked) >>> blockchain_list_accounts parent
NAME (* delegate) KEY REGISTERED VOTES FOR APPROVAL
-------------------------------------------------------------------------------------------------------------------------------------------------------
default (unlocked) >>> blockchain_get_account parent
No account found.
default (unlocked) >>> wallet_account_create testaccount1.parent
"XTS59EbWFCp7fv5Hyz9R9kkiysXzienVUTHyfNaZiNDiTpYejftfM"
default (unlocked) >>> wallet_account_create testaccount2.parent
"XTS5iThXoJbP9rnNsP83W9u7FzrinCCdV39PsgfQv1CNznBKqK1bg"
default (unlocked) >>> wallet_account_create testaccount3.parent
"XTS6gMFVtK34mYn7T7iGCWZJVT2Q4r7Vr2Tb8GHTnBrpgTBa9U87m"
default (unlocked) >>> wallet_account_create test1.testaccount1.parent
"XTS5muxe9bjq7GCmxwMGdXCPhtX6XagLmAq5EDCbLWbpPjk6XLxbn"
default (unlocked) >>> wallet_account_create test2.testaccount1.parent
"XTS6ML8aX5VuMwrGTypcUCQUw1Xeo2AxudDmKUWc9KAb3hqoFRZQc"
default (unlocked) >>> wallet_account_create accwithoutregparent.unregaccount
"XTS85bkFJvGccokScekeaQnQYSnLHSFuKvLWNfxsTLratubbroPh9"
default (unlocked) >>> debug_enable_output false
>>> wallet_account_register testaccount1.parent delegate0 null 100
>>> debug_wait_block_interval 1
>>> wallet_account_register testaccount2.parent delegate0 null 100
>>> debug_wait_block_interval 1
>>> wallet_account_register testaccount3.parent delegate0 null 100
>>> debug_wait_block_interval 1
>>> wallet_account_register test1.testaccount1.parent delegate0 null 100
>>> debug_wait_block_interval 1
>>> wallet_account_register test2.testaccount1.parent delegate0 null 100
>>> debug_wait_block_interval 1
>>> wallet_account_register accwithoutregparent.unregaccount delegate0 null 100
>>> debug_wait_block_interval 1
>>> debug_enable_output true
OK
default (unlocked) >>> debug_wait 2
OK
default (unlocked) >>> blockchain_get_account testaccount1.parent
Name: testaccount1.parent
Registered: [redacted]
Last Updated: [redacted]
Owner Key: XTS59EbWFCp7fv5Hyz9R9kkiysXzienVUTHyfNaZiNDiTpYejftfM
Active Key History:
- XTS59EbWFCp7fv5Hyz9R9kkiysXzienVUTHyfNaZiNDiTpYejftfM, last used [redacted]

ID NAME (* next in line) APPROVAL PRODUCED MISSED RELIABILITY PAY RATE PAY BALANCE LAST BLOCK
============================================================================================================================
103 testaccount1.parent 0.0000000000 % 0 0 N/A 100 % 0.00000 XTS NONE

default (unlocked) >>> blockchain_get_account testaccount2.parent
Name: testaccount2.parent
Registered: [redacted]
Last Updated: [redacted]
Owner Key: XTS5iThXoJbP9rnNsP83W9u7FzrinCCdV39PsgfQv1CNznBKqK1bg
Active Key History:
- XTS5iThXoJbP9rnNsP83W9u7FzrinCCdV39PsgfQv1CNznBKqK1bg, last used [redacted]

ID NAME (* next in line) APPROVAL PRODUCED MISSED RELIABILITY PAY RATE PAY BALANCE LAST BLOCK
============================================================================================================================
104 testaccount2.parent 0.0000000000 % 0 0 N/A 100 % 0.00000 XTS NONE

default (unlocked) >>> blockchain_get_account testaccount3.parent
Name: testaccount3.parent
Registered: [redacted]
Last Updated: [redacted]
Owner Key: XTS6gMFVtK34mYn7T7iGCWZJVT2Q4r7Vr2Tb8GHTnBrpgTBa9U87m
Active Key History:
- XTS6gMFVtK34mYn7T7iGCWZJVT2Q4r7Vr2Tb8GHTnBrpgTBa9U87m, last used [redacted]

ID NAME (* next in line) APPROVAL PRODUCED MISSED RELIABILITY PAY RATE PAY BALANCE LAST BLOCK
============================================================================================================================
105 testaccount3.parent 0.0000000000 % 0 0 N/A 100 % 0.00000 XTS NONE

default (unlocked) >>> blockchain_get_account test1.testaccount1.parent
Name: test1.testaccount1.parent
Registered: [redacted]
Last Updated: [redacted]
Owner Key: XTS5muxe9bjq7GCmxwMGdXCPhtX6XagLmAq5EDCbLWbpPjk6XLxbn
Active Key History:
- XTS5muxe9bjq7GCmxwMGdXCPhtX6XagLmAq5EDCbLWbpPjk6XLxbn, last used [redacted]

ID NAME (* next in line) APPROVAL PRODUCED MISSED RELIABILITY PAY RATE PAY BALANCE LAST BLOCK
============================================================================================================================
106 test1.testaccount1.parent 0.0000000000 % 0 0 N/A 100 % 0.00000 XTS NONE

default (unlocked) >>> blockchain_get_account test2.testaccount1.parent
Name: test2.testaccount1.parent
Registered: [redacted]
Last Updated: [redacted]
Owner Key: XTS6ML8aX5VuMwrGTypcUCQUw1Xeo2AxudDmKUWc9KAb3hqoFRZQc
Active Key History:
- XTS6ML8aX5VuMwrGTypcUCQUw1Xeo2AxudDmKUWc9KAb3hqoFRZQc, last used [redacted]

ID NAME (* next in line) APPROVAL PRODUCED MISSED RELIABILITY PAY RATE PAY BALANCE LAST BLOCK
============================================================================================================================
107 test2.testaccount1.parent 0.0000000000 % 0 0 N/A 100 % 0.00000 XTS NONE

default (unlocked) >>> blockchain_get_account unregaccount
No account found.
default (unlocked) >>> blockchain_get_account accwithoutregparent.unregaccount
No account found.
default (unlocked) >>> quit
1 change: 1 addition & 0 deletions tests/regression_tests/parent_child_account/test.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client --input-log=../_common_logs/create_and_unlock_wallet.log --input-log=../_common_logs/import_delegate_keys.log --input-log=../_common_logs/enable_delegates.log --input-log=parent_child_account.log
1 change: 1 addition & 0 deletions tests/regression_tests/wallet_get_account/test.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client --input-log=../_common_logs/initialize_simulated_time.log --input-log=../_common_logs/create_and_unlock_wallet.log --input-log=../_common_logs/import_delegate_keys.log --input-log=../_common_logs/enable_delegates.log --input-log=wallet_get_account.log
162 changes: 162 additions & 0 deletions tests/regression_tests/wallet_get_account/wallet_get_account.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
default (unlocked) >>> debug_filter_output_for_tests true
OK
default (unlocked) >>> help wallet_get_account
Usage:
wallet_get_account <account_name> Get the account record for a given name
Get the account record for a given name

Parameters:
account_name (account_name, required): the name of the account to retrieve

Returns:
wallet_account_record
default (unlocked) >>> wallet_account_create testaccount
"XTS5drpKagoTFiMsg1urDXvrtY7Fkuyb4vkgBUCxrsnrer8ioRGrp"
default (unlocked) >>> wallet_get_account delegate0
{
"index": 7,
"id": 1,
"name": "delegate0",
"public_data": null,
"owner_key": "XTS7YuLaRgMynXGj5kC4xQnmjLCsfa5dd7oAjHEVrvJJCeNyqmf5Z",
"active_key_history": [[
"20140620T144027",
"XTS7YuLaRgMynXGj5kC4xQnmjLCsfa5dd7oAjHEVrvJJCeNyqmf5Z"
]
],
"registration_date": "20140620T144027",
"last_update": "20140620T144027",
"delegate_info": {
"votes_for": 0,
"blocks_produced": 0,
"blocks_missed": 0,
"pay_rate": 100,
"pay_balance": 0,
"next_secret_hash": "0000000000000000000000000000000000000000",
"last_block_num_produced": 0
},
"meta_data": null,
"account_address": "XTSDG4CLPoePEPHaRaDszT4ix8gA1ghTb6FF",
"private_data": null,
"is_my_account": true,
"approved": 0,
"is_favorite": false,
"block_production_enabled": true
}
default (unlocked) >>> wallet_get_account delegate1
{
"index": 9,
"id": 2,
"name": "delegate1",
"public_data": null,
"owner_key": "XTS7gEAmuw9tvjLnZcEpGtPfseYZ53QDHnaRuqPkSCYfprakYVg54",
"active_key_history": [[
"20140620T144027",
"XTS7gEAmuw9tvjLnZcEpGtPfseYZ53QDHnaRuqPkSCYfprakYVg54"
]
],
"registration_date": "20140620T144027",
"last_update": "20140620T144027",
"delegate_info": {
"votes_for": 0,
"blocks_produced": 0,
"blocks_missed": 0,
"pay_rate": 100,
"pay_balance": 0,
"next_secret_hash": "0000000000000000000000000000000000000000",
"last_block_num_produced": 0
},
"meta_data": null,
"account_address": "XTSG1WQZ6JPbDfsZB72btAPZ37UjpxW8wU6D",
"private_data": null,
"is_my_account": true,
"approved": 0,
"is_favorite": false,
"block_production_enabled": true
}
default (unlocked) >>> wallet_get_account delegate2
{
"index": 11,
"id": 3,
"name": "delegate2",
"public_data": null,
"owner_key": "XTS6dvBki8EnzCY796an4p2DTwA5bqyrY2xHH9nm9rQVALGgFdn33",
"active_key_history": [[
"20140620T144027",
"XTS6dvBki8EnzCY796an4p2DTwA5bqyrY2xHH9nm9rQVALGgFdn33"
]
],
"registration_date": "20140620T144027",
"last_update": "20140620T144027",
"delegate_info": {
"votes_for": 0,
"blocks_produced": 0,
"blocks_missed": 0,
"pay_rate": 100,
"pay_balance": 0,
"next_secret_hash": "0000000000000000000000000000000000000000",
"last_block_num_produced": 0
},
"meta_data": null,
"account_address": "XTSHxAqiK4EwK34gF5yZDeJKYTFh1kdHbfiY",
"private_data": null,
"is_my_account": true,
"approved": 0,
"is_favorite": false,
"block_production_enabled": true
}
default (unlocked) >>> wallet_get_account delegate3
{
"index": 13,
"id": 4,
"name": "delegate3",
"public_data": null,
"owner_key": "XTS68Km5oZbn7VzcfrUQb2xncQYq76RXiymmdA51i7MdBMJdY1vKU",
"active_key_history": [[
"20140620T144027",
"XTS68Km5oZbn7VzcfrUQb2xncQYq76RXiymmdA51i7MdBMJdY1vKU"
]
],
"registration_date": "20140620T144027",
"last_update": "20140620T144027",
"delegate_info": {
"votes_for": 0,
"blocks_produced": 0,
"blocks_missed": 0,
"pay_rate": 100,
"pay_balance": 0,
"next_secret_hash": "0000000000000000000000000000000000000000",
"last_block_num_produced": 0
},
"meta_data": null,
"account_address": "XTS6Q8ZUzbg3uon7GSWdTS6Rh87ybt37q85M",
"private_data": null,
"is_my_account": true,
"approved": 0,
"is_favorite": false,
"block_production_enabled": true
}
default (unlocked) >>> wallet_get_account testaccount
{
"index": 413,
"id": 0,
"name": "testaccount",
"public_data": null,
"owner_key": "XTS5drpKagoTFiMsg1urDXvrtY7Fkuyb4vkgBUCxrsnrer8ioRGrp",
"active_key_history": [[
"20140620T144030",
"XTS5drpKagoTFiMsg1urDXvrtY7Fkuyb4vkgBUCxrsnrer8ioRGrp"
]
],
"registration_date": "19700101T000000",
"last_update": "19700101T000000",
"delegate_info": null,
"meta_data": null,
"account_address": "XTSARPTJnYCLHscfB56Fx5ewr6bsPmwPwecu",
"private_data": null,
"is_my_account": true,
"approved": 0,
"is_favorite": false,
"block_production_enabled": false
}
default (unlocked) >>> quit

0 comments on commit 4bc1e18

Please sign in to comment.