diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index d1d9bfb00c..a5b9c22690 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -45,7 +45,7 @@ type Tally struct { // Snapshot is the state of the authorization voting at a given point in time. type Snapshot struct { - config *params.XDPoSConfig // Consensus engine parameters to fine tune behavior + config *params.CliqueConfig // Consensus engine parameters to fine tune behavior sigcache *lru.ARCCache // Cache of recent block signatures to speed up ecrecover Number uint64 `json:"number"` // Block number where the snapshot was created @@ -59,7 +59,7 @@ type Snapshot struct { // newSnapshot creates a new snapshot with the specified startup parameters. This // method does not initialize the set of recent signers, so only ever use if for // the genesis block. -func newSnapshot(config *params.XDPoSConfig, sigcache *lru.ARCCache, number uint64, hash common.Hash, signers []common.Address) *Snapshot { +func newSnapshot(config *params.CliqueConfig , sigcache *lru.ARCCache, number uint64, hash common.Hash, signers []common.Address) *Snapshot { snap := &Snapshot{ config: config, sigcache: sigcache, @@ -76,7 +76,7 @@ func newSnapshot(config *params.XDPoSConfig, sigcache *lru.ARCCache, number uint } // loadSnapshot loads an existing snapshot from the database. -func loadSnapshot(config *params.XDPoSConfig, sigcache *lru.ARCCache, db ethdb.Database, hash common.Hash) (*Snapshot, error) { +func loadSnapshot(config *params.CliqueConfig, sigcache *lru.ARCCache, db ethdb.Database, hash common.Hash) (*Snapshot, error) { blob, err := db.Get(append([]byte("clique-"), hash[:]...)) if err != nil { return nil, err diff --git a/consensus/clique/snapshot_test.go b/consensus/clique/snapshot_test.go index 826e0ed57c..8b51e6e094 100644 --- a/consensus/clique/snapshot_test.go +++ b/consensus/clique/snapshot_test.go @@ -74,7 +74,7 @@ type testerChainReader struct { db ethdb.Database } -func (r *testerChainReader) Config() *params.ChainConfig { return params.AllXDPoSProtocolChanges } +func (r *testerChainReader) Config() *params.ChainConfig { return params.AllCliqueProtocolChanges } func (r *testerChainReader) CurrentHeader() *types.Header { panic("not supported") } func (r *testerChainReader) GetHeader(common.Hash, uint64) *types.Header { panic("not supported") } func (r *testerChainReader) GetBlock(common.Hash, uint64) *types.Block { panic("not supported") } @@ -374,7 +374,7 @@ func TestVoting(t *testing.T) { // Pass all the headers through clique and ensure tallying succeeds head := headers[len(headers)-1] - snap, err := New(¶ms.XDPoSConfig{Epoch: tt.epoch}, db).snapshot(&testerChainReader{db: db}, head.Number.Uint64(), head.Hash(), headers) + snap, err := New(¶ms.CliqueConfig{Epoch: tt.epoch}, db).snapshot(&testerChainReader{db: db}, head.Number.Uint64(), head.Hash(), headers) if err != nil { t.Errorf("test %d: failed to create voting snapshot: %v", i, err) continue