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

Merge release to master for 3.1.0 #1761

Merged
merged 199 commits into from
May 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
e90e9b1
#867, Add CLI command to add signatures to a partially signed transac…
windycrypto May 30, 2018
c170491
add offline transaction signing method
windycrypto Jun 3, 2018
1b29437
rough implementation of multi-sig transaction
windycrypto Jun 7, 2018
a218ef6
make filename optional on multisig_mode command
windycrypto Jun 7, 2018
dcd7150
validate TaPoS and expiration field for imported transaction
windycrypto Jun 7, 2018
47569a0
simplify implementation according to Peter's reviews
windycrypto Jun 12, 2018
dc265ab
make variable name clearer
windycrypto Jun 13, 2018
efff736
simplify again according to Peter's reviews
windycrypto Jun 13, 2018
c4d598e
correct grammer and revert unrelated code style changes
windycrypto Jun 13, 2018
c0207fc
validate TaPoS and expiration field and change error level so looks m…
windycrypto Jun 13, 2018
4a10ecc
#867, Add CLI command to add signatures to a partially signed transac…
windycrypto May 30, 2018
7cb7519
add offline transaction signing method
windycrypto Jun 3, 2018
8652bd3
rough implementation of multi-sig transaction
windycrypto Jun 7, 2018
35597c9
make filename optional on multisig_mode command
windycrypto Jun 7, 2018
a616f51
validate TaPoS and expiration field for imported transaction
windycrypto Jun 7, 2018
0ccf3e7
simplify implementation according to Peter's reviews
windycrypto Jun 12, 2018
c27c975
make variable name clearer
windycrypto Jun 13, 2018
8e99d7c
simplify again according to Peter's reviews
windycrypto Jun 13, 2018
8074954
correct grammer and revert unrelated code style changes
windycrypto Jun 13, 2018
e099865
validate TaPoS and expiration field and change error level so looks m…
windycrypto Jun 13, 2018
0c2a7dd
Add test cases and remove unneeded field check
windycrypto Jun 16, 2018
edf3291
partially updated per to Peter's review
windycrypto Jun 18, 2018
5ad1612
fixed the logic of wether a private key had signed the transaction
windycrypto Jun 19, 2018
777cf13
use private keys in wallet instead of param list and fill TaPoS/expir…
windycrypto Jun 22, 2018
3a39938
extend expiration and remove dupe check
windycrypto Jun 24, 2018
f61cb75
get max transaction expiration time from global property object
windycrypto Jul 22, 2018
0a30317
fix transaction expiration to absolute time from now
windycrypto Jul 24, 2018
3ca48dd
Merge branch 'issue867' of https://github.com/cifer-lee/bitshares-cor…
windycrypto Oct 9, 2018
6cf8fed
refactor redundent codes and change name to sign_transaction2
windycrypto Oct 9, 2018
cb5250f
Merge pull request #1 from bitshares/develop
manikey123 Dec 20, 2018
a4afb7c
Merge pull request #2 from bitshares/develop
manikey123 Jan 4, 2019
a22e850
added test case for 782 part1
manikey123 Jan 4, 2019
aa8d430
handle_message overrides node::handle_message
jmjatlanta Jan 7, 2019
f5237f9
class forward declared as struct
jmjatlanta Jan 7, 2019
3019bfc
no virtual destructor in class with virt methods
jmjatlanta Jan 7, 2019
b4195aa
Update history_api_tests.cpp
manikey123 Jan 8, 2019
7a88dff
add virtual destructors to classes derived from transaction
jmjatlanta Jan 8, 2019
961c4f9
template specialization for fee_schedule
jmjatlanta Jan 8, 2019
86568a5
Revert "template specialization for fee_schedule"
jmjatlanta Jan 8, 2019
1829a9a
updated based on review comment received
manikey123 Jan 9, 2019
d66f15b
updated based on review comment received1
manikey123 Jan 9, 2019
ab7b44a
Update history_api_tests.cpp
manikey123 Jan 9, 2019
c3db2db
Update application.cpp
manikey123 Jan 9, 2019
43a743b
updating uint64_t
manikey123 Jan 9, 2019
9a9a8f8
782 pt 1 and 2
manikey123 Jan 13, 2019
3aecf1f
782 pt 1 and 2 edit
manikey123 Jan 13, 2019
a724f9d
Merge pull request #3 from bitshares/develop
manikey123 Jan 15, 2019
3066629
782 chnages based on review comments
manikey123 Jan 15, 2019
9d6b06f
782 changes based on travis build and review comments
manikey123 Jan 15, 2019
884a6b4
782 changes based on travis build and review comments
manikey123 Jan 15, 2019
f6f6cde
Update group_order_api_tests.cpp
manikey123 Jan 15, 2019
f85b46d
Update api.hpp
manikey123 Jan 15, 2019
8d59ea3
782 changes based on get_key_references
manikey123 Jan 15, 2019
f928f90
Update application.hpp
manikey123 Jan 15, 2019
097a8e6
changes for 782 to correct spacing issue
manikey123 Jan 15, 2019
782bbba
Merge branch '782_test_p1' of https://github.com/manikey123/bitshares…
manikey123 Jan 15, 2019
ba3a895
Update database_api_tests.cpp
manikey123 Jan 15, 2019
11df989
replace smart_ref with shared_ptr
jmjatlanta Feb 1, 2019
64adf4b
Permit proper copy and move
jmjatlanta Feb 5, 2019
8610119
Merge branch 'develop' into jmj_1548
jmjatlanta Feb 5, 2019
39e6793
revert unnecessary changes to fee_schedule
jmjatlanta Feb 5, 2019
49b6adb
Merge branch 'jmj_1548' of ssh://github.com/bitshares/bitshares-core …
jmjatlanta Feb 5, 2019
640253d
use move instead of assign
jmjatlanta Feb 5, 2019
2e708c1
remove last reference to smart_ref
jmjatlanta Feb 15, 2019
f32b981
Resolve #1591: Relocate genesis and add dev genesis
nathanielhourt Feb 15, 2019
e3a3f25
Fix issues according to review comments
Feb 16, 2019
ba463f1
Merge branch 'develop' into issue867
Feb 16, 2019
24f0827
bump fc
oxarbitrage Feb 16, 2019
34c5ad3
Merge pull request #1556 from bitshares/jmj_1548
jmjatlanta Feb 18, 2019
695f34b
Fix compiler warnings
abitmore Feb 16, 2019
35ef375
Merge pull request #1596 from oxarbitrage/bumpfc_websocket
oxarbitrage Feb 18, 2019
ad74de4
Merge pull request #1597 from bitshares/abitmore-patch-1
oxarbitrage Feb 18, 2019
d8999d9
Prove owner->active delegation as discussed in https://github.com/bit…
pmconrad Feb 18, 2019
7a45e60
Convert .txt to .md
nathanielhourt Feb 19, 2019
c337cfe
Merge pull request #1601 from pmconrad/bsips_94
pmconrad Feb 20, 2019
ef2d563
Merge pull request #1592 from nathanhourt/genesis-dev
nathanielhourt Feb 20, 2019
f561563
Improve performance of markets
nathanielhourt Feb 22, 2019
bf60ddd
Merge pull request #1608 from nathanhourt/market-performance
oxarbitrage Feb 22, 2019
38d5d41
Remove unused .hf files
jmjatlanta Feb 22, 2019
39b768e
Removal of hardfork 23
jmjatlanta Feb 22, 2019
bea8ca0
Removal of hf 413
jmjatlanta Feb 22, 2019
cc3e519
Removal of hf 415
jmjatlanta Feb 22, 2019
1c50372
Removal of hf 419
jmjatlanta Feb 22, 2019
bc9f1d9
Removal of hf 538
jmjatlanta Feb 22, 2019
06e66be
Removal of hf 599
jmjatlanta Feb 22, 2019
b20ff25
Removal of hf 188
jmjatlanta Feb 22, 2019
a91f470
Removal of hf 620
jmjatlanta Feb 22, 2019
ac14e34
Removal of hf 942
jmjatlanta Feb 22, 2019
1b140d2
Fixed saving keys in wallet
anzhy-chernyavski Feb 25, 2019
68d3e0b
Added test.
anzhy-chernyavski Feb 27, 2019
cf37742
Slightly improve limit order creation performance
abitmore Feb 27, 2019
fe510a2
Merge pull request #1621 from bitshares/abitmore-patch-1
abitmore Feb 27, 2019
6581394
Add sleep to cli_test
abitmore Feb 27, 2019
7de4817
Remove trailing whitespaces in cli_test
abitmore Feb 28, 2019
53cf53e
Update coding style
abitmore Feb 28, 2019
91a89a1
fc commit changed
anzhy-chernyavski Feb 28, 2019
9807741
Removed initial_chain_id from example genesis file to avoid confusion
pmconrad Mar 1, 2019
458beae
Merge pull request #1626 from bitshares/1303-cli-test-issues
abitmore Mar 4, 2019
3cd75ae
Merge pull request #1613 from pixelplex/fixed-saving-keys-wallet
abitmore Mar 4, 2019
26ffeef
Merge branch 'develop' into issue867
Mar 4, 2019
fa38ee4
Skip trx size check on replay
jmjatlanta Mar 4, 2019
5c7d538
Prevent Boost/WinSock.h multiple inclusion
jmjatlanta Mar 5, 2019
d3794a6
Fix uin64_t / safe<int64_t> comparision
jmjatlanta Mar 5, 2019
a328f8c
Merge pull request #1633 from bitshares/jmj_winbuildfix
jmjatlanta Mar 5, 2019
a710a42
Merge pull request #1634 from bitshares/release
oxarbitrage Mar 5, 2019
8d1260d
Added new commands to CLI: get_transaction_signers, get_key_references
OpenLedgerApp Mar 6, 2019
90ca8f2
Merge pull request #1628 from pmconrad/1069_remove_chain_id
pmconrad Mar 8, 2019
0c5a42f
Add plugin section headers to generated config.ini
abitmore Mar 9, 2019
9c47bbd
Highlight plugin section headers in config.ini
abitmore Mar 9, 2019
a91b447
Merge pull request #1641 from bitshares/1407-plugin-header
oxarbitrage Mar 10, 2019
1edab9d
Avoid segfault in CLI bid_collateral command
xuquan316 Dec 28, 2018
40d4b0b
remove comments and change error message.
xuquan316 Jan 2, 2019
42c19fa
Merge pull request #1649 from bitshares/cli-bid-collateral-error
abitmore Mar 13, 2019
5162ebe
Merge pull request #1515 from bitshares/jmj_macwarn
abitmore Mar 13, 2019
de31b56
Merge pull request #1032 from cifer-lee/issue867
abitmore Mar 13, 2019
a4108e0
Update as per the review comments 1513
manikey123 Jan 15, 2019
3014c38
Merge branch 'develop' into 782_test_p1
manikey123 Mar 18, 2019
df514ac
Update asset_api_tests.cpp
manikey123 Mar 18, 2019
c078ffb
Improve fee_schedule::calculate_fee() performance
abitmore Mar 18, 2019
78cb2c7
updated api.cpp for build failures
manikey123 Mar 19, 2019
6afb647
Merge branch 'develop' into issue-1210
OpenLedgerApp Mar 19, 2019
ae78c2d
Merge pull request #1513 from manikey123/782_test_p1
pmconrad Mar 20, 2019
5e6e9a1
Merge pull request #1662 from bitshares/performance-calculate-fee
abitmore Mar 22, 2019
54d2596
change info output participation to int
oxarbitrage Mar 22, 2019
468af90
add unit tests for get_signed_transaction_signers, get_key_references
Mar 22, 2019
205f3a3
set participation to fixed 2 decimals
oxarbitrage Mar 23, 2019
a411589
Merge pull request #1666 from bitshares/oxarbitrage-patch-1
oxarbitrage Mar 24, 2019
80a9f9f
reduce precision of numbers in replay output
oxarbitrage Mar 24, 2019
4d5c02a
Fix some warnings
nathanielhourt Mar 25, 2019
5dad10c
Merge pull request #1 from openledger/issue-1210-core-912
OpenLedgerApp Mar 25, 2019
392ac40
Merge pull request #1674 from bitshares/replay-perc-numbers
oxarbitrage Mar 25, 2019
b96cc0c
Merge pull request #1677 from nathanhourt/warnings
nathanielhourt Mar 25, 2019
f03c207
Apply deterministic virtual_op numbering rule
abitmore Mar 24, 2019
f9b7460
change BTS-symbol to 1.3.0
Mar 26, 2019
ed08580
Merge pull request #1635 from openledger/issue-1210
pmconrad Mar 27, 2019
ff004b4
change indentation in quit command
oxarbitrage Mar 28, 2019
fb657f6
Fix conflicts merging release to develop
jmjatlanta Mar 28, 2019
b225f96
Final cr/lf
jmjatlanta Mar 28, 2019
1abddf9
Merge pull request #1684 from bitshares/oxarbitrage-patch-1
oxarbitrage Mar 28, 2019
f74f450
Merge pull request #1686 from bitshares/jmj_release_develop
jmjatlanta Mar 29, 2019
c8ce31a
fix referencing local stack variable in async thread
crypto-ape Apr 2, 2019
376f031
explicitly cleanup external library facilities
crypto-ape Apr 2, 2019
53af67e
fix referencing local stack variable in async thread // add missing p…
crypto-ape Apr 2, 2019
3ab22f6
fix referencing local stack variable in async thread // capture share…
crypto-ape Apr 2, 2019
da6c386
Merge branch 'develop' into vop-numbering
abitmore Apr 3, 2019
441e290
Improve the serializer to fix #1701
xeroc Apr 5, 2019
96dca2c
More fixes for formatting
xeroc Apr 5, 2019
95532b3
Resolve #1670: Make const const again
nathanielhourt Mar 23, 2019
b7a2a7b
Ref #1670: Rename non-const getter for clarity
nathanielhourt Mar 25, 2019
51875b0
Update fc submodule
nathanielhourt Mar 25, 2019
94e3aac
Minor style change
nathanielhourt Apr 7, 2019
159a0cc
Ref #1670: Fix build against latest develop
nathanielhourt Apr 9, 2019
e44cd00
Merge pull request #1678 from nathanhourt/issue-1670
pmconrad Apr 10, 2019
860d241
Merge pull request #1676 from bitshares/vop-numbering
pmconrad Apr 10, 2019
421a2dd
Merge pull request #1693 from crypto-ape/valgrind-inspired-fixes
pmconrad Apr 10, 2019
14a6c2a
Merge pull request #1712 from bitshares/release
abitmore Apr 10, 2019
fc2e12a
fix Windows build errors
jmjatlanta Apr 5, 2019
5aaee56
Bump FC
jmjatlanta Apr 8, 2019
5563cd4
Merge pull request #1716 from bitshares/jmj_1619
jmjatlanta Apr 12, 2019
9b867b5
add genesis data to es_objects
oxarbitrage Apr 12, 2019
0a9d223
Fix conflict with hf1268 and removal of hf620
jmjatlanta Apr 12, 2019
38e0a26
replace block1 with head block, change help string
oxarbitrage Apr 13, 2019
168c27b
Added unit test to reproduce the problem
pmconrad Apr 13, 2019
8ef5635
Fixed #1719
pmconrad Apr 13, 2019
7897234
Merge pull request #1720 from bitshares/1719_required_approvals
pmconrad Apr 14, 2019
299e600
Fix warning
nathanielhourt Apr 14, 2019
0119a1d
Fix warning
nathanielhourt Apr 14, 2019
49382ea
Fix yet another warning
nathanielhourt Apr 14, 2019
c6f4799
Merge pull request #1721 from nathanhourt/develop
oxarbitrage Apr 15, 2019
28a0d08
Cleanup of some (not all) hf_199
jmjatlanta Apr 15, 2019
da6337d
removal of hf834
jmjatlanta Apr 16, 2019
db2795d
Fix comment for hf583
jmjatlanta Apr 16, 2019
b766f94
Fix unit test for HF199
jmjatlanta Apr 17, 2019
5c2692d
apply genesis() in applied_block at block 1
oxarbitrage Apr 17, 2019
cf476df
fixed test for HF834
jmjatlanta Apr 17, 2019
2c2eafd
remove es-objects-load-genesis option
oxarbitrage Apr 18, 2019
f7ae095
remove _es_objects_load_genesis
oxarbitrage Apr 18, 2019
88701ad
capture only this in applied block lambda
oxarbitrage Apr 20, 2019
ba328d3
capture only this in other connection lambdas
oxarbitrage Apr 20, 2019
c61c01d
add htlc api calls
oxarbitrage Apr 22, 2019
47b4082
Merge pull request #1717 from oxarbitrage/issue1652
oxarbitrage Apr 23, 2019
8cbd15a
install debug_witness headers
xloem Apr 21, 2019
85beeb3
Added missing reflection for proposal_object.fail_reason
pmconrad Apr 23, 2019
5de27ca
Merge pull request #1732 from pmconrad/1730_reflect_fail_reason
pmconrad Apr 25, 2019
d740d32
Fix warning
nathanielhourt Apr 26, 2019
7639430
Merge pull request #1736 from bitshares/nh-patch-warning
abitmore Apr 27, 2019
79ff42e
Removed unused header file
pmconrad Apr 28, 2019
254da1b
Merge pull request #1740 from pmconrad/1219_remove_fwd
abitmore Apr 28, 2019
febebff
Merge pull request #1702 from bitshares/1701-improve-serializer
pmconrad Apr 29, 2019
b86db3b
Fixed regression in #1702 - removed obsolete smart_ref
pmconrad Apr 29, 2019
a9333e7
Merge pull request #1741 from pmconrad/1702_regression
jmjatlanta Apr 29, 2019
7ad8447
Merge pull request #1718 from bitshares/jmj_1553b
jmjatlanta Apr 29, 2019
e710483
Merge pull request #1704 from bitshares/jmj_1593
jmjatlanta Apr 29, 2019
f1ce877
Merge pull request #1727 from xloem/debug-header-install
pmconrad Apr 29, 2019
f3365af
Merge branch 'issue1713' of https://github.com/oxarbitrage/bitshares-…
jmjatlanta Apr 29, 2019
91f3fa2
fixed typos, added from to get_full_accounts
jmjatlanta Apr 29, 2019
c699538
Make get_htlc_by_x return size limits configurable
jmjatlanta Apr 29, 2019
7a6f442
verify correct collection in test
jmjatlanta Apr 30, 2019
c737ea5
Merge pull request #1742 from bitshares/jmj_1713
jmjatlanta Apr 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endif()
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(GRAPHENE_EGENESIS_JSON "${CMAKE_CURRENT_SOURCE_DIR}/genesis.json" )
set(GRAPHENE_EGENESIS_JSON "${CMAKE_CURRENT_SOURCE_DIR}/libraries/egenesis/genesis.json" )

