// Apply the transaction and immediately write the states into the tree.
// If you have many transactions to apply, consider using CollapseContext.
Apply the transaction and immediately write the states into the tree.
If you have many transactions to apply, consider using CollapseContext.
// Apply the transaction and immediately write the states into the tree . // If you have many transactions to apply consider using CollapseContext .
func ApplyTransaction(tree *avl.Tree, block *Block, tx *Transaction) error {
	ctx := NewCollapseContext(tree)
	if err := ctx.ApplyTransaction(block, tx); err != nil {
		return err
	}
	return ctx.Flush()
}
func ApplyTransaction ( tree * avl . Tree , block * Block , tx * Transaction ) error { ctx := NewCollapseContext ( tree ) if err := ctx . ApplyTransaction ( block , tx ) ; err != nil { return err } return ctx . Flush ( ) }
Apply the transaction and immediately write the states into the tree.
Apply the transaction and immediately write the states into the tree .