Ejemplo n.º 1
0
        public new ModifyMultisigAccountTransaction Apply(string input)
        {
            var tx = JsonConvert.DeserializeObject <MultisigModificationTransactionInfoDTO>(input);

            var txInfo   = TransactionInfo.Create(tx.Meta.Height, tx.Meta.Index, tx.Meta.Id, tx.Meta.Hash, tx.Meta.MerkleComponentHash);
            var deadline = new Deadline(tx.Transaction.Deadline);

            List <MultisigCosignatoryModification> modifications = tx.Transaction.Modifications != null
                ? tx
                                                                   .Transaction.Modifications
                                                                   .Select(e =>
                                                                           new MultisigCosignatoryModification(
                                                                               MultisigCosignatoryModificationType.GetRawValue(e.Type),
                                                                               new PublicAccount(e.CosignatoryPublicKey, ExtractNetworkType(tx.Transaction.Version))
                                                                               )
                                                                           ).ToList() : new List <MultisigCosignatoryModification>();

            return(new ModifyMultisigAccountTransaction(
                       ExtractNetworkType(tx.Transaction.Version),
                       3,
                       deadline,
                       tx.Transaction.Fee,
                       tx.Transaction.MinApprovalDelta,
                       tx.Transaction.MinRemovalDelta,
                       modifications,
                       tx.Transaction.Signature,
                       new PublicAccount(tx.Transaction.Signer, ExtractNetworkType(tx.Transaction.Version)),
                       txInfo
                       ));
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Get value extension
 /// </summary>
 /// <param name="type">The MultisigCosignatoryModificationType</param>
 /// <returns>byte</returns>
 public static byte GetValueInByte(this MultisigCosignatoryModificationType type)
 {
     return((byte)type);
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     Get value extension
 /// </summary>
 /// <param name="type">The MultisigCosignatoryModificationType</param>
 /// <returns>int</returns>
 public static int GetValue(this MultisigCosignatoryModificationType type)
 {
     return((int)type);
 }
Ejemplo n.º 4
0
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="type"></param>
 /// <param name="cosignatoryPublicAccount"></param>
 public MultisigCosignatoryModification(MultisigCosignatoryModificationType type,
                                        PublicAccount cosignatoryPublicAccount)
 {
     Type = type;
     CosignatoryPublicAccount = cosignatoryPublicAccount;
 }