public override void UpdateLocalTransactionCacheEntry(TransactionId transactionId, WalletTransactionCache.TransactionStatuses status, long gossipMessageHash) { base.UpdateLocalTransactionCacheEntry(transactionId, status, gossipMessageHash); AccountId targetAccountId = transactionId.Account; TotalAPI total = this.GetAccountBalance(targetAccountId, true); this.centralCoordinator.PostSystemEvent(NeuraliumSystemEventGenerator.NeuraliumAccountTotalUpdated(targetAccountId.SequenceId, targetAccountId.AccountType, total)); }
public override void InsertLocalTransactionCacheEntry(ITransactionEnvelope transactionEnvelope) { base.InsertLocalTransactionCacheEntry(transactionEnvelope); AccountId targetAccountId = transactionEnvelope.Contents.Uuid.Account; TotalAPI total = this.GetAccountBalance(targetAccountId, true); this.centralCoordinator.PostSystemEvent(NeuraliumSystemEventGenerator.NeuraliumAccountTotalUpdated(targetAccountId.SequenceId, targetAccountId.AccountType, total)); }
protected override void ConfirmedPrimeElected(BlockElectionDistillate blockElectionDistillate, FinalElectionResultDistillate finalElectionResultDistillate) { base.ConfirmedPrimeElected(blockElectionDistillate, finalElectionResultDistillate); NeuraliumBlockElectionDistillate neuraliumBlockElectionDistillate = (NeuraliumBlockElectionDistillate)blockElectionDistillate; NeuraliumFinalElectionResultDistillate neuraliumFinalElectionContext = (NeuraliumFinalElectionResultDistillate)finalElectionResultDistillate; this.centralCoordinator.PostSystemEvent(NeuraliumSystemEventGenerator.NeuraliumMiningPrimeElected(blockElectionDistillate.currentBlockId, neuraliumFinalElectionContext.BountyShare, neuraliumFinalElectionContext.TransactionTips, AccountId.FromString(neuraliumFinalElectionContext.DelegateAccountId))); Log.Information($"We were officially announced as a prime elected in Block {blockElectionDistillate.currentBlockId} for the election that was announced in block {blockElectionDistillate.currentBlockId - neuraliumFinalElectionContext.BlockOffset}"); }
protected override void LocalAccountSnapshotEntryChanged(Dictionary <AccountId, List <Action> > changedLocalAccounts, IAccountSnapshot newEntry, IWalletAccountSnapshot original) { base.LocalAccountSnapshotEntryChanged(changedLocalAccounts, newEntry, original); if (newEntry is INeuraliumAccountSnapshot neuraliumAccountSnapshot && original is INeuraliumWalletAccountSnapshot neuraliumWalletAccountSnapshot) { if (neuraliumAccountSnapshot.Balance != neuraliumWalletAccountSnapshot.Balance) { AccountId accountId = newEntry.AccountId.ToAccountId(); this.InsertChangedLocalAccountsEvent(changedLocalAccounts, accountId, () => { // seems our total was updated for this account TotalAPI total = this.CentralCoordinator.ChainComponentProvider.WalletProvider.GetAccountBalance(accountId, true); this.CentralCoordinator.PostSystemEvent(NeuraliumSystemEventGenerator.NeuraliumAccountTotalUpdated(accountId.SequenceId, accountId.AccountType, total)); }); } } }