| 213 | } |
| 214 | |
| 215 | BlindProofResult VerifyBlindProofs(const PSBTOutput& o) { |
| 216 | // No blinding, no problem |
| 217 | if (!o.IsBlinded()) { |
| 218 | return BlindProofResult::OK; |
| 219 | } else if (!o.IsFullyBlinded()) { |
| 220 | return BlindProofResult::NOT_FULLY_BLINDED; |
| 221 | } |
| 222 | |
| 223 | if (o.amount != std::nullopt) { |
| 224 | if (o.m_blind_value_proof.empty()) { |
| 225 | return BlindProofResult::MISSING_VALUE_PROOF; |
| 226 | } else if (!VerifyBlindValueProof(*o.amount, o.m_value_commitment, o.m_blind_value_proof, o.m_asset_commitment)) { |
| 227 | return BlindProofResult::INVALID_VALUE_PROOF; |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | if (!o.m_asset.IsNull()) { |
| 232 | if (o.m_blind_asset_proof.empty()) { |
| 233 | return BlindProofResult::MISSING_ASSET_PROOF; |
| 234 | } else if (!VerifyBlindAssetProof(o.m_asset, o.m_blind_asset_proof, o.m_asset_commitment)) { |
| 235 | return BlindProofResult::INVALID_ASSET_PROOF; |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | return BlindProofResult::OK; |
| 240 | } |
| 241 | |
| 242 | BlindProofResult VerifyBlindProofs(const PSBTInput& i) { |
| 243 | CTxOut utxo; |
no test coverage detected