public Transaction(Guid ID, string ContractName, string ContractHash, string ContractIssuer, string Signture, DateTime IssuanceTime, DateTime MinedTime, string ContainerBlockHash, uint BlockNumber, byte TransactionVersion, TransactionPrinciples TransactionPrinciple, string TransactionIssuer, string Reciepient, double Amount, uint Sequence, bool IsBlockReward, List <TransactionInput> TransactionInputs, List <TransactionOutput> TransactionOutputs) : base(ID, ContractName, ContractHash, ContractIssuer, Signture, IssuanceTime, MinedTime, ContainerBlockHash, BlockNumber) { this.TransactionVersion = TransactionVersion; this.TransactionPrinciple = TransactionPrinciple; this.TransactionIssuer = TransactionIssuer; this.Reciepient = Reciepient; this.Amount = Amount; this.Sequence = Sequence; this.IsBlockReward = IsBlockReward; this.TransactionInputs = TransactionInputs; this.TransactionOutputs = TransactionOutputs; }
public void TransactionPrinciplesTest() { var bp1 = new TransactionPrinciples(1, "nothing", "no", double.MaxValue, double.MinValue); var bp2 = bp1.ToJson().FromJson <BasePrinciples>(); Assert.Equal(bp1, bp2); Assert.True(bp1 == bp2); Assert.False(bp1 != bp2); Assert.True(bp1 != null); BasePrinciples bp3 = null; Assert.False(bp3 != null); Assert.True(bp3 == null); bp3 = new TransactionPrinciples(2, "anyting", "yes", double.MaxValue, double.MinValue); Assert.False(bp1 == bp3); Assert.True(bp1 != bp3); }