public Script GenerateScriptPubKey(ScriptId scriptId) { return(new Script( OpcodeType.OP_HASH160, Op.GetPushOp(scriptId.ToBytes()), OpcodeType.OP_EQUAL)); }
public AssetId(ScriptId scriptId) { if (scriptId == null) { throw new ArgumentNullException("scriptId"); } _Bytes = scriptId.ToBytes(true); }
public AssetId(ScriptId scriptId) { if (scriptId == null) { throw new ArgumentNullException(nameof(scriptId)); } _Bytes = scriptId.ToBytes(); }
public void ReadWrite(BitcoinStream stream) { byte[] assetId = _Id.ToBytes(); stream.ReadWrite(ref assetId); if (!stream.Serializing) { _Id = new ScriptId(assetId); } stream.ReadWrite(ref _Quantity); }
public AssetId(ScriptId scriptId) { if (scriptId == null) throw new ArgumentNullException("scriptId"); _Bytes = scriptId.ToBytes(true); }
public AssetId(ScriptId scriptId) { _Bytes = scriptId.ToBytes(true); }
public void QuickTestsOnKeyIdBytes() { var a = new KeyId("93e5d305cad2588d5fb254065fe48ce446028ba3"); var b = new ScriptId("93e5d305cad2588d5fb254065fe48ce446028ba3"); var b2 = new WitKeyId("93e5d305cad2588d5fb254065fe48ce446028ba3"); Assert.Equal(a.ToString(), b.ToString()); Assert.Equal(a.ToString(), b2.ToString()); Assert.Equal("93e5d305cad2588d5fb254065fe48ce446028ba3", a.ToString()); var bytes = Encoders.Hex.DecodeData("93e5d305cad2588d5fb254065fe48ce446028ba3"); Assert.True(StructuralComparisons.StructuralComparer.Compare(a.ToBytes(), b.ToBytes()) == 0); Assert.True(StructuralComparisons.StructuralComparer.Compare(b2.ToBytes(), b.ToBytes()) == 0); var c = new KeyId(bytes); var d = new ScriptId(bytes); var d2 = new WitKeyId(bytes); Assert.Equal(a, c); Assert.Equal(d, b); Assert.Equal(b2, d2); Assert.Equal(c.ToString(), d.ToString()); Assert.Equal(c.ToString(), d2.ToString()); Assert.Equal("93e5d305cad2588d5fb254065fe48ce446028ba3", c.ToString()); Assert.True(StructuralComparisons.StructuralComparer.Compare(c.ToBytes(), d.ToBytes()) == 0); Assert.True(StructuralComparisons.StructuralComparer.Compare(c.ToBytes(), d2.ToBytes()) == 0); var e = new WitScriptId("93e5d305cad2588d5fb254065fe48ce446028ba380e6ee663baea9cd10550089"); Assert.Equal("93e5d305cad2588d5fb254065fe48ce446028ba380e6ee663baea9cd10550089", e.ToString()); bytes = Encoders.Hex.DecodeData("93e5d305cad2588d5fb254065fe48ce446028ba380e6ee663baea9cd10550089"); var e2 = new WitScriptId(bytes); Assert.Equal(e, e2); }