Use GetScriptType instead of IsScriptType
MODIFY
WalletWasabi/Crypto/Bip322Signature.cs
WalletWasabi/Crypto/Bip322Signature.cs
@@ -41,10 +41,10 @@ public record Bip322Signature : IBitcoinSerializable
NBitcoinExtensions.FromBytes<Bip322Signature>(bip322SignatureBytes);
public bool Verify(uint256 hash, Script scriptPubKey) =>
- scriptPubKey.IsScriptType(ScriptType.P2WPKH) switch
+ scriptPubKey.GetScriptType() switch
{
- true => VerifySegwit(hash, scriptPubKey),
- false => throw new NotImplementedException("Only P2WPKH scripts are supported.")
+ ScriptType.P2WPKH => VerifySegwit(hash, scriptPubKey),
+ _ => throw new NotImplementedException("Only P2WPKH scripts are supported.")
};
public static Bip322Signature Generate(Key key, uint256 hash, ScriptPubKeyType scriptPubKeyType) =>

MODIFY
WalletWasabi/Crypto/OwnershipProof.cs
WalletWasabi/Crypto/OwnershipProof.cs
@@ -47,10 +47,10 @@ public record OwnershipProof : IBitcoinSerializable
Bip322Signature.Generate(key, proofBody.SignatureHash(key.PubKey.WitHash.ScriptPubKey, commitmentData), ScriptPubKeyType.Segwit));
public bool VerifyOwnership(Script scriptPubKey, byte[] commitmentData, bool requireUserConfirmation) =>
- scriptPubKey.IsScriptType(ScriptType.P2WPKH) switch
+ scriptPubKey.GetScriptType() switch
{
- true => VerifyOwnershipProofSegwit(scriptPubKey, commitmentData, requireUserConfirmation),
- false => throw new NotImplementedException()
+ ScriptType.P2WPKH => VerifyOwnershipProofSegwit(scriptPubKey, commitmentData, requireUserConfirmation),
+ _ => throw new NotImplementedException("Only P2WPKH scripts are supported."),
};
private bool VerifyOwnershipProofSegwit(Script scriptPubKey, byte[] commitmentData, bool requireUserConfirmation)

MODIFY
WalletWasabi/Extensions/NBitcoinExtensions.cs
WalletWasabi/Extensions/NBitcoinExtensions.cs
@@ -475,10 +475,10 @@ public static class NBitcoinExtensions
new TxOut(Money.Zero, scriptPubKey).GetSerializedSize();
public static int EstimateInputVsize(this Script scriptPubKey) =>
- scriptPubKey.IsScriptType(ScriptType.P2WPKH) switch
+ scriptPubKey.GetScriptType() switch
{
- true => Constants.P2wpkhInputVirtualSize,
- false => throw new NotImplementedException($"Size estimation isn't implemented for provided script type.")
+ ScriptType.P2WPKH => Constants.P2wpkhInputVirtualSize,
+ _ => throw new NotImplementedException($"Size estimation isn't implemented for provided script type.")
};
public static Money EffectiveCost(this TxOut output, FeeRate feeRate) =>

Use GetScriptType instead of IsScriptType