Compare commits

...

199 commits

Author SHA1 Message Date
sierra19XX
00a6fc8d23 proper init of publick_key 2020-10-22 14:55:37 +00:00
sierra19XX
e23637a01f verify_transaction proper value 2020-10-22 12:02:46 +00:00
sierra19XX
f394b54cdd add safe copy 2020-10-20 06:16:17 +00:00
Serki
e3edce2900 Merge branch 'hotfix/remove_fc_smart_ref' into develop 2020-10-18 23:14:11 +02:00
Serki
a9afe474a2 Gitlab will build Release version only 2020-10-18 23:12:39 +02:00
Serki
854cc412b3 Revert "Gitlab will build Debug and Release versions"
This reverts commit 7a721f8094.
2020-10-18 23:11:26 +02:00
Serki
fd6d910266 Merge branch 'hotfix/remove_fc_smart_ref' into develop 2020-10-18 19:23:03 +02:00
serkixenos
7a721f8094
Gitlab will build Debug and Release versions 2020-10-18 19:18:59 +02:00
Serki
088b07de66 Fix release build on 18.04, fc::smart_ref_* removed 2020-10-18 16:59:59 +02:00
sierra19XX
a20be87337
hotfix - son max count fix (#389)
* hotfix - son max count fix

* init variables
2020-10-13 07:07:57 +11:00
sierra19XX
b31b402fd5
hotfix - chain params variable overflow, rbac hf check (#387) 2020-10-09 23:58:25 +11:00
serkixenos
abe17869f3
Merge beatrice only changes into develop
Merge beatrice only changes into develop
2020-10-05 14:54:05 +02:00
Serki
dcc84aee5b Merge branch 'develop' into merge/develop2beatrice 2020-10-01 15:41:35 +02:00
Serki
7121da7eb5 Merge branch 'develop' of https://github.com/peerplays-network/peerplays into develop 2020-10-01 15:37:23 +02:00
serkixenos
ed44efd19c
Sidechain Operating Node 2020-10-01 15:36:59 +02:00
Serki
cbb8cbe4c2 Fix HF info 2020-10-01 15:28:12 +02:00
Serki
bba9c3ac1d Remove base_uri length checks 2020-10-01 14:21:08 +02:00
Serki
62bea3f9f5 Merge branch 'beatrice' into develop 2020-09-30 18:04:25 +02:00
Serki
64b4b8f622 Fix son_operation_tests/son_pay_test test 2020-09-29 14:09:46 +02:00
Serki
12e07fa7ad Merge branch 'feature/SONs-base' of https://github.com/peerplays-network/peerplays into feature/SONs-base 2020-09-29 13:40:58 +02:00
Serki
e1737053b5 Fix block_tests/maintenance_interval test 2020-09-29 13:40:13 +02:00
serkixenos
808ecf6575 Decrease log level for tests 2020-09-28 13:46:48 +00:00
Serki
3e6c812883 Increase tests log_level, some cleanup 2020-09-25 23:38:06 +02:00
Serki
2582b829ec Add missing break 2020-09-25 21:05:56 +02:00
Serki
c2a3467c02 Align submodule versions 2020-09-25 19:51:05 +02:00
Serki
b43d52312b Fix failing saving_keys_wallet_test 2020-09-24 16:57:19 +02:00
Serki
0359193813 Fix failing saving_keys_wallet_test 2020-09-24 16:56:30 +02:00
Serki
e79995ba69 Cleanup changes for prettier diff 2020-09-23 16:26:51 +02:00
Serki
ec74e7fc21 Merge branch 'develop' into feature/SONs-base 2020-09-23 15:43:28 +02:00
sierra19XX
213a188c46
NFT Permissions (#380)
* Account Roles Permission 1 - Working code with tests

* Account Roles Permission 2 - Add marketplace offer/bid tests

* Account Roles Permission 3 - Add Op check

* Account Roles Permission 4 - Add chain params and limits
2020-09-23 00:26:24 +05:30
Serki
318b992cb2 Cleanup changes for prettier diff 2020-09-22 19:23:16 +02:00
Serki
2264aa0052 Cleanup changes for pretier diff 2020-09-22 18:56:19 +02:00
Serki
c6c26a7d9f Merge branch 'develop' into feature/SONs-base 2020-09-22 18:23:36 +02:00
sierra19XX
c46e899cf4
Fix for custom operation authority checking (BTS Issue #210) (#382)
* Resolve #210: [HF] Check authorities on custom_operation

The required_auths field on custom_operation was being ignored during authority checking. This commit causes it to be checked correctly, and adds a unit test verifying as much.

* Ref #381: Fixes

Build and logic fixes for Pull Request #381

* Ref #381: Fix bad merge

During merge conflict resolution, I accidentally broke custom
authorities. This fixes it.

* compilation fix

Co-authored-by: Nathan Hourt <nathan@followmyvote.com>
2020-09-08 18:05:29 +05:30
Bobinson K B
adb22299d9 Merge branch 'ws-updates' into 'develop'
Ws updates

See merge request PBSA/peerplays!1
2020-08-29 16:27:01 +00:00
blockc p
ae3edc6e27 Ws updates 2020-08-29 16:27:01 +00:00
sierra19XX
bfdecbb49b
Son deposit address enhancements (#362)
* Deposit address enhancements

* fix tests

Co-authored-by: Koneru Satyanarayana <15652887+satyakoneru@users.noreply.github.com>
2020-08-14 19:32:33 +05:30
sierra19XX
ecd14b8329
Peerplays Marketplace + NFT (#367)
* ppy marketplace 1 - add evaluators and objects

* NFT object and basic operations

* ci: update .gitlab-ci.yml

* ci: update .gitlab-ci.yml

* NFT evaluators and basic tests, no evaluator checks

* Evaluator checks in place

* ppy marketplace 2 - batch sale, offer_object escrow

* Database API

* Wallet API

* NFT metadata implemented

* Fix NFT tests

* Database API for NFT metadata and enumerables

* ppy marketplace 4 - Add tests NFT+Marketplace

* ppy marketplace 5 - Add revenue split

* ppy marketplace 6 - Remove unnecessary files

* ppy marketplace 7 - Add db, wallet changes and some NFT fixes

* ppy marketplace 8 - Add pagination for list APIs

* New DB API, list all NFTs, list NFTs by owner

* Marketplace + NFT + RBAC (#368)

* rbac1 - evaluators and op validators added
* rbac2 - op_type hf checks
* rbac3 - tx auth verify changes
* Update .gitlab-ci.yml
* rbac4 - basic op tests
* rbac5 - clear expired and deleted permission linked auths
* rbac6 - more tests
* rbac7 - more tests
* rbac8 - more tests
* rbac9 - wallet and db api changes
* rbac10 - db api changes for required signature fetch
* rbac11 - add db_api tests
* rbac12 - add missing code for key auths

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
Co-authored-by: Roshan Syed <roshan.syed.rs@gmail.com>
Co-authored-by: sierra19XX <15652887+sierra19XX@users.noreply.github.com>

* Fix nft_get_token_uri returning empty string

* Fix nft_mint_evaluator to save token_uri

* Fix cli_wallet to properly pass metadata id for nft_create

* ppy marketplace 9 - FC_REFLECT offer create op

* Add stricter checks to NFTs

* Unlisting offers, add result in offer history object

* Reverting genesis.json wrong commit

* Add non-transferable non-sellable properties to NFTs

* Review comments - change variable names, use scoped enums

* nft_metadata_update changes

* NFT HF checks and op fee addition changes

* NFT make revenue_split integer from double

* revenue_split condition check allow zero or above

Co-authored-by: Srdjan Obucina <obucinac@gmail.com>
Co-authored-by: Roshan Syed <roshan.syed.rs@gmail.com>
Co-authored-by: Satyanarayana Koneru <skoneru@SK-GT.local>
Co-authored-by: obucina <11353193+obucina@users.noreply.github.com>
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-08-10 23:18:47 +10:00
sierra19XX
c36d4c9687
Mainnet chain halt 5050 Issue (#370) 2020-07-30 21:28:27 +10:00
sierra19XX
a5aa7c200d
GPOS2 HF - Handle rolling period on missing blocks (#369) 2020-07-30 21:28:08 +10:00
Roshan Syed
75b87b3c17 chore: updated Dockerfile with dnsutils 2020-07-16 19:16:40 +00:00
Roshan Syed
490a332db1 ci: update .gitlab-ci.yml 2020-07-09 13:33:14 +00:00
Roshan Syed
23d2ce000e ci: update .gitlab-ci.yml 2020-06-16 16:53:31 +00:00
Roshan Syed
cf8f1d94a8 chore: changed building to debug mode 2020-06-12 16:23:08 +00:00
sierra19XX
129d5ebf86
Bitcoin network type deduction (#361)
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-05-05 22:21:07 +10:00
sierra19XX
4896e48b3e
[SON-314] - Weighted Rewards and equal weighted son-account (#360)
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-05-05 22:20:48 +10:00
sierra19XX
6797cdc3d3
[SON-363] - Remove son deletion (#359)
* [SON-363] - Remove son deletion

* Fix the tests
2020-05-04 15:37:41 +10:00
sierra19XX
be538614a9
[SON-359] - Fix Errors processing to-be-refunded deposits (#358)
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-04-23 11:18:30 +02:00
Srdjan Obucina
984000f63e Hotfix - Save deposit address redeem and witness script into sidechain address object 2020-04-23 02:56:24 +02:00
gladcow
072906b3fd
fix broken peerplays_sidechain tests (#357)
Co-authored-by: gladcow <s.gladkov@pbsa.info>
2020-04-22 22:48:33 +02:00
Srdjan Obucina
8d7e574aa5 Hotfix - fix threshold_weight calculation in redeem scripts 2020-04-22 18:01:53 +02:00
gladcow
9db4615698
[SON-135] Add timelock to user deposit address (#356)
* timelocks
* timelocked deposit address
* test for deposit timelock

Co-authored-by: gladcow <s.gladkov@pbsa.info>
2020-04-21 14:54:46 +02:00
obucina
746b71f2fd
Hotfix - use getrawtransaction for approvals and settling (#355)
* Revert "Use decoderawtraction json for proposal approvals (#352)"
This reverts commit d3385b28cb.
* User getrawtransaction for proposal approvals and settling
* Code cleanup
2020-04-21 14:53:31 +02:00
sierra19XX
4db9e3a941
Prevent incorrect signatures to be added to transaction (#354)
* Prevent incorrect signatures to be added to transaction
* Check signers list before signing

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-04-21 14:41:24 +02:00
pbattu123
d8ca4d4625
Merge pull request #353 from peerplays-network/issue_a_gitlab
Unable set private-key option through cli comand
2020-04-20 14:33:58 -03:00
sierra19XX
d3385b28cb
Use decoderawtraction json for proposal approvals (#352)
* Use decoderawtraction json for proposal approvals
* Use default null string to get first vout

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-04-20 16:09:56 +02:00
pbattu123
a4c922cee9 private-key option update 2020-04-20 09:15:54 -03:00
Srdjan Obucina
5030c113bc Hotfix - remove redundant deposit sidechain address recreation 2020-04-20 04:14:06 +02:00
Srdjan Obucina
e7099fbc5c Hotfix - remove importing sidechain addresses 2020-04-20 02:46:47 +02:00
obucina
453772d59f
[SON-349] Delay BTC asset issue/reserve until tx confirmed on sidchain (#348)
* Separate transaction settling from deposit/withdrawal processing
* Handle peerplays deposits with transaction settling
* Remove logs
* All dev features enabled/disabled with single flag
* Deposit/withdraw process and sidechain transaction creation in single proposal
2020-04-19 06:19:59 +02:00
sierra19XX
b436b790fb
SON Weighted Multi Signature Signing (#349)
* Bring in the bitcoin utils code into plugin
* Add tx creation, signing and tests
* tx deserialization fix
* add 10-of-14 multisig address test
* Add signing and verification tests and sign_transaction_standalone
* Add send_transaction_standalone function
* Debug logs and additional tests
* Fix for son deletion in the middle
* Extend script_builder
* Witness script for weighted wallet
* btc_weighted_multisig_address implementation
* Fix for bad-txns-nonstandard-inputs
* Weighted multisignature address test
* Create test tx with weighted multisig wallet
* Fix the issues with tx signing
* End to End test weighted multi sig
* 1 or m-of-n deposit address support
* Move network_type enum to the base class
* btc_one_or_weighted_multisig_address implementation
* Simplify redeem script
* Fix error in redeem_script
* btc_one_or_weighted_multisig_address tests
* Refactor sidechain address mapping
* CLANG code format
* CLANG code format sidechain tests
* Integration of deposit and rest of weighted wallets, withdrawal fee fix, whole code refactoring
* Move util functions to Utils file
* Add proper checks for withdraw fee
* Deposit address creation, import deposit/withdraw addresses, some code cleanup

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
Co-authored-by: gladcow <s.gladkov@pbsa.info>
Co-authored-by: Srdjan Obucina <obucinac@gmail.com>
2020-04-18 22:18:04 +02:00
gladcow
fbb4bbd757
check object's id (#351)
Co-authored-by: gladcow <s.gladkov@pbsa.info>
2020-04-17 21:38:47 +02:00
obucina
5305757136
[SON-354] Fix son_info compare function (#350) 2020-04-17 21:02:30 +02:00
obucina
dd8abfe1cd
[SON-353] Refactor PW processing, PW transfer fixed (#347)
* Add proposal checks for deposit and withdrawal
* Refactor proposal approvement
* Fix transaction verification
* Remove logs
2020-04-15 00:33:56 +02:00
pbattu123
b857603f10
Merge pull request #340 from peerplays-network/feature/nh5050_winner_id
Feature/nh5050 winner_ticket_id changes
2020-04-10 11:10:51 -03:00
sierra19XX
6a8cd25878
[SON-337] - Prevent update_son_votes without GPOS vesting (#344)
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-04-10 14:56:20 +02:00
obucina
7988236b2a
[SON-348] Transaction hash not saved in object after Bitcoin transaction is sent (#343)
- Fixed
- Unused parameters removed
2020-04-09 23:24:48 +02:00
obucina
44db4f5c9b
[SON-346] Sidechain transaction marked as complete even though current_weight < threshold, Fixed (#342) 2020-04-08 22:40:20 +02:00
obucina
4f72269cf6
[SON-344] BTC asset is created with wrong quote asset id, Fixed (#341)
* [SON-344] BTC asset is created with wrong quote asset id, Fixed
* Respond to code review
2020-04-08 13:51:16 +02:00
gladcow
c345369c67
[SON-341, SON-342] Fix issue with deposits number (#339)
Co-authored-by: gladcow <s.gladkov@pbsa.info>
2020-04-06 18:26:41 +02:00
obucina
bd1bd842ce
[SON-325] Added check for approving sidechain_transaction_create_operation (#337) 2020-04-06 18:09:01 +02:00
obucina
be4b55c4a0
[SON-320] Added check for approving son_wallet_update_operation (#336) 2020-04-06 11:31:58 +02:00
obucina
17bf51e963
[SON-322, SON-324] Approval checks for processing deposit/withdrawal (#330)
* Refactor proposal processing
* Added check for approving son_wallet_deposit_process_operation
* Added check for approving son_wallet_withdraw_process_operation
* Calculating exchange rates fixed
* Fix depositing Peerplays assets
2020-04-04 20:02:27 +02:00
sierra19XX
52d7ebc200
[SON-291,SON-328] - SON Configuration invalid, PW creation issues (#335)
* [SON-291,SON-328] - SON Configuration invalid, PW creation issues

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-04-04 05:47:50 +02:00
sierra19XX
1542a9a8e4
[SON-339] - SON Schedule crash (#334)
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-04-04 05:36:28 +02:00
gladcow
e1a487c87b
[SON-305, SON-308, SON-310] Use BTC asset in bitcoin deposits and withdraws (#332) 2020-04-03 04:59:24 +02:00
Srdjan Obucina
b6dc7dcc13 Merge branch 'feature/SONs-base' of https://github.com/peerplays-network/peerplays into feature/SONs-base 2020-04-02 17:54:30 +02:00
Srdjan Obucina
efa7436ded Hotfix - add initialization values to extension params, remove trailing spaces 2020-04-02 17:54:13 +02:00
sierra19XX
5bf245ee6c
SON-297_SON-336 - SON vesting functionality broken after graphene merge (#331)
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-04-02 21:22:05 +11:00
gladcow
8aaa3791bf
[SON-307] Create PBTC asset (#326) 2020-04-01 18:57:50 +02:00
sierra19XX
27f401d24e
[SON-313] - Limit SON functionality when min no. of sons are not present (#329)
* [SON-313] - Limit SON functionality when min no. of sons are not present

* Revert SON HF related checks and tests

* Remove the capability to process proposals in plugin

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-04-01 23:05:22 +11:00
Srdjan Obucina
d71061565a [SON-329] Hotfix - Enable test test_update_dividend_interval 2020-03-31 14:16:18 +02:00
pbattu123
210e72f843
update son-account parameters (#328) 2020-03-30 22:49:03 +02:00
obucina
f3a0827d5d
[SON-332] Check gitlab building process for dirty build (#327)
* Fix failing son test, fix data types and check condition
* Very clean build on Gitlab
2020-03-30 22:48:39 +02:00
Srdjan Obucina
bccba7697e Quickfix - change GPOS and SON hardfork times 2020-03-30 16:59:10 +02:00
Srdjan Obucina
dc5a8da13d Hotfix - Fix build error 2020-03-29 23:23:57 +02:00
gladcow
1e76a23133
[SON-311] Add try_create_son call without explicit deposit params (#324)
Co-authored-by: gladcow <s.gladkov@pbsa.info>
2020-03-29 23:19:45 +02:00
sierra19XX
26f6252716
[SON-318_SON-319] - Add approval checks for son down, deregister proposals (#321)
* [SON-318_SON-319] - Add approval checks for son down and deregister proposals

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
Co-authored-by: Srdjan Obucina <obucinac@gmail.com>
2020-03-27 22:13:27 +01:00
obucina
770ccdb77a
[SON-321, SON-323] Deposit/Withdraw object creation refactoring (#320)
* Remove proposals for creating deposit and withdrawal objects, strenghten evaluator checks
* Only active SON can create the object
* Only expected SON can confirm the transaction
* Transaction must be initiated (paid) by SON account owner (SON account given in operation)
* Transaction confirmation must contain exactly the same data as existing object
* Mirror SON owner account weights from son-account.active.account_auths to active SONs
* Fix duplicated typedef, peerplays_sidechain::sidechain_type to chain::sidechain_type
* Add missing serialized field
2020-03-27 21:15:46 +01:00
obucina
13bc59aee9
Parallelizing sidechain transaction signing (#319) 2020-03-27 19:00:32 +01:00
obucina
54390346c1
[SON-271] Merge recent develop branch changes(both GPOS and graphene updates) into SONs branch (#322) 2020-03-27 18:46:30 +01:00
obucina
e170676ff9
[SON-312] Refactor create_son to assign owner account public key as a signing_key
remove key derivation from create son (#323)
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2020-03-27 14:40:37 +01:00
obucina
0f97241f1b
Replace raw with psbt transactions to support parital tx signing (#311)
* RPC calls for PSBT, raw transactions replaced with PSBT
* Fix estimatesmartfeerate, extensive RPC calls logging for debugging purposes
* Remove dead code
* Partial signing functional for deposit and withdrawal
* Fix sidechain_type declarations
* Depositing Peerplays asset refactored
* Partial signing functional for primary wallet funds moving
* Prettier logs
* Refactor multiple SON support processing
* Serialize field complete from sidechain_transaction_sign_operation
* Refactor transaction signing in particular order, BTC only (maybe) need it
* Add number of required signatures parameter for addmultisigaddress
* Change default bitcoin node parameters
* Transaction signing only by scheduled son
* Removed scheduling log
* Prevent PW funds moving to the same address
* Refactor sidechain_transaction_object processing, code cleanup
* Remove obsolete tests
* Decrease logging
* Code readability
* When updated, import son wallet bitcoin address to bitcoin wallet
* When updated, recreate son wallet bitcoin address on each node
* Refactor on_changed_objects, move it into task
* Add check to prevent deposit/withdrawal double processing
* Improved check for sidechain transaction object creation
* Single sidechain transaction signature per block allowed only
* Unlock wallet on addmultisigaddress
* Import both address and redeem script on primary wallet change, fix some compiler warnings
* Fix invalid list of signers for PW funds transfer
2020-03-25 11:44:22 +01:00
sierra19XX
964aed0bdf
[SON-122] - SON Statistics improvements and consensus account creation (#318)
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-03-25 20:21:09 +11:00
obucina
c2ee4f09c6
Merge pull request #315 from peerplays-network/revert-312-sons_gpos_merge_mar19
Revert "Merge develop branch changes(GPOS+graphene updates) into SONs branch"
2020-03-21 09:59:48 +01:00
obucina
19a34e9102
Revert "Merge develop branch changes(GPOS+graphene updates) into SONs branch" 2020-03-21 09:47:46 +01:00
obucina
955893bd49
Merge pull request #312 from peerplays-network/sons_gpos_merge_mar19
Merge develop branch changes(GPOS+graphene updates) into SONs branch
2020-03-20 16:10:28 +01:00
sierra19XX
096af5e77c
[SON-24] - SON Rewards missing serialisations and end to end testing (#313)
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-03-20 18:30:32 +11:00
pbattu123
275315ee3e gpos, graphene updates 2020-03-19 00:54:15 -03:00
pbattu123
78c17c0ef0 updated unit test cases to reflect GPOS vesting and update account id's according to sons-account 2020-03-18 17:19:28 -03:00
pbattu123
1d66b859c9 update GPOS HF to fall in before SONS HF, remove check 2020-03-18 17:18:15 -03:00
sierra19XX
ed4ebfdb80
SON127 - Add son parameter extensions to genesis, push proposal fix (#310)
* SON276 - Fix SON proposal exceptions - I

* SON127 - Add son parameter extensions to genesis, push proposal fix

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-03-18 00:01:31 +11:00
pbattu123
8a90e70f12 update GPOS hardfork date to sons branch 2020-03-16 22:40:35 -03:00
pbattu123
c0d515b93f notifications of SONS should get restrict to sons functionality 2020-03-16 22:32:35 -03:00
pbattu123
3ffcd4fdd0 Allow voting for son, only if GPOS vesting balance available 2020-03-16 18:24:28 -03:00
obucina
ff7e1baaf1
Add SON statistic for tracking reported sidechain transactions (#308)
- Deposit and Withdrawal object extended to contain expected
  and received transaction reports from SON network
- SON statistic object extended to contain total number of
  sidechain transactions reported by SON network when SON was
  active and number of transactions reported by single SON when
  he was active
- Code formatting
2020-03-14 16:14:39 +05:30
sierra19XX
cc7b47cf0f
SON276 - Fix SON proposal exceptions - I (#307)
Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-03-14 11:08:45 +11:00
pbattu123
d22544657f fix unit test case failures(add gpos vesting before voting) 2020-03-13 12:00:07 -03:00
pbattu123
ea0be26789 need to assign both name and id to stats id 2020-03-13 11:58:54 -03:00
sierra19XX
f1e5171be0
SON275 - ZMQ Crash on application exit (#306)
* SON275 - ZMQ Crash on application exit

* SON275 - Fix Indentation

Co-authored-by: satyakoneru <15652887+satyakoneru@users.noreply.github.com>
2020-03-11 15:01:20 +05:30
Srdjan Obucina
d2f5cde2b5 Merge branch 'feature/SONs-base' of https://github.com/peerplays-network/peerplays into feature/SONs-base 2020-03-10 17:59:48 +01:00
Srdjan Obucina
85b81cb32b Quickfix, remove dead code, return result from wallet withdraw do_evaluate 2020-03-10 17:59:32 +01:00
satyakoneru
2e8c074655
SON202 - Maintenance improvements (#303) 2020-03-06 22:49:26 +11:00
pbattu123
da4954c686 resolved compilation issues and other conflicts 2020-03-05 16:20:24 -04:00
satyakoneru
dbf73509ba
SON118 - Add tx sign metrics for SON rewards (#302) 2020-03-05 02:21:15 +11:00
pbattu123
11718af9b8 Merge develop into SONS 2020-03-03 16:42:51 -04:00
obucinac
d6e6bed907
Various SON improvements (#297)
* Refactor SON processing
* Better exposure of sidechain private keys in sidechain handlers
* Support non default Bitcoin wallets
* Fix crash on config file recreation
* clang-format formatting
* New Bitcoin wallet related RPC calls
* Add missing create_son_deregister_proposals calls
* Add missing create_son_deregister_proposals calls
* Add loading/unlocking/locking of non-default bitcoin wallet
* Bitcon RFC logs improved, proposal aprovement improved
* Move signal connection after handlers are created
2020-03-02 15:24:24 +02:00
satyakoneru
abeae4e34d
SON269 - Move SON deregistration to Plugin from witness (#298)
* SON200 - SON Down proposal broken after latest merges

* Add the owner weight threshold similar to witnesses and committee accounts

* SON269 - Move SON deregistration to Plugin from witness
2020-02-28 02:21:04 +05:30
satyakoneru
477aa0332f
SON200 - SON Down proposal broken after latest merges (#294)
* SON200 - SON Down proposal broken after latest merges

* Add the owner weight threshold similar to witnesses and committee accounts
2020-02-28 01:06:20 +11:00
obucinac
47c98c203a
[SON-264] Integrating deposit/withdrawals with bitcoin transactions (feature/SON-260 + SON261 branches) (#291)
* Partial integration done, some Bitcoin RPC refactoring
* CLang Format config file
* CLang Format config file v2.0
* Fix repeating tasks that should be executed by scheduled SON only
* Fix withdrawal
* Integrate PW wallet fund moving
* Resolve conflicts

Co-authored-by: gladcow <jahr@yandex.ru>
Co-authored-by: satyakoneru <satyakoneru.iiith@gmail.com>
2020-02-24 15:00:59 +02:00
satyakoneru
f859d61398
SON261 - Bitcoin deposit, withdrawal, PW transfer (#287)
* Extend GPO.active_sons to contain votes and all public keys

* Introduce son_wallet_object

* son_wallet_object operations

* son_wallet_object operations

* son_wallet_object operations completed, basic tests added

* Create son_wallet_object on new set of SONs, to initiate primary wallet recreation

* son_wallet_object API and cli wallet commands

* Send RPC command to bitcoin node to recreate multisig wallet

* Send RPC command to bitcoin node to recreate multisig wallet

* Send RPC command to bitcoin node to recreate multisig wallet

* Wallet recreation by scheduled SON only, some cosmetic refactoring

* Wallet recreation by scheduled SON only, some cosmetic refactoring

* Updating wallet info through operation instead through database.modify() for persistance

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp

Co-Authored-By: gladcow <jahr@yandex.ru>

* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp

Co-Authored-By: gladcow <jahr@yandex.ru>

* Fix #include <graphene/chain/son_wallet_transfer_object.hpp>

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* Refactor primary wallet recreation

* Refactor primary wallet recreation

* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal

* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal

* Quickfix for checking payer in evaluator

* Quickfix for checking payer in evaluator

* Fix failing son_wallet_tests

- Check for son_btc_account is temporarely disabled

* Remove redundant file

* Squashed commit of the following:

commit a688bb93ed
Author: obucinac <obucinac@users.noreply.github.com>
Date:   Tue Feb 4 19:31:45 2020 +0100

    son_wallet_object operations and multisig wallet recreation by RPC (#263)

    * Extend GPO.active_sons to contain votes and all public keys

    * Introduce son_wallet_object
    * son_wallet_object operations
    * Create son_wallet_object on new set of SONs, to initiate primary wallet recreation
    * son_wallet_object API and cli wallet commands
    * Send RPC command to bitcoin node to recreate multisig wallet
    * Updating wallet info through operation instead through database.modify() for persistance
    * Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
    * Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
    * Fix #include <graphene/chain/son_wallet_transfer_object.hpp>
    * Refactor primary wallet recreation
    * PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal
    * Quickfix for checking payer in evaluator
    * Fix failing son_wallet_tests
    - Check for son_btc_account is temporarely disabled
    * Remove redundant file
    Co-authored-by: gladcow <jahr@yandex.ru>

commit 6e61d6b055
Author: satyakoneru <satyakoneru.iiith@gmail.com>
Date:   Tue Feb 4 00:14:39 2020 +1100

    SON233 - Provide correct downtime metrics to user (#278)

* Remove duplicated item in CMakeLists.txt

* Issue tokens to the user who deposited Bitcoin, WIP...

* Add son_wallet_transfer_process_operation

* Issue tokens to the user who deposited Bitcoin, WIP...

* Support multiple SON nodes per software instance

* Add is_active_son guards for sidechain events processing

* Add is_active_son guards, fix sending proposals and aprovals

* Managing GRAPHENE_SON_ACCOUNT and issuing assets on Bitcoin deposit

* Fix bad param

* Fix aprovals on already approved or invalid proposals

* Move transfer inside son_wallet_transfer_process_operation

* Fix merging issue

* Add cmake command line option SUPPORT_MULTIPLE_SONS

* Skeleton of sidechain_net_handler_peerplays

* Skeleton of Peerplays network listener

* SON261 - Deposit transfer ( user address -> PW ) and Withdrawal transfer ( PW -> user address ) for m-of-n multisig

* Temoprary disable account history tests for tracking accounts

* Full Peerplays listener, use GRAPHENE_SON_ACCOUNT instead son_btc_account

* Renaming son_wallet_transfer* to son_wallet_deposit*, introducing son_wallet_withdrawal*

* Extend sidechain_address_object to contain withdrawal addresses
- Withdrawal address is the address where system will send sidechain currencies

* Rename son_wallet_withdrawal* to son_wallet_withdraw*

* Some refactoring

* SON261 - Withdrawal transfer ( PW -> user address ), addition of bitcoin public private key to config.ini for multiple sons mode

* Withdrawal refactoring

* Withdrawal refactoring

* SON261 - Fix prepare_tx

* SON261 - Add PW->PW Transfer and Code reorg

* Fix file permissions

Co-authored-by: obucinac <obucinac@users.noreply.github.com>
Co-authored-by: gladcow <jahr@yandex.ru>
2020-02-24 07:34:54 +05:30
obucinac
13d2b27ed9
[SON-260] Sidechain Token withdrawal (#286)
* Extend GPO.active_sons to contain votes and all public keys

* Introduce son_wallet_object

* son_wallet_object operations

* son_wallet_object operations

* son_wallet_object operations completed, basic tests added

* Create son_wallet_object on new set of SONs, to initiate primary wallet recreation

* son_wallet_object API and cli wallet commands

* Send RPC command to bitcoin node to recreate multisig wallet

* Send RPC command to bitcoin node to recreate multisig wallet

* Send RPC command to bitcoin node to recreate multisig wallet

* Wallet recreation by scheduled SON only, some cosmetic refactoring

* Wallet recreation by scheduled SON only, some cosmetic refactoring

* Updating wallet info through operation instead through database.modify() for persistance

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp

Co-Authored-By: gladcow <jahr@yandex.ru>

* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp

Co-Authored-By: gladcow <jahr@yandex.ru>

* Fix #include <graphene/chain/son_wallet_transfer_object.hpp>

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* Refactor primary wallet recreation

* Refactor primary wallet recreation

* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal

* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal

* Quickfix for checking payer in evaluator

* Quickfix for checking payer in evaluator

* Fix failing son_wallet_tests

- Check for son_btc_account is temporarely disabled

* Remove redundant file

* Squashed commit of the following:

commit a688bb93ed
Author: obucinac <obucinac@users.noreply.github.com>
Date:   Tue Feb 4 19:31:45 2020 +0100

    son_wallet_object operations and multisig wallet recreation by RPC (#263)

    * Extend GPO.active_sons to contain votes and all public keys

    * Introduce son_wallet_object
    * son_wallet_object operations
    * Create son_wallet_object on new set of SONs, to initiate primary wallet recreation
    * son_wallet_object API and cli wallet commands
    * Send RPC command to bitcoin node to recreate multisig wallet
    * Updating wallet info through operation instead through database.modify() for persistance
    * Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
    * Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
    * Fix #include <graphene/chain/son_wallet_transfer_object.hpp>
    * Refactor primary wallet recreation
    * PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal
    * Quickfix for checking payer in evaluator
    * Fix failing son_wallet_tests
    - Check for son_btc_account is temporarely disabled
    * Remove redundant file
    Co-authored-by: gladcow <jahr@yandex.ru>

commit 6e61d6b055
Author: satyakoneru <satyakoneru.iiith@gmail.com>
Date:   Tue Feb 4 00:14:39 2020 +1100

    SON233 - Provide correct downtime metrics to user (#278)

* Remove duplicated item in CMakeLists.txt

* Issue tokens to the user who deposited Bitcoin, WIP...

* Add son_wallet_transfer_process_operation

* Issue tokens to the user who deposited Bitcoin, WIP...

* Support multiple SON nodes per software instance

* Add is_active_son guards for sidechain events processing

* Add is_active_son guards, fix sending proposals and aprovals

* Managing GRAPHENE_SON_ACCOUNT and issuing assets on Bitcoin deposit

* Fix bad param

* Fix aprovals on already approved or invalid proposals

* Move transfer inside son_wallet_transfer_process_operation

* Fix merging issue

* Add cmake command line option SUPPORT_MULTIPLE_SONS

* Skeleton of sidechain_net_handler_peerplays

* Skeleton of Peerplays network listener

* Temoprary disable account history tests for tracking accounts

* Full Peerplays listener, use GRAPHENE_SON_ACCOUNT instead son_btc_account

* Renaming son_wallet_transfer* to son_wallet_deposit*, introducing son_wallet_withdrawal*

* Extend sidechain_address_object to contain withdrawal addresses
- Withdrawal address is the address where system will send sidechain currencies

* Rename son_wallet_withdrawal* to son_wallet_withdraw*

* Some refactoring

* Withdrawal refactoring

* Withdrawal refactoring

Co-authored-by: gladcow <jahr@yandex.ru>
2020-02-23 22:03:43 +05:30
gladcow
a9cfadc500
[SON-242] fix list_active_sons call after deleting an active son (#292)
* test to reproduce error in list_active_sons after delete_son

* prevent exception in list_active_list
2020-02-23 22:01:51 +05:30
gladcow
a968ec922c
add ability to gather signatures before signing (#290) 2020-02-21 19:02:06 +05:30
gladcow
544112c63b
[SON-209] Create P2SH address with custom redeemScript (#271)
* Create redeem script for SONs primary wallet

* Add importaddress call

Allows to watch for related transactions without private keys import

* Get UTXO set for watched addresses

* createrawtransaction call

* signing PW spending transaction

* unit test for btc tx serialization

* sending PW transfer in test

* BIP143 tx signing

* use bech32 address format

* use single sha256 for lock script

* Digest fix

* working signing

* separate signing

* test partially signed PW transfer
2020-02-19 17:16:27 +05:30
obucinac
a8eb4227aa
Support multiple SON nodes per software instance (#282)
* Extend GPO.active_sons to contain votes and all public keys

* Introduce son_wallet_object

* son_wallet_object operations

* son_wallet_object operations

* son_wallet_object operations completed, basic tests added

* Create son_wallet_object on new set of SONs, to initiate primary wallet recreation

* son_wallet_object API and cli wallet commands

* Send RPC command to bitcoin node to recreate multisig wallet

* Send RPC command to bitcoin node to recreate multisig wallet

* Send RPC command to bitcoin node to recreate multisig wallet

* Wallet recreation by scheduled SON only, some cosmetic refactoring

* Wallet recreation by scheduled SON only, some cosmetic refactoring

* Updating wallet info through operation instead through database.modify() for persistance

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp

Co-Authored-By: gladcow <jahr@yandex.ru>

* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp

Co-Authored-By: gladcow <jahr@yandex.ru>

* Fix #include <graphene/chain/son_wallet_transfer_object.hpp>

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* Refactor primary wallet recreation

* Refactor primary wallet recreation

* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal

* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal

* Quickfix for checking payer in evaluator

* Quickfix for checking payer in evaluator

* Fix failing son_wallet_tests

- Check for son_btc_account is temporarely disabled

* Remove redundant file

* Squashed commit of the following:

commit a688bb93ed
Author: obucinac <obucinac@users.noreply.github.com>
Date:   Tue Feb 4 19:31:45 2020 +0100

    son_wallet_object operations and multisig wallet recreation by RPC (#263)

    * Extend GPO.active_sons to contain votes and all public keys

    * Introduce son_wallet_object
    * son_wallet_object operations
    * Create son_wallet_object on new set of SONs, to initiate primary wallet recreation
    * son_wallet_object API and cli wallet commands
    * Send RPC command to bitcoin node to recreate multisig wallet
    * Updating wallet info through operation instead through database.modify() for persistance
    * Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
    * Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
    * Fix #include <graphene/chain/son_wallet_transfer_object.hpp>
    * Refactor primary wallet recreation
    * PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal
    * Quickfix for checking payer in evaluator
    * Fix failing son_wallet_tests
    - Check for son_btc_account is temporarely disabled
    * Remove redundant file
    Co-authored-by: gladcow <jahr@yandex.ru>

commit 6e61d6b055
Author: satyakoneru <satyakoneru.iiith@gmail.com>
Date:   Tue Feb 4 00:14:39 2020 +1100

    SON233 - Provide correct downtime metrics to user (#278)

* Remove duplicated item in CMakeLists.txt

* Issue tokens to the user who deposited Bitcoin, WIP...

* Add son_wallet_transfer_process_operation

* Issue tokens to the user who deposited Bitcoin, WIP...

* Support multiple SON nodes per software instance

* Add is_active_son guards for sidechain events processing

* Add is_active_son guards, fix sending proposals and aprovals

* Managing GRAPHENE_SON_ACCOUNT and issuing assets on Bitcoin deposit

* Fix bad param

* Fix aprovals on already approved or invalid proposals

* Move transfer inside son_wallet_transfer_process_operation

* Fix merging issue

* Add cmake command line option SUPPORT_MULTIPLE_SONS

* Temoprary disable account history tests for tracking accounts

Co-authored-by: gladcow <jahr@yandex.ru>
2020-02-19 17:06:58 +05:30
obucinac
116be75c32
SON wallet transfer object and operations (#279)
* Extend GPO.active_sons to contain votes and all public keys

* Introduce son_wallet_object

* son_wallet_object operations

* son_wallet_object operations

* son_wallet_object operations completed, basic tests added

* Create son_wallet_object on new set of SONs, to initiate primary wallet recreation

* son_wallet_object API and cli wallet commands

* Send RPC command to bitcoin node to recreate multisig wallet

* Send RPC command to bitcoin node to recreate multisig wallet

* Send RPC command to bitcoin node to recreate multisig wallet

* Wallet recreation by scheduled SON only, some cosmetic refactoring

* Wallet recreation by scheduled SON only, some cosmetic refactoring

* Updating wallet info through operation instead through database.modify() for persistance

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp

Co-Authored-By: gladcow <jahr@yandex.ru>

* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp

Co-Authored-By: gladcow <jahr@yandex.ru>

* Fix #include <graphene/chain/son_wallet_transfer_object.hpp>

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* SON wallet transfer object and operations, for tracking assets deposit/withdrawal

* Refactor primary wallet recreation

* Refactor primary wallet recreation

* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal

* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal

* Quickfix for checking payer in evaluator

* Quickfix for checking payer in evaluator

* Fix failing son_wallet_tests

- Check for son_btc_account is temporarely disabled

* Remove redundant file

* Squashed commit of the following:

commit a688bb93ed
Author: obucinac <obucinac@users.noreply.github.com>
Date:   Tue Feb 4 19:31:45 2020 +0100

    son_wallet_object operations and multisig wallet recreation by RPC (#263)

    * Extend GPO.active_sons to contain votes and all public keys

    * Introduce son_wallet_object
    * son_wallet_object operations
    * Create son_wallet_object on new set of SONs, to initiate primary wallet recreation
    * son_wallet_object API and cli wallet commands
    * Send RPC command to bitcoin node to recreate multisig wallet
    * Updating wallet info through operation instead through database.modify() for persistance
    * Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
    * Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
    * Fix #include <graphene/chain/son_wallet_transfer_object.hpp>
    * Refactor primary wallet recreation
    * PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal
    * Quickfix for checking payer in evaluator
    * Fix failing son_wallet_tests
    - Check for son_btc_account is temporarely disabled
    * Remove redundant file
    Co-authored-by: gladcow <jahr@yandex.ru>

commit 6e61d6b055
Author: satyakoneru <satyakoneru.iiith@gmail.com>
Date:   Tue Feb 4 00:14:39 2020 +1100

    SON233 - Provide correct downtime metrics to user (#278)

* Remove duplicated item in CMakeLists.txt

* Issue tokens to the user who deposited Bitcoin, WIP...

* Add son_wallet_transfer_process_operation

* Issue tokens to the user who deposited Bitcoin, WIP...

* Add is_active_son guards for sidechain events processing

Co-authored-by: gladcow <jahr@yandex.ru>
2020-02-11 19:16:35 +05:30
satyakoneru
daf7ac5da8
SON214 - Request maintenance wallet commands (#280) 2020-02-07 11:19:16 +05:30
obucinac
a688bb93ed
son_wallet_object operations and multisig wallet recreation by RPC (#263)
* Extend GPO.active_sons to contain votes and all public keys

* Introduce son_wallet_object
* son_wallet_object operations
* Create son_wallet_object on new set of SONs, to initiate primary wallet recreation
* son_wallet_object API and cli wallet commands
* Send RPC command to bitcoin node to recreate multisig wallet
* Updating wallet info through operation instead through database.modify() for persistance
* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
* Update libraries/chain/include/graphene/chain/protocol/son_wallet.hpp
* Fix #include <graphene/chain/son_wallet_transfer_object.hpp>
* Refactor primary wallet recreation
* PW recreation refactoring, prevent duplicated recreations, update wallet address through proposal
* Quickfix for checking payer in evaluator
* Fix failing son_wallet_tests
- Check for son_btc_account is temporarely disabled
* Remove redundant file
Co-authored-by: gladcow <jahr@yandex.ru>
2020-02-04 19:31:45 +01:00
satyakoneru
6e61d6b055
SON233 - Provide correct downtime metrics to user (#278) 2020-02-03 18:44:39 +05:30
satyakoneru
b952522b01
SON232 - Avoid duplicate proposals from sidechain plugin (#275) 2020-01-31 17:28:07 +05:30
satyakoneru
21c8337753
SON165 - Keys mapping missing from wallet data (#274) 2020-01-29 17:50:36 +05:30
satyakoneru
61c6d7f572 SON206_Plugin_CrashFix_Reorg - Plugin Changes (#272)
* SON206_Plugin_CrashFix_Reorg - Plugin Changes

* SON206_Plugin_CrashFix_Reorg - add owner auths to consensus account
2020-01-28 15:12:30 +05:30
Srdjan Obucina
7139b4a4e3 Quickfix for update_sidechain_address and delete_sidechain_address cli commands 2020-01-23 13:15:55 +01:00
satyakoneru
80870749de SON199 - Fix Unit Test Failure (#268) 2020-01-21 21:39:54 +05:30
Srdjan Obucina
e0e427a366 Quick fix for list_active_sons 2020-01-20 15:08:34 +01:00
gladcow
11339c1734 [SON-202] Implement cli_wallet commands for maintenance mode (#261)
* Add stop_son_maintenance CLI call

* fix bug with SON activation

* son_maintenance_operation

* son_maintenance_operation tests

* cli test for son maintenance state

* start_son_maintenance CLI call

* keep maintenance state during active SON set changes
2020-01-18 02:00:45 +05:30
satyakoneru
5af31dd90d SON217 - SON Maintenance,Heartbeat state transition changes (#264)
* SON217 - SON Maintenance,Heartbeat state transition changes

* SON217 - SON Maintenance,Heartbeat state transition changes
2020-01-18 01:58:13 +05:30
Roshan Syed
691468dff0
Updated gitlab CI to sync submodules (#265) 2020-01-17 08:22:26 -04:00
satyakoneru
5d7ab51d58 SON212-SON213 - Fix Build Error (#262)
* SON212-SON213 - Fix Build Error

* SON212-SON213 - Fix Build Error Add smart_ref definition for linking
2020-01-16 02:17:05 +05:30
satyakoneru
77927da236 SON212-SON213 - Add Sidechain Plugin Code to report and approve SON Down proposal (#260)
* SON212 - Add Sidechain Plugin Code to report SON Down

* SON212-SON213 - Add Sidechain Plugin Code to report SON Down, Approve proposal from sidechain plugin
2020-01-14 18:43:02 +05:30
Srdjan Obucina
6fe0acb12d Fix build errors 2020-01-13 16:05:28 +01:00
obucinac
47eafcf6c0 Wallet recreation on new set of SONs voted in (#256)
* Extend GPO.active_sons to contain votes and all public keys

* Introduce son_wallet_object
2020-01-13 19:28:43 +05:30
satyakoneru
59a02b1460 SON206 - Plugin SON Heartbeat changes (#250)
* SON206 - Plugin SON Heartbeat changes

* SON206 - Plugin SON Heartbeat changes, comment removal

* SON206 - Plugin SON Heartbeat changes, stub testing and changes

* SON206 - Plugin SON Heartbeat changes, removing debugs prints
2020-01-06 18:36:49 +05:30
satyakoneru
01fb1db6a6 SON194-SON195 - Report SON Down, addition of SON Account for sidechain consensus (#244)
* SON194-SON195 - Addition of SON BTC Account and report son down changes

* SON194-SON195 - SON BTC Account errors rectification

* SON194-SON195 - Adding Tests

* User sidechain address mappings (#240)

* WIP: Sidechain objects
* Revert "WIP: Sidechain objects"
This reverts commit 8676940a28.
* WIP: User sidechain address mappings
* Fix reflection problem
* Reflect missing members of sidechain_address_update_operation
* Add sidechain address operation tests
* Enable RPC calls
* Fix build errors due to merge conflict
* Fix RPC, add CLI wallet commands for sidechain addresses
* Improved peerplays_sidechain_plugin_impl
* Remove short param for son-id
* Fix crashing errors on bitcoin event received
* Code review changes

* SON207 - Introduce scheduling for SONs similar to witnesses (#251)

* Extend SON objects to contain sidechain public keys (#254)

Co-authored-by: obucinac <obucinac@users.noreply.github.com>
2020-01-06 18:29:35 +05:30
obucinac
31ec55514b
Extend SON objects to contain sidechain public keys (#254) 2019-12-23 19:20:26 +01:00
satyakoneru
a347e97649 SON207 - Introduce scheduling for SONs similar to witnesses (#251) 2019-12-23 19:00:49 +05:30
obucinac
6d5b86a8e5
User sidechain address mappings (#240)
* WIP: Sidechain objects
* Revert "WIP: Sidechain objects"
This reverts commit 8676940a28.
* WIP: User sidechain address mappings
* Fix reflection problem
* Reflect missing members of sidechain_address_update_operation
* Add sidechain address operation tests
* Enable RPC calls
* Fix build errors due to merge conflict
* Fix RPC, add CLI wallet commands for sidechain addresses
* Improved peerplays_sidechain_plugin_impl
* Remove short param for son-id
* Fix crashing errors on bitcoin event received
* Code review changes
2019-12-18 19:30:38 +01:00
satyakoneru
1d5878db28 SON193-SON200- SON Heartbeats and maintenance mode changes (#241)
* SON193-SON200- SON Heartbeats and maintenance mode changes

* SON193-SON200- SON Heartbeats and maintenance tests
2019-12-12 18:36:38 +05:30
obucinac
876bbc8c6d
Add peerplays account for a SON in a config/command line options (#231) 2019-12-11 14:58:47 +01:00
gladcow
d03bfa81f7 [SON-199] Fix unit tests (#233)
* fix app_test

* fix son_delete_test
2019-12-08 12:13:05 +05:30
obucinac
749fc2f330
Add Bitcoin network listener to a SON plugin (#196)
* Add Bitcoin network listener to a SON plugin
* Add default parameters for Peerplays Bitcoin test node
* Add Bitcoin block processing
* Update source code to last designs
* Set default parameters for peerplays_sidechain plugin to Bitcoin test server
* WIP: Some Bitcoin transaction processing
2019-12-04 18:52:00 +01:00
Sandip Patel
76b95729e1 removed unrelated parameter description from delete_son 2019-11-21 13:34:29 +05:30
Alfredo Garcia
36c93a586c
Merge pull request #215 from peerplays-network/feature/SON-150
[SON-150] list_active_sons wallet_api call
2019-11-17 10:17:42 -03:00
Sandip Patel
ae781e48af Fixed betting tests (#217)
* Fixed betting tests

* Removed comments
2019-11-12 00:23:13 +05:30
gladcow
dbf6be02c5 use assert instead of checking condition with low possibility 2019-11-11 13:13:57 +03:00
gladcow
62f973ca80 fix code style 2019-11-11 12:54:54 +03:00
gladcow
8c4eb579a7 unit test for list_active_sons 2019-11-07 13:38:24 +03:00
gladcow
22f76a04c0 list_active_sons api call implementation 2019-11-07 13:38:24 +03:00
gladcow
e4eb3e6ce3 [SON-113] Fix several issues in update_son_votes call in wallet_api (#208)
* do not allow update votes with both empty lists

* fix error messages

* check number of sons against votes number in account_object

* Update error message
2019-11-01 22:26:00 +05:30
gladcow
a0e4ac59ff [SON-160] Fix create_vesting wallet_api call (#206)
* Fix create_vesting wallet_api call

* change type for vesting_type in create_vesting_balance
2019-11-01 19:13:34 +05:30
Alfredo Garcia
0bbe7f63c7
Merge pull request #203 from peerplays-network/feature/SON-142
[SON-142] Fix failed SON deletion CLI tests
2019-10-31 10:15:50 -03:00
gladcow
11e9830194 fix son_delete_operation reflection 2019-10-30 13:31:15 +03:00
satyakoneru
666ced390e SON126 - Witness Proposals to deregister SONs (#192)
* SON126 - Witness Proposals to deregister SONs

* SON126 - Approval by witness, removal of son_proposal_object, commenting

* SON126 - Witness proposal tests and related fixes

* SON126 - Proper commenting
2019-10-23 22:16:04 +05:30
gladcow
f9f95cd242 [SON-113] Unit test for cli update_son_votes (#179)
* refactor cli tests

* update_son_votes tests

* list_sons test

* test changes in get_global_properties() result

* fix generate_block failure

* fix update_son_votes test

* improve update_son cli test

* fix linking errors

* refactor select_top_fifteen_sons test

* refactor other son cli tests to use son_test_helper

* create_vesting call in wallet_api

* test fix

* fix create_son in wallet_api and cli tests
2019-10-23 18:54:17 +05:30
Alfredo Garcia
e0242bcf86 fix build error (#191)
* fix build error

* adapt son_pay_test to dormant vesting policy
2019-10-22 03:29:31 +05:30
obucinac
610490ef81
Active SONs, list up to 15, order by votes, add test (#185)
* Add test for selecting 15 SONs with highest votes
* Display up to 15 active SONs, SON ordering by total_votes
2019-10-21 15:44:09 +02:00
Alfredo Garcia
412177964c
Merge pull request #183 from peerplays-network/son_vesting
Son vesting balance implementation
2019-10-20 10:29:15 -03:00
Alfredo Garcia
f84155a166
Merge branch 'feature/SONs-base' into son_vesting 2019-10-18 15:21:08 -03:00
Alfredo Garcia
dcaf55a184 remove not needed code from wallet son commands, add delete son test to cli (#181) 2019-10-18 15:49:38 +05:30
Alfredo Garcia
d29e433488 force son create vesting balance to have dormant policy 2019-10-18 00:27:13 -03:00
Alfredo Garcia
76120a5b76 abstraction of dormant vesting policy 2019-10-18 00:01:40 -03:00
satyakoneru
ee7aae56da SON118-Add Budget for SON (#165)
* SON118-Add Budget for SON

* SON118 - Compilation errors fix

* SON118 - Proper commenting around pay_sons function

* SON118 - Comment correction, SON statistics object implementation type correction

* SON118 - Add missing index init and reflect enums

* SON118 - Correcting the indentation

* SON118 SON144 - Add unit test, code fixes and resolve failures for existing tests

* SON118 SON144 - Removing extra spaces added
2019-10-17 20:16:48 +05:30
Alfredo Garcia
032c4c7a99 add precision to son vesting amount 2019-10-16 14:59:49 -03:00
Alfredo Garcia
be8dc42d66 add dormant vesting policy for son 2019-10-15 21:55:48 -03:00
Alfredo Garcia
c94412cb7a add vesting balance type support 2019-10-15 20:28:04 -03:00
Alfredo Garcia
c02a33a004 add son vesting config options 2019-10-15 17:35:26 -03:00
obucinac
b3b994c6ea
Add son_delete cli tests (#182)
* Add son_delete cli tests
2019-10-15 18:13:14 +02:00
Alfredo Garcia
6c8f4bf9d5
Merge pull request #176 from peerplays-network/feature/SON-142
[SON-142] Fix the failed tests in SONs-base
2019-10-14 20:34:05 -03:00
obucinac
f3150d4208
Fix segfault when using list_sons from cli_wallet (#178) 2019-10-15 00:42:19 +02:00
obucinac
9201e0d000
Fix segfault when using delete_son from cli_wallet (#177) 2019-10-15 00:37:43 +02:00
gladcow
342099fce8 fix insert object processing in indexes, son_delete is working 2019-10-12 16:32:17 +03:00
obucinac
d782687404 Add cli wallet tests for vote_for_son (#175) 2019-10-12 14:44:25 +05:30
gladcow
ae5075a657 [SON-110] get_son cli test (#173)
* get_son cli test

* update_son cli test
2019-10-12 00:55:59 +05:30
obucinac
fdf287c12a
SON-108 - Add cli wallet tests for create_son (#174)
* SON-108 - Add cli wallet tests for create_son

* Add info message at the beginning and end of the SON CLI tests

* Minor output message change

* Enable Boost test messages in unit tests
2019-10-11 19:25:43 +02:00
gladcow
777019241e fix affiliate tests 2019-10-11 11:33:26 +03:00
obucinac
e3548de34e
SON object, operations, cli_wallet commands and RPC (#160)
- create_son, update_son, delete_son, list_sons
- get_sons, get_son_by_account, lookup_son_accounts, get_son_count
- vote_for_son, update_son_votes
- claim_registered_son
- get_son in cli_wallet
- Updating global_property_object
- Decrease SON hardfork time for test purposes
- CLI Wallet tests imported from develop branch
2019-10-09 22:24:36 +02:00
gladcow
4bf90d0592 fix for cli test 2019-10-09 19:57:12 +03:00
obucinac
e90735a162
Plugin description added, SON plugin params example 2019-10-08 20:41:57 +02:00
Srdjan Obucina
940a620ca2 Fix build error, add missing GRAPHENE_MAX_NESTED_OBJECTS parameter 2019-10-08 18:22:33 +02:00
Srdjan Obucina
944c2c1a4c Merge branch 'develop' into feature/SONs-base 2019-10-08 17:59:28 +02:00
Srdjan Obucina
9768d302be Revert "[SON-107] Merge develop branch to SONs-base (#166)"
This reverts commit 499e318199.
2019-10-08 15:44:13 +02:00
gladcow
499e318199 [SON-107] Merge develop branch to SONs-base (#166)
* fix rng and get_winner_numbers implemented

* coipied code for bitshares fixing 429 and 433 isuues

* ticket_purchase_operation implemented. added lottery_options to asset

* lottery end implemented

* minor logic changes. added db_api and cli_wallet methods

* fix reindex on peerplays network

* fix some tests. add gitlab-ci.yml

* add pull to gitlab-ci

* fix

* fix and comment some tests

* added owner to lottery_asset_options. commented async call in on_applied_block callback

* added get_account_lotteries method to db_api and cli, lottery end_date and ticket_price verification

* merge get_account_lotteries branch. fix create_witness test

* fix test genesis and end_date verification

* fixed indices sorting and lottery end checking by date

* update db_version for replay and removed duplicate include files

* Added ntp and upgraded boost version

* Revert "GPOS protocol"

* need to remove backup files

* virtual-op-fix for deterministic virtual_op number

* Merged beatrice into 5050

* Updated gitmodules, changes to allow voting on lottery fee

* Removed submodule libraries/fc

* Added libraries/fc

* added missing , in types.hpp

* Added sweeps parameters to parameter_extension

* added missing comma in operations.hpp, small changes to config.hpp

* fixed returntype in chain_parameters.hpp

* removed sweeps_parameter_extensions

* Changed fc library

* fixed asset_object

* Changed peerplays-fc submodule

* Changed fc submodule to ubuntu 18.04 upgrade

* Removed submodule libraries/fc

* Added fc library back

* fix casting in overloaded function

* Removed blind_sign and unblind_signature functions

* Added new lottery_asset_create_operation

* Changed sweeps hardfork time

* Removed redundant if from asset_evaluator and fixed db_notify

* fixed duplicate code in fee_tests

* removed redundant tgenesis file

* Enable building on Ubuntu 18.04 using GCC 7 compiler

* fix: is_benefactor_reward had the default value of true when not set

* Docker file for Ubuntu 18.04

Base image updated to Unbuntu 18.04
Prerequisite list updated
Basic configuration updated

* Quick fix: Added missing package pkg-config

* Docker file updates

* 5050 fee update and compilation error fix

* Dockerfile, set system locale

Prevents locale::facet::_S_create_c_locale name error

* Update README.md

Fix typo

* Update README.md

* Changed hardfork time for SWEEPS and Core-429

* revert master changes that were brought in previous commit

* Fixed error when account_history_object with id 0 doesnt exist

* Fixed error while loading object database

* test for zero id object in account history

* Reorder operations in Dockerfile, to make image creation faster

- Reorder prevents unnecessary building of Boost libraries

* Fix for irrelevant signature included issue

* fix copyrigth messages order

* remove double empty lines

* Backport fix for `get_account_history` from https://github.com/bitshares/bitshares-core/pull/628 and add additional account history test case

* NTP client back

* GRPH-53-Log_format_error

* Merge pull request #1036 from jmjatlanta/issue_730

Add fail_reason to proposal_object

* Unit test case fixes and prepared SONs base

* Use offsetof instead of custom macro

* Hide some compiler warnings

* Make all the tests compile

* Add nullptr check in api.cpp for easier testing

* Add test case for broadcast_trx_with_callback API

* Unit test case fixes and prepared SONs base

* Merge pull request #714 from pmconrad/json_fix

JSON fix

* Increase max depth for trx confirmation callback

* Adapt to variant API with `max_depth` argument

* Update fc submodule

* Created unit test for #325

* remove needless find()

* GRPH-4-CliWallet_crash_ctrlD

* fix copyright message

* Make all the tests compile

* increase delay for node connection

* Increase block creation timeout to 2500ms

* remove cache from cli get_account

* add cli tests framework

* Adjust newly merged code to new API

* Improved resilience of block database against corruption

* Merged changes from Bitshares PR 1036

* GRPH-76 - Short-cut long sequences of missed blocks

Fixes database::update_global_dynamic_data to speed up counting missed blocks.
(This also fixes a minor issue with counting - the previous algorithm would skip missed blocks for the witness who signed the first block after the gap.)

* Moved reindex logic into database / chain_database, make use of additional blocks in block_database

Fixed tests wrt db.open

* Enable undo + fork database for final blocks in a replay

Dont remove blocks from block db when popping blocks, handle edge case in replay wrt fork_db, adapted unit tests

* Log starting block number of replay

* Prevent unsigned integer underflow

* Fixed lock detection

* Dont leave _data_dir empty if db is locked

* Writing the object_database is now almost atomic

* Improved consistency check for block_log

* Cut back block_log index file if inconsistent

* Fixed undo_database

* Added test case for broken merge on empty undo_db

* Merge pull request #938 from bitshares/fix-block-storing

Store correct block ID when switching forks

* exclude second undo_db.enable() call in some cases

* Add missing change

* change bitshares to core in message

* Fixed integer overflow issue

* Fix for for history ID mismatch ( Bitshares PR #875 )

* Update the FC submodule with the changes for GRPH-4

* Fix #436 object_database created outside of witness data directory

* supplement more comments on database::_opened variable

* prevent segfault when destructing application obj

* Fixed duplicate ops returned from get_account_history

* minor performance improvement

* Added comment

* Merged Bitshares PR #1462 and compilation fixes

* Support/gitlab (#123)

* Updated gitlab process

* Fix undefined references in cli test

* Fixed test failures and compilation issue

* Fixed account_history_pagination test

* Fix compilation in debug mode

* Removed unrelated comment

* Skip auth check when pushing self-generated blocks

* Extract public keys before pushing a transaction

* Dereference chain_database shared_ptr

* Updated transaction::signees to mutable

and
* updated get_signature_keys() to return a const reference,
* get_signature_keys() will update signees on first call,
* modified test cases and wallet.cpp accordingly,
* no longer construct a new signed_transaction object before pushing

* Added get_asset_count API

* Allow sufficient space for new undo_session

* Throw for deep nesting

* No longer extract public keys before pushing a trx

and removed unused new added constructor and _get_signature_keys() function from signed_transaction struct

* Added cli_test to CI

* use random port numbers in app_test (#154)

* proposal fail_reason bug fixed (#157)

* Added Sonarcloud code_quality to CI (#159)

* Added sonarcloud analysis (#158)

* fix for lottery end

* fix declarations

* fix declarations

* fix boost integer

* fix compilation

* fix chain tests

* fix app_test

* try to fix cli test

* fix incorrect max_depth param

* working cli test

* correct fc version
2019-10-08 06:55:03 +05:30
Bobinson K B
324923b7b6
Merge pull request #135 from peerplays-network/SON11
Add chain extension parameter to set SON count
2019-09-23 08:31:44 -04:00
satyakoneru
b853a82275 SON11 - Add chain extension parameter to set SON count 2019-09-18 02:50:59 +00:00
obucinac
f8da5415e3
Part two of SON-83 - plugins option in command line and config file (#126)
- Empty SON plugin is INACTIVE by default
- To enable it, add peerplays_sidechain to plugins section in
  config file, or use --plugins command line option
- Plugin can work with or without witness
2019-09-13 17:34:34 +02:00
obucinac
7553091d02
Peerplays SON plugin skeleton (#122)
* Peerplays SON plugin skeleton
* SON tests skeleton
2019-09-11 20:29:48 +02:00
Bobinson K B
d1a2ea1c67
Merge pull request #124 from peerplays-network/feature/SONs-base-build-1804
Fix building on Ubuntu 18.04 with GCC 7
2019-09-11 09:55:15 -04:00
S
8f317e93d6 Fix building on Ubuntu 18.04 with GCC 7 2019-09-11 15:37:44 +02:00
68 changed files with 136 additions and 121 deletions

View file

@ -18,7 +18,7 @@ build:
- rm -rf build - rm -rf build
- mkdir build - mkdir build
- cd build - cd build
- cmake .. - cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j$(nproc) - make -j$(nproc)
artifacts: artifacts:
untracked: true untracked: true

View file

@ -38,7 +38,6 @@
#include <graphene/chain/tournament_object.hpp> #include <graphene/chain/tournament_object.hpp>
#include <fc/crypto/hex.hpp> #include <fc/crypto/hex.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/rpc/api_connection.hpp> #include <fc/rpc/api_connection.hpp>
#include <fc/thread/future.hpp> #include <fc/thread/future.hpp>

View file

@ -37,8 +37,6 @@
#include <graphene/utilities/key_conversion.hpp> #include <graphene/utilities/key_conversion.hpp>
#include <graphene/chain/worker_evaluator.hpp> #include <graphene/chain/worker_evaluator.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/io/fstream.hpp> #include <fc/io/fstream.hpp>
#include <fc/rpc/api_connection.hpp> #include <fc/rpc/api_connection.hpp>
#include <fc/rpc/websocket_api.hpp> #include <fc/rpc/websocket_api.hpp>
@ -80,7 +78,7 @@ namespace detail {
auto nathan_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan"))); 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))); dlog("Allocating all stake to ${key}", ("key", utilities::key_to_wif(nathan_key)));
genesis_state_type initial_state; 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.current_fees = std::make_shared<fee_schedule>(fee_schedule::get_default());
initial_state.initial_active_witnesses = GRAPHENE_DEFAULT_MIN_WITNESS_COUNT; 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_timestamp = time_point_sec(time_point::now().sec_since_epoch() /
initial_state.initial_parameters.block_interval * initial_state.initial_parameters.block_interval *

View file

@ -30,7 +30,6 @@
#include <graphene/chain/pts_address.hpp> #include <graphene/chain/pts_address.hpp>
#include <fc/bloom_filter.hpp> #include <fc/bloom_filter.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/crypto/hex.hpp> #include <fc/crypto/hex.hpp>
#include <fc/rpc/api_connection.hpp> #include <fc/rpc/api_connection.hpp>

View file

@ -43,6 +43,7 @@ add_library( graphene_chain
protocol/assert.cpp protocol/assert.cpp
protocol/account.cpp protocol/account.cpp
protocol/transfer.cpp protocol/transfer.cpp
protocol/chain_parameters.cpp
protocol/committee_member.cpp protocol/committee_member.cpp
protocol/witness.cpp protocol/witness.cpp
protocol/market.cpp protocol/market.cpp

View file

@ -22,8 +22,6 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <fc/smart_ref_impl.hpp>
#include <graphene/chain/account_evaluator.hpp> #include <graphene/chain/account_evaluator.hpp>
#include <graphene/chain/buyback.hpp> #include <graphene/chain/buyback.hpp>
#include <graphene/chain/buyback_object.hpp> #include <graphene/chain/buyback_object.hpp>

View file

@ -22,7 +22,6 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#define DEFAULT_LOGGER "betting" #define DEFAULT_LOGGER "betting"
#include <fc/smart_ref_impl.hpp>
#include <graphene/chain/betting_market_evaluator.hpp> #include <graphene/chain/betting_market_evaluator.hpp>
#include <graphene/chain/betting_market_object.hpp> #include <graphene/chain/betting_market_object.hpp>

View file

@ -24,7 +24,6 @@
#include <graphene/chain/block_database.hpp> #include <graphene/chain/block_database.hpp>
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
#include <fc/io/raw.hpp> #include <fc/io/raw.hpp>
#include <fc/smart_ref_impl.hpp>
namespace graphene { namespace chain { namespace graphene { namespace chain {

View file

@ -30,8 +30,6 @@
#include <graphene/chain/protocol/vote.hpp> #include <graphene/chain/protocol/vote.hpp>
#include <graphene/chain/transaction_evaluation_state.hpp> #include <graphene/chain/transaction_evaluation_state.hpp>
#include <fc/smart_ref_impl.hpp>
namespace graphene { namespace chain { namespace graphene { namespace chain {
void_result committee_member_create_evaluator::do_evaluate( const committee_member_create_operation& op ) void_result committee_member_create_evaluator::do_evaluate( const committee_member_create_operation& op )

View file

@ -29,8 +29,6 @@
#include <graphene/chain/fba_accumulator_id.hpp> #include <graphene/chain/fba_accumulator_id.hpp>
#include <graphene/chain/hardfork.hpp> #include <graphene/chain/hardfork.hpp>
#include <fc/smart_ref_impl.hpp>
namespace graphene { namespace chain { namespace graphene { namespace chain {
void_result transfer_to_blind_evaluator::do_evaluate( const transfer_to_blind_operation& o ) void_result transfer_to_blind_evaluator::do_evaluate( const transfer_to_blind_operation& o )

View file

@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <fc/smart_ref_impl.hpp>
#include "db_balance.cpp" #include "db_balance.cpp"
#include "db_bet.cpp" #include "db_bet.cpp"
#include "db_block.cpp" #include "db_block.cpp"

View file

@ -42,7 +42,6 @@
#include <graphene/chain/witness_schedule_object.hpp> #include <graphene/chain/witness_schedule_object.hpp>
#include <fc/crypto/digest.hpp> #include <fc/crypto/digest.hpp>
#include <fc/smart_ref_impl.hpp>
namespace { namespace {

View file

@ -34,8 +34,6 @@
#include <graphene/chain/son_object.hpp> #include <graphene/chain/son_object.hpp>
#include <graphene/chain/son_proposal_object.hpp> #include <graphene/chain/son_proposal_object.hpp>
#include <fc/smart_ref_impl.hpp>
#include <ctime> #include <ctime>
#include <algorithm> #include <algorithm>
@ -68,7 +66,7 @@ const dynamic_global_property_object& database::get_dynamic_global_properties()
const fee_schedule& database::current_fee_schedule()const const fee_schedule& database::current_fee_schedule()const
{ {
return get_global_properties().parameters.current_fees; return std::ref( *get_global_properties().parameters.current_fees );
} }
time_point_sec database::head_block_time()const time_point_sec database::head_block_time()const

View file

@ -103,7 +103,6 @@
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/uint128.hpp> #include <fc/uint128.hpp>
#include <fc/crypto/digest.hpp> #include <fc/crypto/digest.hpp>

View file

@ -24,7 +24,6 @@
#include <boost/multiprecision/integer.hpp> #include <boost/multiprecision/integer.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/uint128.hpp> #include <fc/uint128.hpp>
#include <graphene/chain/database.hpp> #include <graphene/chain/database.hpp>

View file

@ -24,7 +24,6 @@
#include <graphene/chain/fork_database.hpp> #include <graphene/chain/fork_database.hpp>
#include <graphene/chain/exceptions.hpp> #include <graphene/chain/exceptions.hpp>
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
#include <fc/smart_ref_impl.hpp>
namespace graphene { namespace chain { namespace graphene { namespace chain {
fork_database::fork_database() fork_database::fork_database()

View file

@ -25,7 +25,6 @@
#include <graphene/chain/genesis_state.hpp> #include <graphene/chain/genesis_state.hpp>
// these are required to serialize a genesis_state // these are required to serialize a genesis_state
#include <fc/smart_ref_impl.hpp> // required for gcc in release mode
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
namespace graphene { namespace chain { namespace graphene { namespace chain {

View file

@ -1,5 +1,7 @@
// SON HARDFORK Tuesday, October 20, 2020 00:00:00 UTC // SON HARDFORK Wednesday, January 1, 2020 12:00:00 AM - 1577836800
// SON HARDFORK Monday, March 30, 2020 3:00:00 PM - 1585573200
// SON HARDFORK Monday, September 21, 2020 1:43:11 PM - 1600695791
#ifndef HARDFORK_SON_TIME #ifndef HARDFORK_SON_TIME
#include <ctime> #include <ctime>
#define HARDFORK_SON_TIME (fc::time_point_sec( 1603152000 )) #define HARDFORK_SON_TIME (fc::time_point_sec( 1585573200 ))
#endif #endif

View file

@ -22,10 +22,10 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#pragma once #pragma once
#include <memory>
#include <graphene/chain/protocol/base.hpp> #include <graphene/chain/protocol/base.hpp>
#include <graphene/chain/protocol/ext.hpp> #include <graphene/chain/protocol/ext.hpp>
#include <graphene/chain/protocol/types.hpp> #include <graphene/chain/protocol/types.hpp>
#include <fc/smart_ref_fwd.hpp>
#include <graphene/chain/hardfork.hpp> #include <graphene/chain/hardfork.hpp>
#include <../hardfork.d/GPOS.hf> #include <../hardfork.d/GPOS.hf>
@ -72,8 +72,13 @@ namespace graphene { namespace chain {
struct chain_parameters struct chain_parameters
{ {
chain_parameters();
chain_parameters(const chain_parameters& other);
chain_parameters(chain_parameters&& other);
chain_parameters& operator=(const chain_parameters& other);
chain_parameters& operator=(chain_parameters&& other);
/** using a smart ref breaks the circular dependency created between operations and the fee schedule */ /** using a smart ref breaks the circular dependency created between operations and the fee schedule */
smart_ref<fee_schedule> current_fees; ///< current schedule of fees std::shared_ptr<fee_schedule> current_fees; ///< current schedule of fees
uint8_t block_interval = GRAPHENE_DEFAULT_BLOCK_INTERVAL; ///< interval in seconds between blocks uint8_t block_interval = GRAPHENE_DEFAULT_BLOCK_INTERVAL; ///< interval in seconds between blocks
uint32_t maintenance_interval = GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL; ///< interval in sections between blockchain maintenance events uint32_t maintenance_interval = GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL; ///< interval in sections between blockchain maintenance events
uint8_t maintenance_skip_slots = GRAPHENE_DEFAULT_MAINTENANCE_SKIP_SLOTS; ///< number of block_intervals to skip at maintenance time uint8_t maintenance_skip_slots = GRAPHENE_DEFAULT_MAINTENANCE_SKIP_SLOTS; ///< number of block_intervals to skip at maintenance time
@ -207,6 +212,8 @@ namespace graphene { namespace chain {
inline uint16_t maximum_son_count()const { inline uint16_t maximum_son_count()const {
return extensions.value.maximum_son_count.valid() ? *extensions.value.maximum_son_count : GRAPHENE_DEFAULT_MAX_SONS; return extensions.value.maximum_son_count.valid() ? *extensions.value.maximum_son_count : GRAPHENE_DEFAULT_MAX_SONS;
} }
private:
static void safe_copy(chain_parameters& to, const chain_parameters& from);
}; };
} } // graphene::chain } } // graphene::chain

View file

@ -22,7 +22,6 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#pragma once #pragma once
#include <fc/smart_ref_fwd.hpp>
#include <graphene/chain/protocol/operations.hpp> #include <graphene/chain/protocol/operations.hpp>
namespace graphene { namespace chain { namespace graphene { namespace chain {
@ -84,6 +83,10 @@ namespace graphene { namespace chain {
} } // graphene::chain } } // graphene::chain
namespace fc {
template<> struct get_typename<std::shared_ptr<graphene::chain::fee_schedule>> { static const char* name() { return "shared_ptr<fee_schedule>"; } };
}
FC_REFLECT_TYPENAME( graphene::chain::fee_parameters ) FC_REFLECT_TYPENAME( graphene::chain::fee_parameters )
FC_REFLECT( graphene::chain::fee_schedule, (parameters)(scale) ) FC_REFLECT( graphene::chain::fee_schedule, (parameters)(scale) )

View file

@ -38,7 +38,6 @@
#include <fc/io/raw_fwd.hpp> #include <fc/io/raw_fwd.hpp>
#include <fc/uint128.hpp> #include <fc/uint128.hpp>
#include <fc/static_variant.hpp> #include <fc/static_variant.hpp>
#include <fc/smart_ref_fwd.hpp>
#include <memory> #include <memory>
#include <vector> #include <vector>

View file

@ -35,7 +35,6 @@
#include <graphene/chain/protocol/market.hpp> #include <graphene/chain/protocol/market.hpp>
#include <fc/uint128.hpp> #include <fc/uint128.hpp>
#include <fc/smart_ref_impl.hpp>
namespace graphene { namespace chain { namespace graphene { namespace chain {
void_result limit_order_create_evaluator::do_evaluate(const limit_order_create_operation& op) void_result limit_order_create_evaluator::do_evaluate(const limit_order_create_operation& op)

View file

@ -32,8 +32,6 @@
#include <graphene/chain/exceptions.hpp> #include <graphene/chain/exceptions.hpp>
#include <graphene/chain/hardfork.hpp> #include <graphene/chain/hardfork.hpp>
#include <fc/smart_ref_impl.hpp>
namespace graphene { namespace chain { namespace graphene { namespace chain {
struct proposal_operation_hardfork_visitor struct proposal_operation_hardfork_visitor

View file

@ -0,0 +1,92 @@
#include <graphene/chain/protocol/chain_parameters.hpp>
#include <graphene/chain/protocol/fee_schedule.hpp>
namespace graphene { namespace chain {
chain_parameters::chain_parameters() {
current_fees = std::make_shared<fee_schedule>();
}
// copy constructor
chain_parameters::chain_parameters(const chain_parameters& other)
{
current_fees = std::make_shared<fee_schedule>(*other.current_fees);
safe_copy(*this, other);
}
// copy assignment
chain_parameters& chain_parameters::operator=(const chain_parameters& other)
{
if (&other != this)
{
current_fees = std::make_shared<fee_schedule>(*other.current_fees);
safe_copy(*this, other);
}
return *this;
}
// copies the easy stuff
void chain_parameters::safe_copy(chain_parameters& to, const chain_parameters& from)
{
to.block_interval = from.block_interval;
to.maintenance_interval = from.maintenance_interval;
to.maintenance_skip_slots = from.maintenance_skip_slots;
to.committee_proposal_review_period = from.committee_proposal_review_period;
to.maximum_transaction_size = from.maximum_transaction_size;
to.maximum_block_size = from.maximum_block_size;
to.maximum_time_until_expiration = from.maximum_time_until_expiration;
to.maximum_proposal_lifetime = from.maximum_proposal_lifetime;
to.maximum_asset_whitelist_authorities = from.maximum_asset_whitelist_authorities;
to.maximum_asset_feed_publishers = from.maximum_asset_feed_publishers;
to.maximum_witness_count = from.maximum_witness_count;
to.maximum_committee_count = from.maximum_committee_count;
to.maximum_authority_membership = from.maximum_authority_membership;
to.reserve_percent_of_fee = from.reserve_percent_of_fee;
to.network_percent_of_fee = from.network_percent_of_fee;
to.lifetime_referrer_percent_of_fee = from.lifetime_referrer_percent_of_fee;
to.cashback_vesting_period_seconds = from.cashback_vesting_period_seconds;
to.cashback_vesting_threshold = from.cashback_vesting_threshold;
to.count_non_member_votes = from.count_non_member_votes;
to.allow_non_member_whitelists = from.allow_non_member_whitelists;
to.witness_pay_per_block = from.witness_pay_per_block;
to.witness_pay_vesting_seconds = from.witness_pay_vesting_seconds;
to.worker_budget_per_day = from.worker_budget_per_day;
to.max_predicate_opcode = from.max_predicate_opcode;
to.fee_liquidation_threshold = from.fee_liquidation_threshold;
to.accounts_per_fee_scale = from.accounts_per_fee_scale;
to.account_fee_scale_bitshifts = from.account_fee_scale_bitshifts;
to.max_authority_depth = from.max_authority_depth;
to.witness_schedule_algorithm= from.witness_schedule_algorithm;
to.min_round_delay = from.min_round_delay;
to.max_round_delay = from.max_round_delay;
to.min_time_per_commit_move = from.min_time_per_commit_move;
to.max_time_per_commit_move = from.max_time_per_commit_move;
to.min_time_per_reveal_move = from.min_time_per_reveal_move;
to.max_time_per_reveal_move = from.max_time_per_reveal_move;
to.rake_fee_percentage = from.rake_fee_percentage;
to.maximum_registration_deadline = from.maximum_registration_deadline;
to.maximum_players_in_tournament = from.maximum_players_in_tournament;
to.maximum_tournament_whitelist_length = from.maximum_tournament_whitelist_length;
to.maximum_tournament_start_time_in_future= from.maximum_tournament_start_time_in_future;
to.maximum_tournament_start_delay = from.maximum_tournament_start_delay;
to.maximum_tournament_number_of_wins = from.maximum_tournament_number_of_wins;
to.extensions = from.extensions;
}
// move constructor
chain_parameters::chain_parameters(chain_parameters&& other)
{
current_fees = std::move(other.current_fees);
safe_copy(*this, other);
}
// move assignment
chain_parameters& chain_parameters::operator=(chain_parameters&& other)
{
if (&other != this)
{
current_fees = std::move(other.current_fees);
safe_copy(*this, other);
}
return *this;
}
}}

View file

@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <fc/smart_ref_impl.hpp>
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
#include <graphene/chain/protocol/committee_member.hpp> #include <graphene/chain/protocol/committee_member.hpp>

View file

@ -23,17 +23,6 @@
*/ */
#include <algorithm> #include <algorithm>
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
#include <fc/smart_ref_impl.hpp>
namespace fc
{
// explicitly instantiate the smart_ref, gcc fails to instantiate it in some release builds
//template graphene::chain::fee_schedule& smart_ref<graphene::chain::fee_schedule>::operator=(smart_ref<graphene::chain::fee_schedule>&&);
//template graphene::chain::fee_schedule& smart_ref<graphene::chain::fee_schedule>::operator=(U&&);
//template graphene::chain::fee_schedule& smart_ref<graphene::chain::fee_schedule>::operator=(const smart_ref&);
//template smart_ref<graphene::chain::fee_schedule>::smart_ref();
//template const graphene::chain::fee_schedule& smart_ref<graphene::chain::fee_schedule>::operator*() const;
}
#include <fc/io/raw.hpp> #include <fc/io/raw.hpp>
@ -41,10 +30,6 @@ namespace fc
namespace graphene { namespace chain { namespace graphene { namespace chain {
typedef fc::smart_ref<fee_schedule> smart_fee_schedule;
static smart_fee_schedule tmp;
fee_schedule::fee_schedule() fee_schedule::fee_schedule()
{ {
} }

View file

@ -21,7 +21,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <fc/smart_ref_impl.hpp>
#include <graphene/chain/protocol/operations.hpp> #include <graphene/chain/protocol/operations.hpp>
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
#include <fc/io/raw.hpp> #include <fc/io/raw.hpp>

View file

@ -23,7 +23,6 @@
*/ */
#include <graphene/chain/protocol/operations.hpp> #include <graphene/chain/protocol/operations.hpp>
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/io/raw.hpp> #include <fc/io/raw.hpp>

View file

@ -22,7 +22,6 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <fc/smart_ref_impl.hpp>
#include <graphene/chain/protocol/balance.hpp> #include <graphene/chain/protocol/balance.hpp>
#include <graphene/chain/protocol/buyback.hpp> #include <graphene/chain/protocol/buyback.hpp>
#include <graphene/chain/protocol/fba.hpp> #include <graphene/chain/protocol/fba.hpp>

View file

@ -25,7 +25,6 @@
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
#include <fc/io/raw.hpp> #include <fc/io/raw.hpp>
#include <fc/bitutil.hpp> #include <fc/bitutil.hpp>
#include <fc/smart_ref_impl.hpp>
#include <algorithm> #include <algorithm>
#include <fc/io/raw.hpp> #include <fc/io/raw.hpp>
@ -106,6 +105,7 @@ void transaction::get_required_authorities( flat_set<account_id_type>& active,
const flat_set<public_key_type> empty_keyset;
struct sign_state struct sign_state
{ {
@ -231,7 +231,7 @@ struct sign_state
sign_state( const flat_set<public_key_type>& sigs, sign_state( const flat_set<public_key_type>& sigs,
const std::function<const authority*(account_id_type)>& a, const std::function<const authority*(account_id_type)>& a,
const flat_set<public_key_type>& keys = flat_set<public_key_type>() ) const flat_set<public_key_type>& keys = empty_keyset )
:get_active(a),available_keys(keys) :get_active(a),available_keys(keys)
{ {
for( const auto& key : sigs ) for( const auto& key : sigs )
@ -446,7 +446,7 @@ void signed_transaction::verify_authority(
bool ignore_custom_operation_required_auths, bool ignore_custom_operation_required_auths,
uint32_t max_recursion )const uint32_t max_recursion )const
{ try { { try {
graphene::chain::verify_authority( operations, get_signature_keys( chain_id ), get_active, get_owner, get_custom, max_recursion ); graphene::chain::verify_authority( operations, get_signature_keys( chain_id ), get_active, get_owner, get_custom, ignore_custom_operation_required_auths, max_recursion );
} FC_CAPTURE_AND_RETHROW( (*this) ) } } FC_CAPTURE_AND_RETHROW( (*this) ) }
} } // graphene::chain } } // graphene::chain

View file

@ -44,7 +44,6 @@
#include <graphene/chain/worker_object.hpp> #include <graphene/chain/worker_object.hpp>
#include <fc/io/raw.hpp> #include <fc/io/raw.hpp>
#include <fc/smart_ref_impl.hpp>
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::balance_object ) GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::balance_object )
GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::block_summary_object ) GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::block_summary_object )

View file

@ -73,7 +73,7 @@ namespace graphene { namespace chain {
[&m, &exc](ObjectType& o) mutable { [&m, &exc](ObjectType& o) mutable {
try { try {
m(o); m(o);
} catch (fc::exception e) { } catch (fc::exception& e) {
exc = std::current_exception(); exc = std::current_exception();
elog("Exception while modifying object: ${e} -- object may be corrupted", elog("Exception while modifying object: ${e} -- object may be corrupted",
("e", e)); ("e", e));

View file

@ -30,7 +30,6 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <fc/filesystem.hpp> #include <fc/filesystem.hpp>
#include <fc/smart_ref_impl.hpp> // required for gcc in release mode
#include <fc/string.hpp> #include <fc/string.hpp>
#include <fc/io/fstream.hpp> #include <fc/io/fstream.hpp>
#include <fc/io/json.hpp> #include <fc/io/json.hpp>

View file

@ -70,7 +70,6 @@
#include <fc/crypto/rand.hpp> #include <fc/crypto/rand.hpp>
#include <fc/network/rate_limiting.hpp> #include <fc/network/rate_limiting.hpp>
#include <fc/network/ip.hpp> #include <fc/network/ip.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/net/node.hpp> #include <graphene/net/node.hpp>
#include <graphene/net/peer_database.hpp> #include <graphene/net/peer_database.hpp>

View file

@ -35,7 +35,6 @@
#include <graphene/chain/transaction_evaluation_state.hpp> #include <graphene/chain/transaction_evaluation_state.hpp>
#include <graphene/chain/hardfork.hpp> #include <graphene/chain/hardfork.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
namespace graphene { namespace account_history { namespace graphene { namespace account_history {

View file

@ -34,7 +34,6 @@
#include <graphene/chain/operation_history_object.hpp> #include <graphene/chain/operation_history_object.hpp>
#include <graphene/chain/transaction_evaluation_state.hpp> #include <graphene/chain/transaction_evaluation_state.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
namespace graphene { namespace accounts_list { namespace graphene { namespace accounts_list {

View file

@ -24,7 +24,6 @@
#include <fc/optional.hpp> #include <fc/optional.hpp>
#include <fc/variant_object.hpp> #include <fc/variant_object.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/app/application.hpp> #include <graphene/app/application.hpp>

View file

@ -35,7 +35,6 @@
#include <graphene/chain/operation_history_object.hpp> #include <graphene/chain/operation_history_object.hpp>
#include <graphene/chain/transaction_evaluation_state.hpp> #include <graphene/chain/transaction_evaluation_state.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
namespace graphene { namespace affiliate_stats { namespace graphene { namespace affiliate_stats {

View file

@ -24,7 +24,6 @@
#include <fc/filesystem.hpp> #include <fc/filesystem.hpp>
#include <fc/optional.hpp> #include <fc/optional.hpp>
#include <fc/variant_object.hpp> #include <fc/variant_object.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/app/application.hpp> #include <graphene/app/application.hpp>

View file

@ -36,7 +36,6 @@
#include <boost/algorithm/string/case_conv.hpp> #include <boost/algorithm/string/case_conv.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
#include <boost/polymorphic_cast.hpp> #include <boost/polymorphic_cast.hpp>

View file

@ -2,7 +2,6 @@
#include <fc/filesystem.hpp> #include <fc/filesystem.hpp>
#include <fc/optional.hpp> #include <fc/optional.hpp>
#include <fc/variant_object.hpp> #include <fc/variant_object.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/app/application.hpp> #include <graphene/app/application.hpp>

View file

@ -28,7 +28,6 @@
#include <graphene/utilities/key_conversion.hpp> #include <graphene/utilities/key_conversion.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
#include <iostream> #include <iostream>

View file

@ -30,8 +30,6 @@
#include <fc/network/http/websocket.hpp> #include <fc/network/http/websocket.hpp>
#include <fc/rpc/websocket_api.hpp> #include <fc/rpc/websocket_api.hpp>
#include <fc/api.hpp> #include <fc/api.hpp>
#include <fc/smart_ref_impl.hpp>
namespace graphene { namespace delayed_node { namespace graphene { namespace delayed_node {
namespace bpo = boost::program_options; namespace bpo = boost::program_options;

View file

@ -24,8 +24,6 @@
#include <graphene/es_objects/es_objects.hpp> #include <graphene/es_objects/es_objects.hpp>
#include <fc/smart_ref_impl.hpp>
#include <curl/curl.h> #include <curl/curl.h>
#include <graphene/chain/proposal_object.hpp> #include <graphene/chain/proposal_object.hpp>
#include <graphene/chain/balance_object.hpp> #include <graphene/chain/balance_object.hpp>

View file

@ -29,7 +29,6 @@
#include <graphene/utilities/key_conversion.hpp> #include <graphene/utilities/key_conversion.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
#include <graphene/chain/market_object.hpp> #include <graphene/chain/market_object.hpp>

View file

@ -29,7 +29,6 @@
#include <graphene/utilities/key_conversion.hpp> #include <graphene/utilities/key_conversion.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
#include <graphene/chain/market_object.hpp> #include <graphene/chain/market_object.hpp>

View file

@ -34,7 +34,6 @@
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
#include <fc/smart_ref_impl.hpp>
namespace graphene { namespace market_history { namespace graphene { namespace market_history {

View file

@ -5,8 +5,6 @@
#include <boost/range/algorithm_ext/insert.hpp> #include <boost/range/algorithm_ext/insert.hpp>
#include <fc/log/logger.hpp> #include <fc/log/logger.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/chain/proposal_object.hpp> #include <graphene/chain/proposal_object.hpp>
#include <graphene/chain/protocol/transfer.hpp> #include <graphene/chain/protocol/transfer.hpp>
#include <graphene/chain/sidechain_address_object.hpp> #include <graphene/chain/sidechain_address_object.hpp>

View file

@ -1,7 +1,6 @@
#include <graphene/peerplays_sidechain/sidechain_net_handler.hpp> #include <graphene/peerplays_sidechain/sidechain_net_handler.hpp>
#include <fc/log/logger.hpp> #include <fc/log/logger.hpp>
#include <fc/smart_ref_fwd.hpp>
#include <graphene/chain/chain_property_object.hpp> #include <graphene/chain/chain_property_object.hpp>
#include <graphene/chain/proposal_object.hpp> #include <graphene/chain/proposal_object.hpp>

View file

@ -11,7 +11,6 @@
#include <fc/crypto/hex.hpp> #include <fc/crypto/hex.hpp>
#include <fc/log/logger.hpp> #include <fc/log/logger.hpp>
#include <fc/network/ip.hpp> #include <fc/network/ip.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/chain/account_object.hpp> #include <graphene/chain/account_object.hpp>
#include <graphene/chain/protocol/fee_schedule.hpp> #include <graphene/chain/protocol/fee_schedule.hpp>

View file

@ -30,7 +30,6 @@
#include <boost/range/algorithm_ext/insert.hpp> #include <boost/range/algorithm_ext/insert.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
#include <iostream> #include <iostream>

View file

@ -84,7 +84,6 @@
#include <graphene/wallet/api_documentation.hpp> #include <graphene/wallet/api_documentation.hpp>
#include <graphene/wallet/reflect_util.hpp> #include <graphene/wallet/reflect_util.hpp>
#include <graphene/debug_witness/debug_api.hpp> #include <graphene/debug_witness/debug_api.hpp>
#include <fc/smart_ref_impl.hpp>
#ifndef WIN32 #ifndef WIN32
# include <sys/types.h> # include <sys/types.h>
@ -662,10 +661,10 @@ public:
return ob.template as<T>( GRAPHENE_MAX_NESTED_OBJECTS ); return ob.template as<T>( GRAPHENE_MAX_NESTED_OBJECTS );
} }
void set_operation_fees( signed_transaction& tx, const fee_schedule& s ) void set_operation_fees( signed_transaction& tx, std::shared_ptr<fee_schedule> s )
{ {
for( auto& op : tx.operations ) for( auto& op : tx.operations )
s.set_fee(op); s->set_fee(op);
} }
variant info() const variant info() const
@ -1307,8 +1306,7 @@ public:
tx.operations.push_back( account_create_op ); tx.operations.push_back( account_create_op );
auto current_fees = _remote_db->get_global_properties().parameters.current_fees; set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees );
set_operation_fees( tx, current_fees );
vector<public_key_type> paying_keys = registrar_account_object.active.get_keys(); vector<public_key_type> paying_keys = registrar_account_object.active.get_keys();
@ -3496,7 +3494,7 @@ public:
new_fees.scale = scale; new_fees.scale = scale;
chain_parameters new_params = current_params; chain_parameters new_params = current_params;
new_params.current_fees = new_fees; new_params.current_fees = std::make_shared<fee_schedule>(new_fees);
committee_member_update_global_parameters_operation update_op; committee_member_update_global_parameters_operation update_op;
update_op.new_parameters = new_params; update_op.new_parameters = new_params;

View file

@ -28,7 +28,6 @@
#include <graphene/chain/account_object.hpp> #include <graphene/chain/account_object.hpp>
#include <graphene/chain/balance_object.hpp> #include <graphene/chain/balance_object.hpp>
#include <graphene/chain/committee_member_object.hpp> #include <graphene/chain/committee_member_object.hpp>
#include <fc/smart_ref_impl.hpp>
#include <iostream> #include <iostream>
using namespace graphene::chain; using namespace graphene::chain;

View file

@ -34,7 +34,6 @@
#include <fc/rpc/cli.hpp> #include <fc/rpc/cli.hpp>
#include <fc/rpc/http_api.hpp> #include <fc/rpc/http_api.hpp>
#include <fc/rpc/websocket_api.hpp> #include <fc/rpc/websocket_api.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/app/api.hpp> #include <graphene/app/api.hpp>
#include <graphene/chain/config.hpp> #include <graphene/chain/config.hpp>

View file

@ -30,7 +30,6 @@
#include <fc/io/fstream.hpp> #include <fc/io/fstream.hpp>
#include <fc/io/json.hpp> #include <fc/io/json.hpp>
#include <fc/io/stdio.hpp> #include <fc/io/stdio.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/app/api.hpp> #include <graphene/app/api.hpp>
#include <graphene/chain/protocol/address.hpp> #include <graphene/chain/protocol/address.hpp>

View file

@ -55,7 +55,6 @@
#include <graphene/chain/sidechain_address_object.hpp> #include <graphene/chain/sidechain_address_object.hpp>
#include <graphene/chain/sidechain_transaction_object.hpp> #include <graphene/chain/sidechain_transaction_object.hpp>
#include <fc/smart_ref_impl.hpp>
#include <iostream> #include <iostream>
using namespace graphene::chain; using namespace graphene::chain;
@ -128,7 +127,6 @@ struct js_name<fc::array<T,N>>
template<size_t N> struct js_name<fc::array<char,N>> { static std::string name(){ return "bytes "+ fc::to_string(N); }; }; template<size_t N> struct js_name<fc::array<char,N>> { static std::string name(){ return "bytes "+ fc::to_string(N); }; };
template<size_t N> struct js_name<fc::array<uint8_t,N>> { static std::string name(){ return "bytes "+ fc::to_string(N); }; }; template<size_t N> struct js_name<fc::array<uint8_t,N>> { static std::string name(){ return "bytes "+ fc::to_string(N); }; };
template<typename T> struct js_name< fc::optional<T> > { static std::string name(){ return "optional " + js_name<T>::name(); } }; template<typename T> struct js_name< fc::optional<T> > { static std::string name(){ return "optional " + js_name<T>::name(); } };
template<typename T> struct js_name< fc::smart_ref<T> > { static std::string name(){ return js_name<T>::name(); } };
template<> struct js_name< object_id_type > { static std::string name(){ return "object_id_type"; } }; template<> struct js_name< object_id_type > { static std::string name(){ return "object_id_type"; } };
template<typename T> struct js_name< fc::flat_set<T> > { static std::string name(){ return "set " + js_name<T>::name(); } }; template<typename T> struct js_name< fc::flat_set<T> > { static std::string name(){ return "set " + js_name<T>::name(); } };
template<typename T> struct js_name< std::vector<T> > { static std::string name(){ return "array " + js_name<T>::name(); } }; template<typename T> struct js_name< std::vector<T> > { static std::string name(){ return "array " + js_name<T>::name(); } };
@ -256,14 +254,6 @@ struct serializer<std::vector<T>,false>
static void generate() {} static void generate() {}
}; };
template<typename T>
struct serializer<fc::smart_ref<T>,false>
{
static void init() {
serializer<T>::init(); }
static void generate() {}
};
template<> template<>
struct serializer<std::vector<operation>,false> struct serializer<std::vector<operation>,false>
{ {

View file

@ -23,7 +23,6 @@
*/ */
#include <fc/io/json.hpp> #include <fc/io/json.hpp>
#include <fc/smart_ref_impl.hpp>
#include <fc/variant.hpp> #include <fc/variant.hpp>
#include <fc/variant_object.hpp> #include <fc/variant_object.hpp>

View file

@ -35,7 +35,6 @@
#include <graphene/affiliate_stats/affiliate_stats_plugin.hpp> #include <graphene/affiliate_stats/affiliate_stats_plugin.hpp>
#include <graphene/market_history/market_history_plugin.hpp> #include <graphene/market_history/market_history_plugin.hpp>
#include <fc/thread/thread.hpp> #include <fc/thread/thread.hpp>
#include <fc/smart_ref_impl.hpp>
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>

View file

@ -26,7 +26,6 @@
#include <graphene/utilities/tempdir.hpp> #include <graphene/utilities/tempdir.hpp>
#include <fc/crypto/digest.hpp> #include <fc/crypto/digest.hpp>
#include <fc/smart_ref_impl.hpp>
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>

View file

@ -1877,10 +1877,11 @@ BOOST_AUTO_TEST_CASE(event_group_delete_test_not_existed_event_group)
try try
{ {
CREATE_ICE_HOCKEY_BETTING_MARKET(false, 0); CREATE_ICE_HOCKEY_BETTING_MARKET(false, 0);
event_group_id_type nhl_id = nhl.id;
delete_event_group(nhl_id);
delete_event_group(nhl.id);
BOOST_CHECK_THROW(delete_event_group(nhl.id), fc::exception); BOOST_CHECK_THROW(delete_event_group(nhl_id), fc::exception);
} FC_LOG_AND_RETHROW() } FC_LOG_AND_RETHROW()
} }

View file

@ -12,7 +12,6 @@
#include <fc/crypto/base58.hpp> #include <fc/crypto/base58.hpp>
#include <fc/crypto/aes.hpp> #include <fc/crypto/aes.hpp>
#include <fc/smart_ref_impl.hpp>
#ifdef _WIN32 #ifdef _WIN32
#ifndef _WIN32_WINNT #ifndef _WIN32_WINNT

View file

@ -24,7 +24,6 @@
#include "cli_fixture.hpp" #include "cli_fixture.hpp"
#include <fc/crypto/aes.hpp> #include <fc/crypto/aes.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/utilities/tempdir.hpp> #include <graphene/utilities/tempdir.hpp>

View file

@ -23,7 +23,6 @@
*/ */
#include "cli_fixture.hpp" #include "cli_fixture.hpp"
#include <fc/smart_ref_impl.hpp>
#include <fc/string.hpp> #include <fc/string.hpp>
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>

View file

@ -48,7 +48,6 @@
#include <graphene/utilities/tempdir.hpp> #include <graphene/utilities/tempdir.hpp>
#include <fc/crypto/digest.hpp> #include <fc/crypto/digest.hpp>
#include <fc/smart_ref_impl.hpp>
#include <exception> #include <exception>
#include <iostream> #include <iostream>
@ -712,7 +711,7 @@ void database_fixture::change_fees(
new_fees.scale = new_scale; new_fees.scale = new_scale;
chain_parameters new_chain_params = current_chain_params; chain_parameters new_chain_params = current_chain_params;
new_chain_params.current_fees = new_fees; new_chain_params.current_fees = std::make_shared<fee_schedule>(new_fees);
db.modify(db.get_global_properties(), [&](global_property_object& p) { db.modify(db.get_global_properties(), [&](global_property_object& p) {
p.parameters = new_chain_params; p.parameters = new_chain_params;
@ -1039,7 +1038,7 @@ void database_fixture::enable_fees()
{ {
db.modify(global_property_id_type()(db), [](global_property_object& gpo) db.modify(global_property_id_type()(db), [](global_property_object& gpo)
{ {
gpo.parameters.current_fees = fee_schedule::get_default(); gpo.parameters.current_fees = std::make_shared<fee_schedule>(fee_schedule::get_default());
}); });
} }

View file

@ -26,7 +26,6 @@
#include <graphene/app/application.hpp> #include <graphene/app/application.hpp>
#include <graphene/chain/database.hpp> #include <graphene/chain/database.hpp>
#include <fc/io/json.hpp> #include <fc/io/json.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/chain/operation_history_object.hpp> #include <graphene/chain/operation_history_object.hpp>

View file

@ -30,7 +30,6 @@
#include <fc/io/fstream.hpp> #include <fc/io/fstream.hpp>
#include <fc/io/json.hpp> #include <fc/io/json.hpp>
#include <fc/io/stdio.hpp> #include <fc/io/stdio.hpp>
#include <fc/smart_ref_impl.hpp>
#include <graphene/app/api.hpp> #include <graphene/app/api.hpp>
#include <graphene/chain/protocol/protocol.hpp> #include <graphene/chain/protocol/protocol.hpp>

View file

@ -22,7 +22,6 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <fc/smart_ref_impl.hpp>
#include <fc/uint128.hpp> #include <fc/uint128.hpp>
#include <graphene/chain/hardfork.hpp> #include <graphene/chain/hardfork.hpp>
@ -334,7 +333,7 @@ BOOST_AUTO_TEST_CASE( cashback_test )
upgrade_to_lifetime_member(rog_id); upgrade_to_lifetime_member(rog_id);
BOOST_TEST_MESSAGE("Enable fees"); BOOST_TEST_MESSAGE("Enable fees");
const auto& fees = db.get_global_properties().parameters.current_fees; const auto& fees = *db.get_global_properties().parameters.current_fees;
#define CustomRegisterActor(actor_name, registrar_name, referrer_name, referrer_rate) \ #define CustomRegisterActor(actor_name, registrar_name, referrer_name, referrer_rate) \
{ \ { \
@ -346,7 +345,7 @@ BOOST_AUTO_TEST_CASE( cashback_test )
op.options.memo_key = actor_name ## _private_key.get_public_key(); \ op.options.memo_key = actor_name ## _private_key.get_public_key(); \
op.active = authority(1, public_key_type(actor_name ## _private_key.get_public_key()), 1); \ op.active = authority(1, public_key_type(actor_name ## _private_key.get_public_key()), 1); \
op.owner = op.active; \ op.owner = op.active; \
op.fee = fees->calculate_fee(op); \ op.fee = fees.calculate_fee(op); \
trx.operations = {op}; \ trx.operations = {op}; \
sign( trx, registrar_name ## _private_key ); \ sign( trx, registrar_name ## _private_key ); \
actor_name ## _id = PUSH_TX( db, trx ).operation_results.front().get<object_id_type>(); \ actor_name ## _id = PUSH_TX( db, trx ).operation_results.front().get<object_id_type>(); \
@ -372,10 +371,10 @@ BOOST_AUTO_TEST_CASE( cashback_test )
CustomAuditActor( pleb ); \ CustomAuditActor( pleb ); \
} }
int64_t reg_fee = fees->get< account_create_operation >().premium_fee; int64_t reg_fee = fees.get< account_create_operation >().premium_fee;
int64_t xfer_fee = fees->get< transfer_operation >().fee; int64_t xfer_fee = fees.get< transfer_operation >().fee;
int64_t upg_an_fee = fees->get< account_upgrade_operation >().membership_annual_fee; int64_t upg_an_fee = fees.get< account_upgrade_operation >().membership_annual_fee;
int64_t upg_lt_fee = fees->get< account_upgrade_operation >().membership_lifetime_fee; int64_t upg_lt_fee = fees.get< account_upgrade_operation >().membership_lifetime_fee;
// all percentages here are cut from whole pie! // all percentages here are cut from whole pie!
uint64_t network_pct = 20 * P1; uint64_t network_pct = 20 * P1;
uint64_t lt_pct = 375 * P100 / 1000; uint64_t lt_pct = 375 * P100 / 1000;
@ -582,7 +581,7 @@ BOOST_AUTO_TEST_CASE( account_create_fee_scaling )
auto accounts_per_scale = db.get_global_properties().parameters.accounts_per_fee_scale; auto accounts_per_scale = db.get_global_properties().parameters.accounts_per_fee_scale;
db.modify(global_property_id_type()(db), [](global_property_object& gpo) db.modify(global_property_id_type()(db), [](global_property_object& gpo)
{ {
gpo.parameters.current_fees = fee_schedule::get_default(); gpo.parameters.current_fees = std::make_shared<fee_schedule>(fee_schedule::get_default());
gpo.parameters.current_fees->get<account_create_operation>().basic_fee = 1; gpo.parameters.current_fees->get<account_create_operation>().basic_fee = 1;
}); });
@ -1004,8 +1003,9 @@ BOOST_AUTO_TEST_CASE( issue_429_test )
// make sure the database requires our fee to be nonzero // make sure the database requires our fee to be nonzero
enable_fees(); enable_fees();
auto fees_to_pay = db.get_global_properties().parameters.current_fees->get<asset_create_operation>(); const auto& fees = *db.get_global_properties().parameters.current_fees;
auto fees_to_pay = fees.get<asset_create_operation>();
{ {
signed_transaction tx; signed_transaction tx;
asset_create_operation op; asset_create_operation op;

View file

@ -30,7 +30,6 @@
#include "../common/database_fixture.hpp" #include "../common/database_fixture.hpp"
#include <fc/smart_ref_impl.hpp>
#include <fc/crypto/digest.hpp> #include <fc/crypto/digest.hpp>
using namespace graphene::app; using namespace graphene::app;