{"action":"created","issue":{"url":"https://api.github.com/repos/OmniLayer/omnicore/issues/144","labels_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/144/comments","events_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/144/events","html_url":"https://github.com/OmniLayer/omnicore/pull/144","id":96921222,"number":144,"title":"Introduce global object for consensus parameters","user":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OmniLayer/omnicore/labels/ready%20for%20review","name":"ready for review","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-07-23T22:50:33Z","updated_at":"2015-08-03T09:48:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OmniLayer/omnicore/pulls/144","html_url":"https://github.com/OmniLayer/omnicore/pull/144","diff_url":"https://github.com/OmniLayer/omnicore/pull/144.diff","patch_url":"https://github.com/OmniLayer/omnicore/pull/144.patch"},"body":"A new base class `CConsensusParams` provides a blueprint for consensus related parameters. The child classes `CMainConsensusParams`, `CTestNetConsensusParams` and `CRegTestConsensusParams` are the actual classes to use, and embed related information for each network.\r\n\r\n`ConsensusParams()` is used to access the currently active consensus parameters. The first time this function is called, the parameters are initialized, based on the currently active network.\r\n\r\nThis allows to finer control over consensus rules for the different networks."},"comment":{"url":"https://api.github.com/repos/OmniLayer/omnicore/issues/comments/127180357","html_url":"https://github.com/OmniLayer/omnicore/pull/144#issuecomment-127180357","issue_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/144","id":127180357,"user":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T09:48:38Z","updated_at":"2015-08-03T09:48:38Z","body":"> Speaking of Travis, my feature activation branch fails, I understand this one because I changed the value to test activations for MetaDEx on testnet\r\n\r\nCould you point me to the commit, where you changed the activations?\r\n\r\nI sort of assumed this will happen at some point, if I use hardcoded values for the tests.\r\n\r\nThe `params_tests.cpp` test fails due to the [following lines](https://github.com/dexX7/bitcoin/blob/oc-0.10-consensus-params/src/omnicore/test/params_tests.cpp#L28-L33):\r\n```c++\r\nBOOST_AUTO_TEST_CASE(network_restrictions_test)\r\n{\r\n    const CConsensusParams& params = ConsensusParams(\"test\");\r\n    BOOST_CHECK_EQUAL(params.MSC_STO_BLOCK, 0);\r\n    BOOST_CHECK_EQUAL(params.MSC_METADEX_BLOCK, 0);\r\n}\r\n```\r\n\r\nIf you changed the activation block for the MetaDEx on testnet, then the last line won't pass. In this case I suggest to replace the 0. I wanted to show with the test that the correct height is retrieved from the params, and that the height is a different one than the one used on mainnet.\r\n\r\nAnd the [other one](https://github.com/dexX7/bitcoin/blob/oc-0.10-consensus-params/src/omnicore/test/rules_txs_tests.cpp#L31):\r\n```c++\r\nBOOST_CHECK(IsTransactionTypeAllowed(0, OMNI_PROPERTY_TMSC, MSC_TYPE_SIMPLE_SEND, MP_TX_PKT_V0));\r\n```\r\n... which is a bit strange actually."}}