| 103 | } |
| 104 | |
| 105 | static inline void pushvalue(std::vector<valtype>& stack, const CConfidentialValue& value) |
| 106 | { |
| 107 | valtype vchinpValue, vchValuePref; |
| 108 | if (value.IsNull()) { |
| 109 | // If value is null, explicitly push the explicit prefix 0x01 |
| 110 | vchValuePref = {0x01}; |
| 111 | vchinpValue.assign(8, 0x00); |
| 112 | } else if (value.IsExplicit()) { |
| 113 | // Convert BE to LE by using reverse iterator |
| 114 | vchValuePref.assign(value.vchCommitment.begin(), value.vchCommitment.begin() + 1); |
| 115 | vchinpValue.assign(value.vchCommitment.rbegin(), value.vchCommitment.rbegin() + 8); |
| 116 | } else { // (value.IsCommitment()) |
| 117 | vchValuePref.assign(value.vchCommitment.begin(), value.vchCommitment.begin() + 1); |
| 118 | vchinpValue.assign(value.vchCommitment.begin() + 1, value.vchCommitment.end()); |
| 119 | } |
| 120 | stack.push_back(std::move(vchinpValue)); // if value is null, 0(LE 8) is pushed |
| 121 | stack.push_back(std::move(vchValuePref)); // always push prefix |
| 122 | } |
| 123 | |
| 124 | static inline void pushspk(std::vector<valtype>& stack, const CScript& scriptPubKey, const uint256& scriptPubKey_sha) |
| 125 | { |
no test coverage detected