// LogChanges logs all changes made to an AVL tree state snapshot for the purposes
// of logging out changes to account state to Wavelet's HTTP API.
LogChanges logs all changes made to an AVL tree state snapshot for the purposes
of logging out changes to account state to Wavelet's HTTP API.
// LogChanges logs all changes made to an AVL tree state snapshot for the purposes // of logging out changes to account state to Wavelet ' s HTTP API .
func (l *Ledger) LogChanges(c *collapseResults) {
	balanceLogger := log.Accounts("balance_updated")
	gasBalanceLogger := log.Accounts("gas_balance_updated")
	stakeLogger := log.Accounts("stake_updated")
	rewardLogger := log.Accounts("reward_updated")
	for _, id := range c.ctx.accountIDs {
		if bal, ok := c.ctx.balances[id]; ok {
			balanceLogger.Log().
				Hex("account_id", id[:]).
				Uint64("balance", bal).
				Msg("")
		}
		if stake, ok := c.ctx.stakes[id]; ok {
			stakeLogger.Log().
				Hex("account_id", id[:]).
				Uint64("stake", stake).
				Msg("")
		}
		if reward, ok := c.ctx.rewards[id]; ok {
			rewardLogger.Log().
				Hex("account_id", id[:]).
				Uint64("reward", reward).
				Msg("")
		}
		if gasBal, ok := c.ctx.contractGasBalances[id]; ok {
			gasBalanceLogger.Log().
				Hex("account_id", id[:]).
				Uint64("gas_balance", gasBal).
				Msg("")
		}
	}
}
func ( l * Ledger ) LogChanges ( c * collapseResults ) { balanceLogger := log . Accounts ( " " ) gasBalanceLogger := log . Accounts ( " " ) stakeLogger := log . Accounts ( " " ) rewardLogger := log . Accounts ( " " ) for _ , id := range c . ctx . accountIDs { if bal , ok := c . ctx . balances [ id ] ; ok { balanceLogger . Log ( ) . Hex ( " " , id [ : ] ) . Uint64 ( " " , bal ) . Msg ( " " ) } if stake , ok := c . ctx . stakes [ id ] ; ok { stakeLogger . Log ( ) . Hex ( " " , id [ : ] ) . Uint64 ( " " , stake ) . Msg ( " " ) } if reward , ok := c . ctx . rewards [ id ] ; ok { rewardLogger . Log ( ) . Hex ( " " , id [ : ] ) . Uint64 ( " " , reward ) . Msg ( " " ) } if gasBal , ok := c . ctx . contractGasBalances [ id ] ; ok { gasBalanceLogger . Log ( ) . Hex ( " " , id [ : ] ) . Uint64 ( " " , gasBal ) . Msg ( " " ) } } }
LogChanges logs all changes made to an AVL tree state snapshot for the purposes
of logging out changes to account state to Wavelet's HTTP API.
LogChanges logs all changes made to an AVL tree state snapshot for the purposes of logging out changes to account state to Wavelet ' s HTTP API .