erigon-pulse/turbo/snapshotsync/snapshot_mode_test.go
Alex Sharov ecb10e8548
Snapshots download and seed (#3117)
* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* Squashed 'interfaces/' content from commit e5b1945d0

git-subtree-dir: interfaces
git-subtree-split: e5b1945d02da7a7f00e2289034ee90a6edd60184

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save

* save
2021-12-14 10:13:17 +00:00

44 lines
697 B
Go

package snapshotsync
/*
import (
"reflect"
"testing"
)
func TestSnapshotMode(t *testing.T) {
sm := SnapshotMode{}
sm.Receipts = true
if sm.ToString() != "r" {
t.Fatal(sm.ToString())
}
sm.State = true
if sm.ToString() != "sr" {
t.Fatal(sm.ToString())
}
sm.Bodies = true
if sm.ToString() != "bsr" {
t.Fatal(sm.ToString())
}
sm.Headers = true
if sm.ToString() != "hbsr" {
t.Fatal(sm.ToString())
}
}
func TestSnapshotModeFromString(t *testing.T) {
sm, err := SnapshotModeFromString("hsbr")
if err != nil {
t.Fatal(err)
}
if reflect.DeepEqual(sm, SnapshotMode{
Headers: true,
Bodies: true,
State: true,
Receipts: true,
}) == false {
t.Fatal(sm)
}
}
*/