-
Notifications
You must be signed in to change notification settings - Fork 2
/
client_test.go
31 lines (26 loc) · 787 Bytes
/
client_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main_test
import (
"alice-tss/pb"
"context"
"log"
"testing"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
func TestGRPCClient(t *testing.T) {
conn, err := grpc.Dial("0.0.0.0:2234", grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Fatalf("failed to connect: %v", err)
}
defer conn.Close()
client := pb.NewTssServiceClient(conn)
bookList, err := client.SignMessage(context.Background(), &pb.SignRequest{
Hash: "0x5a73c8fb1b418fdd33985b0b3a8561243abbb5cf1af3f0a368502939e3a4d658",
Pubkey: "02d890e326fc2ea4f67d8eb6dc451779836fe7a15a2643b901d342f76ba06d7674",
Message: "tss-service",
})
if err != nil {
log.Fatalf("failed to get book list: %v", err)
}
log.Printf("book list: %v", bookList)
}