server: begin implementing gRPC methods

This commit is contained in:
George Tankersley
2018-12-10 19:43:48 -05:00
parent 79efd4b911
commit 54313b7c06
3 changed files with 60 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
package storage
import (
"context"
"database/sql"
"encoding/hex"
"encoding/json"
@@ -39,7 +40,7 @@ func TestSqliteStorage(t *testing.T) {
}
defer conn.Close()
err = createTables(conn)
err = CreateTables(conn)
if err != nil {
t.Fatal(err)
}
@@ -78,7 +79,7 @@ func TestSqliteStorage(t *testing.T) {
t.Errorf("Wrong row count, want %d got %d", len(compactTests), count)
}
blockHeight, err := CurrentHeight(conn)
blockHeight, err := GetCurrentHeight(context.Background(), conn)
if err != nil {
t.Error(errors.Wrap(err, fmt.Sprintf("checking current block height")))
}
@@ -88,7 +89,7 @@ func TestSqliteStorage(t *testing.T) {
t.Errorf("Wrong block height, got: %d", blockHeight)
}
retBlock, err := GetBlock(conn, blockHeight)
retBlock, err := GetBlock(context.Background(), conn, blockHeight)
if err != nil {
t.Error(errors.Wrap(err, "retrieving stored block"))
}