mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-27 21:57:16 +00:00
d23b247a82
* Return an error on saving nil eth1data * gofmt * Merge branch 'master' into return-error-on-nil * Merge refs/heads/master into return-error-on-nil * Merge refs/heads/master into return-error-on-nil
36 lines
633 B
Go
36 lines
633 B
Go
package kv
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/proto/beacon/db"
|
|
)
|
|
|
|
func TestStore_SavePowchainData(t *testing.T) {
|
|
type args struct {
|
|
data *db.ETH1ChainData
|
|
}
|
|
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)
|
|
}
|
|
})
|
|
}
|
|
}
|