protected void InvalidateBitcoinHashes(object sender, EventArgs e) { ContractsCommon.NotFrozen(this); _hash256 = null; _hash160 = null; if (HashesInvalidated != null) { HashesInvalidated(this, EventArgs.Empty); } }
public static bool TryParse(string hashString, out Hash160 hash) { Contract.Ensures(Contract.Result <bool>() == true || Contract.ValueAtReturn(out hash) == default(Hash160)); Contract.Ensures(Contract.Result <bool>() == false || Contract.ValueAtReturn(out hash) != null); try { hash = Parse(hashString); return(true); } catch (ArgumentException) { } catch (FormatException) { } catch (OverflowException) { } hash = default(Hash160); return(false); }
public static bool TryParse(string hashString, out Hash160 hash) { Contract.Ensures(Contract.Result<bool>() == true || Contract.ValueAtReturn(out hash) == default(Hash160)); Contract.Ensures(Contract.Result<bool>() == false || Contract.ValueAtReturn(out hash) != null); try { hash = Parse(hashString); return true; } catch (ArgumentException) { } catch (FormatException) { } catch (OverflowException) { } hash = default(Hash160); return false; }
public static void AssertThatHashMatches(BitcoinObject bitObj, Hash160 expectedHash) { Assert.AreEqual(expectedHash, bitObj.Hash160); }
public static Hash160 Create(byte[] hashBytes) { Hash160 hash160 = new Hash160(hashBytes); return hash160; }