Merge pull request #2213 from benthecarman/error-sign-provider-addrs
[rust-lightning] / fuzz / src / chanmon_consistency.rs
index 0461c75772c7a39fa5176ca37bbc5f55878f4c7d..8919387818aef1b9f248634865e965a01cd98de0 100644 (file)
@@ -259,18 +259,18 @@ impl SignerProvider for KeyProvider {
                })
        }
 
-       fn get_destination_script(&self) -> Script {
+       fn get_destination_script(&self) -> Result<Script, ()> {
                let secp_ctx = Secp256k1::signing_only();
                let channel_monitor_claim_key = SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, self.node_secret[31]]).unwrap();
                let our_channel_monitor_claim_key_hash = WPubkeyHash::hash(&PublicKey::from_secret_key(&secp_ctx, &channel_monitor_claim_key).serialize());
-               Builder::new().push_opcode(opcodes::all::OP_PUSHBYTES_0).push_slice(&our_channel_monitor_claim_key_hash[..]).into_script()
+               Ok(Builder::new().push_opcode(opcodes::all::OP_PUSHBYTES_0).push_slice(&our_channel_monitor_claim_key_hash[..]).into_script())
        }
 
-       fn get_shutdown_scriptpubkey(&self) -> ShutdownScript {
+       fn get_shutdown_scriptpubkey(&self) -> Result<ShutdownScript, ()> {
                let secp_ctx = Secp256k1::signing_only();
                let secret_key = SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, self.node_secret[31]]).unwrap();
                let pubkey_hash = WPubkeyHash::hash(&PublicKey::from_secret_key(&secp_ctx, &secret_key).serialize());
-               ShutdownScript::new_p2wpkh(&pubkey_hash)
+               Ok(ShutdownScript::new_p2wpkh(&pubkey_hash))
        }
 }