-
Notifications
You must be signed in to change notification settings - Fork 0
/
transfer_test.go
49 lines (39 loc) · 1.15 KB
/
transfer_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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package bc
import (
"context"
"testing"
"time"
"github.com/shopspring/decimal"
)
func TestClient_Transfer(t *testing.T) {
c, _ := NewFromKeySecret("2827d81f-6ae0-4842-b92f-6576afe36863", "ad6a84a9edf84d42ac1e1915b194529f", "a7f46d5fad1f43ca9bcbdc0afc22aad0")
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Second)
defer cancel()
var input = &TransferInput{
AssetID: "rbc",
OpponentID: "a30bf8dd-e87f-4ff7-9da8-4abad6f3234e",
Amount: decimal.NewFromFloat(2),
Memo: "unit test",
}
result, err := c.Transfer(ctx, input)
t.Log(result)
if err != nil {
t.Error(err)
}
}
func TestClientGenerateTransfer(t *testing.T) {
c, _ := NewFromKeySecret("2827d81f-6ae0-4842-b92f-6576afe36863", "ad6a84a9edf84d42ac1e1915b194529f", "a7f46d5fad1f43ca9bcbdc0afc22aad0")
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Second)
defer cancel()
var input = &GenerateTransferInput{
AssetID: "rbc",
UserID: "a30bf8dd-e87f-4ff7-9da8-4abad6f3234e",
Amount: decimal.NewFromFloat(2),
Memo: "unit test",
}
result, err := c.GenerateTransfer(ctx, input)
t.Log(result)
if err != nil {
t.Error(err)
}
}