Exemple #1
0
        public void Rehydrate(IDataRehydrator rehydrator, IElectionContextRehydrationFactory electionContextRehydrationFactory)
        {
            this.Bounty.Rehydrate(rehydrator);
            this.MaintenanceServiceFeesEnabled = rehydrator.ReadBool();
            this.MaintenanceServiceFees        = rehydrator.ReadRehydratable <SimplePercentage>();

            this.BountyAllocationMethod          = BountyAllocationMethodRehydrator.Rehydrate(rehydrator);
            this.TransactionTipsAllocationMethod = TransactionTipsAllocationMethodRehydrator.Rehydrate(rehydrator);
        }
Exemple #2
0
        public static TransactionTipsAllocator GetTransactionTipsSelector(ITransactionTipsAllocationMethod bountyAllocationMethod)
        {
            if (bountyAllocationMethod.Version == TransactionTipsAllocationMethodTypes.Instance.LowestToHighest)
            {
                if (bountyAllocationMethod.Version == (1, 0))
                {
                    return(new LowestToHighestTransactionTipsAllocator(bountyAllocationMethod));
                }
            }

            throw new ApplicationException("Invalid bounty allocation type");
        }
Exemple #3
0
        public static ITransactionTipsAllocationMethod Rehydrate(IDataRehydrator rehydrator)
        {
            var version = rehydrator.RehydrateRewind <ComponentVersion <TransactionTipsAllocationMethodType> >();

            ITransactionTipsAllocationMethod allocationMethod = null;

            if (version.Type == TransactionTipsAllocationMethodTypes.Instance.LowestToHighest)
            {
                if (version == (1, 0))
                {
                    allocationMethod = new LowestToHighestTransactionTipsAllocationMethod();
                }
            }

            if (allocationMethod == null)
            {
                throw new ApplicationException("Invalid candidacy selector type");
            }

            allocationMethod.Rehydrate(rehydrator);

            return(allocationMethod);
        }
 public LowestToHighestTransactionTipsAllocator(ITransactionTipsAllocationMethod TransactionTipsAllocationMethod) : base(TransactionTipsAllocationMethod)
 {
 }
 public TransactionTipsAllocator(ITransactionTipsAllocationMethod TransactionTipsAllocationMethod)
 {
     this.TransactionTipsAllocationMethod = TransactionTipsAllocationMethod;
 }
Exemple #6
0
 public NeuraliumHighestTipTransactionSelectionMethod(long blockId, ITransactionTipsAllocationMethod transactionSelectionMethod, INeuraliumWalletProviderProxy walletProvider, ushort maximumTransactionCount, HighestTipTransactionSelectionStrategySettings highestTipTransactionSelectionStrategySettings, IBlockchainTimeService timeService) : base(blockId, walletProvider, maximumTransactionCount)
 {
     this.transactionSelectionMethod = transactionSelectionMethod;
     this.highestTipTransactionSelectionStrategySettings = highestTipTransactionSelectionStrategySettings;
     this.timeService = timeService;
 }