forked from stellar/go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrust_line_flags_test.go
47 lines (33 loc) · 988 Bytes
/
trust_line_flags_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
package xdr_test
import (
"testing"
"github.com/stellar/go/xdr"
"github.com/stretchr/testify/assert"
)
func TestIsAuthorized(t *testing.T) {
tt := assert.New(t)
flag := xdr.TrustLineFlags(1)
tt.True(flag.IsAuthorized())
flag = xdr.TrustLineFlags(0)
tt.False(flag.IsAuthorized())
flag = xdr.TrustLineFlags(2)
tt.False(flag.IsAuthorized())
}
func TestIsAuthorizedToMaintainLiabilitiesFlag(t *testing.T) {
tt := assert.New(t)
flag := xdr.TrustLineFlags(1)
tt.False(flag.IsAuthorizedToMaintainLiabilitiesFlag())
flag = xdr.TrustLineFlags(0)
tt.False(flag.IsAuthorizedToMaintainLiabilitiesFlag())
flag = xdr.TrustLineFlags(2)
tt.True(flag.IsAuthorizedToMaintainLiabilitiesFlag())
}
func TestIsClawbackEnabledFlag(t *testing.T) {
tt := assert.New(t)
flag := xdr.TrustLineFlags(1)
tt.False(flag.IsClawbackEnabledFlag())
flag = xdr.TrustLineFlags(0)
tt.False(flag.IsClawbackEnabledFlag())
flag = xdr.TrustLineFlags(4)
tt.True(flag.IsClawbackEnabledFlag())
}