#set (ENABLE_INSTALLER 1)
#set (USE_PCH 1)
Expand Down Expand Up @@ -80,6 +80,7 @@ if( WIN32 )
set(CRYPTO_LIB)

if( MSVC )
add_definitions(-DWIN32_LEAN_AND_MEAN)
#looks like this flag can have different default on some machines.
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
Expand Down
30 changes: 16 additions & 14 deletions libraries/app/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ namespace graphene { namespace app {
{
FC_ASSERT( _app.chain_database() );
const auto& db = *_app.chain_database();
FC_ASSERT( limit <= 100 );
uint64_t api_limit_get_account_history=_app.get_options().api_limit_get_account_history;
FC_ASSERT( limit <= api_limit_get_account_history );
vector<operation_history_object> result;
account_id_type account;
try {
Expand Down Expand Up @@ -353,7 +354,8 @@ namespace graphene { namespace app {
{
FC_ASSERT( _app.chain_database() );
const auto& db = *_app.chain_database();
FC_ASSERT( limit <= 100 );
uint64_t api_limit_get_account_history_operations=_app.get_options().api_limit_get_account_history_operations;
FC_ASSERT(limit <= api_limit_get_account_history_operations);
vector<operation_history_object> result;
account_id_type account;
try {
Expand Down Expand Up @@ -392,7 +394,8 @@ namespace graphene { namespace app {
{
FC_ASSERT( _app.chain_database() );
const auto& db = *_app.chain_database();
FC_ASSERT(limit <= 100);
uint64_t api_limit_get_relative_account_history=_app.get_options().api_limit_get_relative_account_history;
FC_ASSERT(limit <= api_limit_get_relative_account_history);
vector<operation_history_object> result;
account_id_type account;
try {
Expand Down Expand Up @@ -431,7 +434,8 @@ namespace graphene { namespace app {

history_operation_detail history_api::get_account_history_by_operations(const std::string account_id_or_name, vector<uint16_t> operation_types, uint32_t start, unsigned limit)
{
FC_ASSERT(limit <= 100);
uint64_t api_limit_get_account_history_by_operations=_app.get_options().api_limit_get_account_history_by_operations;
FC_ASSERT(limit <= api_limit_get_account_history_by_operations);
history_operation_detail result;
vector<operation_history_object> objs = get_relative_account_history(account_id_or_name, start, limit, limit + start - 1);
std::for_each(objs.begin(), objs.end(), [&](const operation_history_object &o) {
Expand Down Expand Up @@ -530,16 +534,16 @@ namespace graphene { namespace app {

// asset_api
asset_api::asset_api(graphene::app::application& app) :
_db( *app.chain_database()),
database_api( std::ref(*app.chain_database()), &(app.get_options())
_app(app),
_db( *app.chain_database()),
database_api( std::ref(*app.chain_database()), &(app.get_options())
) { }
asset_api::~asset_api() { }

vector<account_asset_balance> asset_api::get_asset_holders( std::string asset, uint32_t start, uint32_t limit ) const {
FC_ASSERT(limit <= 100);

uint64_t api_limit_get_asset_holders=_app.get_options().api_limit_get_asset_holders;
FC_ASSERT(limit <= api_limit_get_asset_holders);
asset_id_type asset_id = database_api.get_asset_id_from_string( asset );

const auto& bal_idx = _db.get_index_type< account_balance_index >().indices().get< by_asset_balance >();
auto range = bal_idx.equal_range( boost::make_tuple( asset_id ) );

Expand Down Expand Up @@ -571,7 +575,6 @@ namespace graphene { namespace app {
}
// get number of asset holders.
int asset_api::get_asset_holders_count( std::string asset ) const {

const auto& bal_idx = _db.get_index_type< account_balance_index >().indices().get< by_asset_balance >();
asset_id_type asset_id = database_api.get_asset_id_from_string( asset );
auto range = bal_idx.equal_range( boost::make_tuple( asset_id ) );
Expand All @@ -582,9 +585,7 @@ namespace graphene { namespace app {
}
// function to get vector of system assets with holders count.
vector<asset_holders> asset_api::get_all_asset_holders() const {

vector<asset_holders> result;

vector<asset_id_type> total_assets;
for( const asset_object& asset_obj : _db.get_index_type<asset_index>().indices() )
{
Expand Down Expand Up @@ -622,8 +623,9 @@ namespace graphene { namespace app {
optional<price> start,
uint32_t limit )const
{
FC_ASSERT( limit <= 101 );
auto plugin = _app.get_plugin<grouped_orders_plugin>( "grouped_orders" );
uint64_t api_limit_get_grouped_limit_orders=_app.get_options().api_limit_get_grouped_limit_orders;
FC_ASSERT( limit <= api_limit_get_grouped_limit_orders );
auto plugin = _app.get_plugin<graphene::grouped_orders::grouped_orders_plugin>( "grouped_orders" );
FC_ASSERT( plugin );
const auto& limit_groups = plugin->limit_order_groups();
vector< limit_order_group > result;
Expand Down
59 changes: 58 additions & 1 deletion libraries/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace detail {
auto nathan_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan")));
dlog("Allocating all stake to ${key}", ("key", utilities::key_to_wif(nathan_key)));
graphene::chain::genesis_state_type initial_state;
initial_state.initial_parameters.current_fees = fee_schedule::get_default();//->set_all_fees(GRAPHENE_BLOCKCHAIN_PRECISION);
initial_state.initial_parameters.get_mutable_fees() = fee_schedule::get_default();
initial_state.initial_active_witnesses = GRAPHENE_DEFAULT_MIN_WITNESS_COUNT;
initial_state.initial_timestamp = time_point_sec(time_point::now().sec_since_epoch() /
initial_state.initial_parameters.block_interval *
Expand Down Expand Up @@ -316,6 +316,35 @@ void application_impl::set_dbg_init_key( graphene::chain::genesis_state_type& ge
genesis.initial_witness_candidates[i].block_signing_key = init_pubkey;
}



void application_impl::set_api_limit() {
if (_options->count("api-limit-get-account-history-operations")) {
_app_options.api_limit_get_account_history_operations = _options->at("api-limit-get-account-history-operations").as<uint64_t>();
}
if(_options->count("api-limit-get-account-history")){
_app_options.api_limit_get_account_history = _options->at("api-limit-get-account-history").as<uint64_t>();
}
if(_options->count("api-limit-get-grouped-limit-orders")){
_app_options.api_limit_get_grouped_limit_orders = _options->at("api-limit-get-grouped-limit-orders").as<uint64_t>();
}
if(_options->count("api-limit-get-relative-account-history")){
_app_options.api_limit_get_relative_account_history = _options->at("api-limit-get-relative-account-history").as<uint64_t>();
}
if(_options->count("api-limit-get-account-history-by-operations")){
_app_options.api_limit_get_account_history_by_operations = _options->at("api-limit-get-account-history-by-operations").as<uint64_t>();
}
if(_options->count("api-limit-get-asset-holders")){
_app_options.api_limit_get_asset_holders = _options->at("api-limit-get-asset-holders").as<uint64_t>();
}
if(_options->count("api-limit-get-key-references")){
_app_options.api_limit_get_key_references = _options->at("api-limit-get-key-references").as<uint64_t>();
}
if(_options->count("api-limit-get-htlc-by")) {
_app_options.api_limit_get_htlc_by = _options->at("api-limit-get-htlc-by").as<uint64_t>();
}
}

void application_impl::startup()
{ try {
fc::create_directories(_data_dir / "blockchain");
Expand Down Expand Up @@ -437,6 +466,8 @@ void application_impl::startup()
if ( _options->count("enable-subscribe-to-all") )
_app_options.enable_subscribe_to_all = _options->at( "enable-subscribe-to-all" ).as<bool>();

set_api_limit();

if( _active_plugins.find( "market_history" ) != _active_plugins.end() )
_app_options.has_market_history_plugin = true;

Expand Down Expand Up @@ -975,6 +1006,20 @@ void application::set_program_options(boost::program_options::options_descriptio
("enable-standby-votes-tracking", bpo::value<bool>()->implicit_value(true),
"Whether to enable tracking of votes of standby witnesses and committee members. "
"Set it to true to provide accurate data to API clients, set to false for slightly better performance.")
("api-limit-get-account-history-operations",boost::program_options::value<uint64_t>()->default_value(100),
"For history_api::get_account_history_operations to set its default limit value as 100")
("api-limit-get-account-history",boost::program_options::value<uint64_t>()->default_value(100),
"For history_api::get_account_history to set its default limit value as 100")
("api-limit-get-grouped-limit-orders",boost::program_options::value<uint64_t>()->default_value(101),
"For orders_api::get_grouped_limit_orders to set its default limit value as 101")
("api-limit-get-relative-account-history",boost::program_options::value<uint64_t>()->default_value(100),
"For history_api::get_relative_account_history to set its default limit value as 100")
("api-limit-get-account-history-by-operations",boost::program_options::value<uint64_t>()->default_value(100),
"For history_api::get_account_history_by_operations to set its default limit value as 100")
("api-limit-get-asset-holders",boost::program_options::value<uint64_t>()->default_value(100),
"For asset_api::get_asset_holders to set its default limit value as 100")
("api-limit-get-key-references",boost::program_options::value<uint64_t>()->default_value(100),
"For database_api_impl::get_key_references to set its default limit value as 100")
;
command_line_options.add(configuration_file_options);
command_line_options.add_options()
Expand Down Expand Up @@ -1014,6 +1059,18 @@ void application::startup()
}
}

void application::set_api_limit()
{
try {
my->set_api_limit();
} catch ( const fc::exception& e ) {
elog( "${e}", ("e",e.to_detail_string()) );
throw;
} catch ( ... ) {
elog( "unexpected exception" );
throw;
}
}
std::shared_ptr<abstract_plugin> application::get_plugin(const string& name) const
{
return my->_active_plugins[name];
Expand Down
3 changes: 2 additions & 1 deletion libraries/app/application_impl.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class application_impl : public net::node_delegate
}

void set_dbg_init_key( graphene::chain::genesis_state_type& genesis, const std::string& init_key );
void set_api_limit();

void startup();

Expand All @@ -66,7 +67,7 @@ class application_impl : public net::node_delegate

virtual void handle_transaction(const graphene::net::trx_message& transaction_message) override;

void handle_message(const graphene::net::message& message_to_process);
void handle_message(const graphene::net::message& message_to_process) override;

bool is_included_block(const graphene::chain::block_id_type& block_id);

Expand Down
15 changes: 15 additions & 0 deletions libraries/app/config_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,22 @@ static void create_new_config_file(const fc::path& config_ini_path, const fc::pa
};
deduplicator dedup(modify_option_defaults);
std::ofstream out_cfg(config_ini_path.preferred_string());
std::string plugin_header_surrounding( 78, '=' );
for( const boost::shared_ptr<bpo::option_description> opt : cfg_options.options() )
{
const boost::shared_ptr<bpo::option_description> od = dedup.next(opt);
if( !od ) continue;

if( od->long_name().find("plugin-cfg-header-") == 0 ) // it's a plugin header
{
out_cfg << "\n";
out_cfg << "# " << plugin_header_surrounding << "\n";
out_cfg << "# " << od->description() << "\n";
out_cfg << "# " << plugin_header_surrounding << "\n";
out_cfg << "\n";
continue;
}

if( !od->description().empty() )
out_cfg << "# " << od->description() << "\n";
boost::any store;
Expand All @@ -284,6 +295,10 @@ static void create_new_config_file(const fc::path& config_ini_path, const fc::pa
}

out_cfg << "\n"
<< "# " << plugin_header_surrounding << "\n"
<< "# logging options\n"
<< "# " << plugin_header_surrounding << "\n"
<< "#\n"
<< "# Logging configuration is loaded from logging.ini by default.\n"
<< "# If logging.ini exists, logging configuration added in this file will be ignored.\n";
out_cfg.close();
Expand Down
89 changes: 87 additions & 2 deletions libraries/app/database_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ class database_api_impl : public std::enable_shared_from_this<database_api_impl>
vector<withdraw_permission_object> get_withdraw_permissions_by_giver(const std::string account_id_or_name, withdraw_permission_id_type start, uint32_t limit)const;
vector<withdraw_permission_object> get_withdraw_permissions_by_recipient(const std::string account_id_or_name, withdraw_permission_id_type start, uint32_t limit)const;

// HTLC
optional<htlc_object> get_htlc(htlc_id_type id) const;
vector<htlc_object> get_htlc_by_from(const std::string account_id_or_name, htlc_id_type start, uint32_t limit) const;
vector<htlc_object> get_htlc_by_to(const std::string account_id_or_name, htlc_id_type start, uint32_t limit) const;

//private:
static string price_to_string( const price& _price, const asset_object& _base, const asset_object& _quote );

Expand Down Expand Up @@ -668,7 +673,6 @@ dynamic_global_property_object database_api_impl::get_dynamic_global_properties(

vector<vector<account_id_type>> database_api::get_key_references( vector<public_key_type> key )const
{
FC_ASSERT(key.size() <= 100, "Number of keys must be 100 or less");
return my->get_key_references( key );
}

Expand All @@ -677,6 +681,8 @@ vector<vector<account_id_type>> database_api::get_key_references( vector<public_
*/
vector<vector<account_id_type>> database_api_impl::get_key_references( vector<public_key_type> keys )const
{
uint64_t api_limit_get_key_references=_app_options->api_limit_get_key_references;
FC_ASSERT(keys.size() <= api_limit_get_key_references);
const auto& idx = _db.get_index_type<account_index>();
const auto& aidx = dynamic_cast<const base_primary_index&>(idx);
const auto& refs = aidx.get_secondary_index<graphene::chain::account_member_index>();
Expand Down Expand Up @@ -968,7 +974,18 @@ std::map<std::string, full_account> database_api_impl::get_full_accounts( const
acnt.withdraws.emplace_back(withdraw);
});


// get htlcs
auto htlc_from_range = _db.get_index_type<htlc_index>().indices().get<by_from_id>().equal_range(account->id);
std::for_each(htlc_from_range.first, htlc_from_range.second,
[&acnt] (const htlc_object& htlc) {
acnt.htlcs.emplace_back(htlc);
});
auto htlc_to_range = _db.get_index_type<htlc_index>().indices().get<by_to_id>().equal_range(account->id);
std::for_each(htlc_to_range.first, htlc_to_range.second,
[&acnt] (const htlc_object& htlc) {
if ( std::find(acnt.htlcs.begin(), acnt.htlcs.end(), htlc) == acnt.htlcs.end() )
acnt.htlcs.emplace_back(htlc);
});
results[account_name_or_id] = acnt;
}
return results;
Expand Down Expand Up @@ -2381,6 +2398,74 @@ vector<withdraw_permission_object> database_api_impl::get_withdraw_permissions_b
return result;
}

//////////////////////////////////////////////////////////////////////
// //
// HTLC //
// //
//////////////////////////////////////////////////////////////////////

optional<htlc_object> database_api::get_htlc(htlc_id_type id)const
{
return my->get_htlc(id);
}

fc::optional<htlc_object> database_api_impl::get_htlc(htlc_id_type id) const
{
auto obj = get_objects( { id }).front();
if ( !obj.is_null() )
{
return fc::optional<htlc_object>(obj.template as<htlc_object>(GRAPHENE_MAX_NESTED_OBJECTS));
}
return fc::optional<htlc_object>();
}

vector<htlc_object> database_api::get_htlc_by_from(const std::string account_id_or_name, htlc_id_type start, uint32_t limit)const
{
return my->get_htlc_by_from(account_id_or_name, start, limit);
}

vector<htlc_object> database_api_impl::get_htlc_by_from(const std::string account_id_or_name, htlc_id_type start, uint32_t limit) const
{
FC_ASSERT( limit <= _app_options->api_limit_get_htlc_by );
vector<htlc_object> result;

const auto& htlc_idx = _db.get_index_type< htlc_index >().indices().get< by_from_id >();
auto htlc_index_end = htlc_idx.end();
const account_id_type account = get_account_from_string(account_id_or_name)->id;
auto htlc_itr = htlc_idx.lower_bound(boost::make_tuple(account, start));

while(htlc_itr != htlc_index_end && htlc_itr->transfer.from == account && result.size() < limit)
{
result.push_back(*htlc_itr);
++htlc_itr;
}
return result;
}

vector<htlc_object> database_api::get_htlc_by_to(const std::string account_id_or_name, htlc_id_type start, uint32_t limit)const
{
return my->get_htlc_by_to(account_id_or_name, start, limit);
}

vector<htlc_object> database_api_impl::get_htlc_by_to(const std::string account_id_or_name, htlc_id_type start, uint32_t limit) const
{

FC_ASSERT( limit <= _app_options->api_limit_get_htlc_by );
vector<htlc_object> result;

const auto& htlc_idx = _db.get_index_type< htlc_index >().indices().get< by_to_id >();
auto htlc_index_end = htlc_idx.end();
const account_id_type account = get_account_from_string(account_id_or_name)->id;
auto htlc_itr = htlc_idx.lower_bound(boost::make_tuple(account, start));

while(htlc_itr != htlc_index_end && htlc_itr->transfer.to == account && result.size() < limit)
{
result.push_back(*htlc_itr);
++htlc_itr;
}
return result;
}

//////////////////////////////////////////////////////////////////////
// //
// Private methods //
Expand Down
1 change: 1 addition & 0 deletions libraries/app/include/graphene/app/api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ namespace graphene { namespace app {
vector<asset_holders> get_all_asset_holders() const;

private:
graphene::app::application& _app;
graphene::chain::database& _db;
graphene::app::database_api database_api;
};
Expand Down
Loading