func (was *WriteAheadState) CreateReceiptPromise(hash common.Hash) *ReceiptPromise {
	was.promiseLock.Lock()
	defer was.promiseLock.Unlock()
	p := NewReceiptPromise(hash)
	was.receiptPromises[hash] = p
	return p
}
CreateReceiptPromise creates and records a new ReceiptPromise for a
transaction hash.
package state
import (
	"fmt"
	"sync"
	"github.com/ethereum/go-ethereum/common"
	ethTypes "github.com/ethereum/go-ethereum/core/types"
	"github.com/sirupsen/logrus"
)
type WriteAheadState struct {
	BaseState
	txIndex int
	txs     map[common.Hash]*EVMLTransaction
	allLogs []*ethTypes.Log
	receiptPromises map[common.Hash]*ReceiptPromise
	promiseLock     sync.Mutex
	logger *logrus.Entry
}
func NewWriteAheadState(base BaseState, logger *logrus.Entry) *WriteAheadState {
	return &WriteAheadState{
		BaseState:       base,
		txs:             make(map[common.Hash]*EVMLTransaction),
		receiptPromises: make(map[common.Hash]*ReceiptPromise),
		logger:          logger,
	}
}
func (was *WriteAheadState) Reset(root common.Hash) error {
	err := was.BaseState.Reset(root)
	if err != nil {
		return err
	}
	was.txIndex = 0
	was.txs = make(map[common.Hash]*EVMLTransaction)
	was.allLogs = []*ethTypes.Log{}
	return nil
}