public IXICore(IXISettings settings, IConsensus consensus, IDataAccessor dataAccessor, ITangleAccessor tangleAccessor)
 {
     _dataAccessor   = dataAccessor;
     _tangleAccessor = tangleAccessor;
     _consensus      = consensus;
     _settings       = settings;
 }
Beispiel #2
0
        /// <summary>
        /// Finalizes the transaction
        /// </summary>
        /// <returns></returns>
        public Transaction Final(IXISettings settings)
        {
            Time = Timestamp.UnixSecondsTimestamp;
            GenerateHash();
            Sign(settings);
            NodeAddress = settings.NodeAddress;
            IsFinalized = true;

            return(this);
        }
Beispiel #3
0
        public Block Final(IXISettings settings)
        {
            Time  = Timestamp.UnixSecondsTimestamp;
            Owner = settings.PublicKey;

            GenerateHash();

            NodeAddress = settings.NodeAddress;
            NextAddress = Cryptography.GenerateNextAddress(Hash, SendTo);

            IsFinalized = true;

            return(this);
        }
Beispiel #4
0
 /// <summary>
 /// Signs the transaction
 /// </summary>
 /// <returns></returns>
 public void Sign(IXISettings settings)
 {
     if (Mode == -1)
     {
         Signature = "GENESIS";
     }
     else if (Mode == 100)
     {
         Signature = "SMARTCONTRACTRESULT";
     }
     else
     {
         Signature = Cryptography.Sign(Hash, settings.PrivateKey);
     }
 }