github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/app/rpc/backend/cache.go (about)

     1  package backend
     2  
     3  import (
     4  	"github.com/ethereum/go-ethereum/common"
     5  	"github.com/fibonacci-chain/fbc/x/evm/watcher"
     6  )
     7  
     8  type Cache interface {
     9  	GetBlockByNumber(number uint64, fullTx bool) (*watcher.Block, error)
    10  	GetBlockByHash(hash common.Hash, fullTx bool) (*watcher.Block, error)
    11  	AddOrUpdateBlock(hash common.Hash, block *watcher.Block, fullTx bool)
    12  	GetTransaction(hash common.Hash) (*watcher.Transaction, error)
    13  	AddOrUpdateTransaction(hash common.Hash, tx *watcher.Transaction)
    14  	GetBlockHash(number uint64) (common.Hash, error)
    15  	AddOrUpdateBlockHash(number uint64, hash common.Hash)
    16  }