{"action":"created","issue":{"url":"https://api.github.com/repos/OmniLayer/omnicore/issues/13","labels_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/13/comments","events_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/13/events","html_url":"https://github.com/OmniLayer/omnicore/pull/13","id":66779714,"number":13,"title":"Rework tx creation + implement Class C & missing transactions","user":{"login":"zathras-crypto","id":5633351,"avatar_url":"https://avatars.githubusercontent.com/u/5633351?v=3","gravatar_id":"","url":"https://api.github.com/users/zathras-crypto","html_url":"https://github.com/zathras-crypto","followers_url":"https://api.github.com/users/zathras-crypto/followers","following_url":"https://api.github.com/users/zathras-crypto/following{/other_user}","gists_url":"https://api.github.com/users/zathras-crypto/gists{/gist_id}","starred_url":"https://api.github.com/users/zathras-crypto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zathras-crypto/subscriptions","organizations_url":"https://api.github.com/users/zathras-crypto/orgs","repos_url":"https://api.github.com/users/zathras-crypto/repos","events_url":"https://api.github.com/users/zathras-crypto/events{/privacy}","received_events_url":"https://api.github.com/users/zathras-crypto/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":45,"created_at":"2015-04-07T05:29:15Z","updated_at":"2015-04-13T05:56:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OmniLayer/omnicore/pulls/13","html_url":"https://github.com/OmniLayer/omnicore/pull/13","diff_url":"https://github.com/OmniLayer/omnicore/pull/13.diff","patch_url":"https://github.com/OmniLayer/omnicore/pull/13.patch"},"body":"First off apologies for the size of this PR guys, these things kind of all link together.  Thanks :)\r\n*Not final* - will need a LOT of testing!  This PR serves three main purposes:\r\n\r\n**1) Rework transaction creation**\r\nTransaction creation has been refactored with this PR.  A number of old functions have been removed, including ```classB_send``` and ```send_INTERNAL_1packet``` to instead follow a method where the calling interface (eg RPC or UI) will evaluate parameters and perform the necessary checks before calling respective ```createPayload_type``` and ```ClassAgnosticWalletTXBuilder``` functions to create the transaction.  This facilitates easier adding of new transactions types.  \r\n\r\nIn addition there is also a new raw transaction flag ```autoCommit``` (can be set via RPC command ```setautocommit_OMNI true|false```) - when set to ```false``` (default ```true```) the RPC interface will ask the wallet to create transactions but will not commit them (or broadcast them), instead returning the raw transaction hex in the response instead of the txid.  For testing use mainly & it seems there may some debate as to whether this should be included so unsure if will stay.\r\n\r\n**2) Add support for Class C transactions**\r\nClass C transactions are supported with this PR.  A Class C transaction moves both the payload and the Omni (Exodus) marker to an OP_RETURN output.  Using a provably unspendable output reduces our impact on the blockchain and further reduces transaction cost.  The client ```nMaxDatacarrierBytes``` setting will be used to determine when to send a Class C transaction, falling back to Class B when necessary (if the payload is too large).\r\n\r\n**3) Add send support for all currently live transaction types**\r\nAlso known as technical debt, there were numerous transaction types that are currently live but that OmniCore was unable to create/send.  This PR adds support for all transactions that are currently live.  A number of new RPC calls have been added (no UI support just yet) including:\r\n```\r\nsend_OMNI\r\nsenddexsell_OMNI\r\nsenddexaccept_OMNI\r\nsendissuancecrowdsale_OMNI\r\nsendissuancefixed_OMNI\r\nsendissuancemanaged_OMNI\r\nsendsto_OMNI\r\nsendgrant_OMNI\r\nsendrevoke_OMNI\r\nsendclosecrowdsale_OMNI\r\nsendtrade_OMNI\r\nsendchangeissuer_OMNI\r\n```\r\nExisting RPC commands ```sendtoowners_MP``` and ```send_MP``` have been aliased to the new ```_OMNI``` calls to provide backwards compatibility.  The original code for them has been removed.\r\n\r\nTest txids below (note you will need this branch to see them, as most of them were sent Class C - it was really nice to just be able to pump out transactions of any size and watch ```ClassAgnostic``` adapt!):\r\n```\r\n# src/bitcoin-cli sendissuancefixed_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" 2 2 0 \"RPC Test Category\" \"RPC Test Subcategory\" \"RPC Test Token\" \"RPC Test URL\" \"RPC Test Data\" 2000\r\nd41b033fe05cff7ca3a491f80c52ae3d5da901cf3108c0d5ee61743415c4efe9\r\n\r\n# src/bitcoin-cli sendissuancemanaged_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" 2 2 0 \"Managed Test Category\" \"Managed Test Subcategory\" \"Managed Test Token\" \"Managed Test URL\" \"Managed Test Data\"\r\nc047ece24168a5c88fddf83f7bb7e79e24a0497d73b0f36d3939262f64bf1e1a\r\n\r\n# src/bitcoin-cli sendissuancecrowdsale_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" 2 2 0 \"Crowdsale Test Category\" \"Crowdsale Test Subcategory\" \"Crowdsale Test Token\" \"Crowdsale Test URL\" \"Crowdsale Test Data\" 1 200 1430971505 10 15\r\n09585f480072c95d262f5481a484f354f66c28c9c010bff59b4fae6f6a2b9779\r\n\r\n# src/bitcoin-cli senddexsell_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" 1 0.01 1 10 0.0001 1\r\n0de2c53a5754b0477b9b33f908dbb7ddd561ffb91c2806d56d061cf8907a19b7\r\n\r\n# src/bitcoin-cli senddexaccept_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" \"mvayzbj425X55kRLLPQiuCXWUED6LMP65C\" 2 1.5\r\nc821101fb455428ad48597f28b672c505260cfe854c94f22a0e09a84f0b7b75a\r\n\r\n# src/bitcoin-cli sendclosecrowdsale_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" 2147483692\r\n95b62d82432a06f3904e4312ed4384a9b57b63f301b0764c893e699ef694107a\r\n\r\n# src/bitcoin-cli sendgrant_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" mpZATHm5ih33ePoSPxFQ4cvWZWaPkN4G5s 2147483691 100 \"Test Grant Memo\"\r\nc8644fe15cb0f9d61c44c465365dc25e0f07f2b5ad768602b9a46e8b3bd75806\r\n\r\n# src/bitcoin-cli send_MP \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" \"mpZATHm5ih33ePoSPxFQ4cvWZWaPkN4G5s\" 1 0.01\r\n2af942fe0a3c4795c29f087f40701c50152fae83aea9c3f52839d1c51cec7aaf\r\n\r\n# src/bitcoin-cli send_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" \"mpZATHm5ih33ePoSPxFQ4cvWZWaPkN4G5s\" 1 0.02\r\na708f6352de14db63597a97851ed37900b42a9d6f6f5851cd6d688fd23bd2ef3\r\n\r\n# src/bitcoin-cli sendtoowners_MP \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" 57 100\r\n3476ad202dd2a8f3b666f514ad5e15b2dd89eff1b35e44028ad9b5eb780a0914\r\n\r\n# src/bitcoin-cli sendsto_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" 57 200\r\n94fea1a1deaa41eaf5c5b2907bff76df8c0cd4834037d03a45924e37f21f81d0\r\n\r\n# src/bitcoin-cli sendtrade_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" 57 10 1 20 1\r\n78894c5a6f1a874142fdd0b7e07edc741105972e43706a9828604ed9e64bdfaa\r\n\r\n# src/bitcoin-cli sendchangeissuer_OMNI \"mpZATHupfCLqet5N1YL48ByCM1ZBfddbGJ\" mpZATHm5ih33ePoSPxFQ4cvWZWaPkN4G5s 2147483690\r\n9b831ef60919c42be1ede10fbe4c773a622144669f7dbaa7bb4452574a9263a2\r\n```"},"comment":{"url":"https://api.github.com/repos/OmniLayer/omnicore/issues/comments/92225574","html_url":"https://github.com/OmniLayer/omnicore/pull/13#issuecomment-92225574","issue_url":"https://api.github.com/repos/OmniLayer/omnicore/issues/13","id":92225574,"user":{"login":"zathras-crypto","id":5633351,"avatar_url":"https://avatars.githubusercontent.com/u/5633351?v=3","gravatar_id":"","url":"https://api.github.com/users/zathras-crypto","html_url":"https://github.com/zathras-crypto","followers_url":"https://api.github.com/users/zathras-crypto/followers","following_url":"https://api.github.com/users/zathras-crypto/following{/other_user}","gists_url":"https://api.github.com/users/zathras-crypto/gists{/gist_id}","starred_url":"https://api.github.com/users/zathras-crypto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zathras-crypto/subscriptions","organizations_url":"https://api.github.com/users/zathras-crypto/orgs","repos_url":"https://api.github.com/users/zathras-crypto/repos","events_url":"https://api.github.com/users/zathras-crypto/events{/privacy}","received_events_url":"https://api.github.com/users/zathras-crypto/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T05:56:13Z","updated_at":"2015-04-13T05:56:13Z","body":"> Nevertheless: I tend to stick to the old calculation, just in case\r\n\r\nWhat's the concern here - 0.0.10 is consensus breaking so no-one would be able to use Bitcoin 0.9 based clients anyway."}}