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); }
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"); }
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; }
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; }