plugeth-statediff/test_helpers/mocks/backend_test.go
Roy Crihfield ebc2eb37e7 Initial plugin implementation
* refactor packages, flags, subscriptions
* DRY refactor builder tests
* use mockgen to generate mocks
* update README
* MODE=statediff no longer needed for unit tests
* simplify func names, clean up metrics
* move write params to service field
* sql indexer: confirm quit after ipld cache reset
  prevents negative waitgroup panic
* don't let TotalDifficulty become nil
* use forked plugeth, plugeth-utils for now
2023-07-14 12:56:36 +08:00

18 lines
442 B
Go

package mocks_test
import (
"testing"
"github.com/cerc-io/plugeth-statediff/test_helpers/mocks"
"github.com/ethereum/go-ethereum"
)
func TestBackend(t *testing.T) {
startingblock := uint64(42)
b := mocks.NewBackend(t, ethereum.SyncProgress{StartingBlock: startingblock})
block := b.Downloader().Progress().StartingBlock()
if startingblock != block {
t.Fatalf("wrong StartingBlock; expected %d, got %d", startingblock, block)
}
}