| 694 | } |
| 695 | |
| 696 | static void MutateTx(CMutableTransaction& tx, const std::string& command, |
| 697 | const std::string& commandVal) |
| 698 | { |
| 699 | std::unique_ptr<ECC_Context> ecc; |
| 700 | |
| 701 | if (command == "nversion") |
| 702 | MutateTxVersion(tx, commandVal); |
| 703 | else if (command == "locktime") |
| 704 | MutateTxLocktime(tx, commandVal); |
| 705 | else if (command == "replaceable") { |
| 706 | MutateTxRBFOptIn(tx, commandVal); |
| 707 | } |
| 708 | |
| 709 | else if (command == "delin") |
| 710 | MutateTxDelInput(tx, commandVal); |
| 711 | else if (command == "in") |
| 712 | MutateTxAddInput(tx, commandVal); |
| 713 | |
| 714 | else if (command == "delout") |
| 715 | MutateTxDelOutput(tx, commandVal); |
| 716 | else if (command == "outaddr") |
| 717 | MutateTxAddOutAddr(tx, commandVal); |
| 718 | else if (command == "outpubkey") { |
| 719 | ecc.reset(new ECC_Context()); |
| 720 | MutateTxAddOutPubKey(tx, commandVal); |
| 721 | } else if (command == "outmultisig") { |
| 722 | ecc.reset(new ECC_Context()); |
| 723 | MutateTxAddOutMultiSig(tx, commandVal); |
| 724 | } else if (command == "outscript") |
| 725 | MutateTxAddOutScript(tx, commandVal); |
| 726 | else if (command == "outdata") |
| 727 | MutateTxAddOutData(tx, commandVal); |
| 728 | |
| 729 | else if (command == "sign") { |
| 730 | ecc.reset(new ECC_Context()); |
| 731 | MutateTxSign(tx, commandVal); |
| 732 | } |
| 733 | |
| 734 | else if (command == "load") |
| 735 | RegisterLoad(commandVal); |
| 736 | |
| 737 | else if (command == "set") |
| 738 | RegisterSet(commandVal); |
| 739 | |
| 740 | else |
| 741 | throw std::runtime_error("unknown command"); |
| 742 | } |
| 743 | |
| 744 | static void OutputTxJSON(const CTransaction& tx) |
| 745 | { |
no test coverage detected