2020-09-30 23:23:22 +00:00
|
|
|
package kv
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
2021-07-28 21:23:44 +00:00
|
|
|
v2 "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
2020-09-30 23:23:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestStore_SavePowchainData(t *testing.T) {
|
|
|
|
type args struct {
|
2021-07-22 20:05:06 +00:00
|
|
|
data *v2.ETH1ChainData
|
2020-09-30 23:23:22 +00:00
|
|
|
}
|
|
|
|
tests := []struct {
|
|
|
|
name string
|
|
|
|
args args
|
|
|
|
wantErr bool
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
name: "nil data",
|
|
|
|
args: args{
|
|
|
|
data: nil,
|
|
|
|
},
|
|
|
|
wantErr: true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
|
|
store := setupDB(t)
|
|
|
|
if err := store.SavePowchainData(context.Background(), tt.args.data); (err != nil) != tt.wantErr {
|
|
|
|
t.Errorf("SavePowchainData() error = %v, wantErr %v", err, tt.wantErr)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|