forked from eoscanada/eos-go
/
responses_test.go
116 lines (109 loc) · 2.18 KB
/
responses_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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package eos
import (
"testing"
"encoding/json"
"github.com/stretchr/testify/assert"
)
func TestUnmarshalAccountResp(t *testing.T) {
resp := &AccountResp{}
err := json.Unmarshal([]byte(jsonData), resp)
assert.NoError(t, err)
assert.Equal(t, AccountName("eosriobrazil"), resp.AccountName)
}
var jsonData = `{
"account_name": "eosriobrazil",
"head_block_num": 5264738,
"head_block_time": "2018-07-11T04:29:16.500",
"privileged": false,
"last_code_update": "1970-01-01T00:00:00.000",
"created": "2018-06-10T13:09:26.500",
"core_liquid_balance": "695.2674 EOS",
"ram_quota": 145360,
"net_weight": 324628,
"cpu_weight": 329628,
"net_limit": {
"used": 550,
"available": 17636233,
"max": 17636783
},
"cpu_limit": {
"used": 14728,
"available": 3396286,
"max": 3411014
},
"ram_usage": 5935,
"permissions": [
{
"perm_name": "active",
"parent": "owner",
"required_auth": {
"threshold": 1,
"keys": [
{
"key": "EOS6HSE9SVvNmGF4Dv8cHLUjF8BigorYykUG2z8UbHZd1BQ9qF88r",
"weight": 1
}
],
"accounts": [],
"waits": []
}
},
{
"perm_name": "claim",
"parent": "active",
"required_auth": {
"threshold": 1,
"keys": [
{
"key": "EOS7FJJ7igorHoTq6y6yd7GmRei9cc6CRhR7L2TXP6H9UFEP49jNc",
"weight": 1
}
],
"accounts": [],
"waits": []
}
},
{
"perm_name": "owner",
"parent": "",
"required_auth": {
"threshold": 1,
"keys": [
{
"key": "EOS5UhWBMYKPPzb4tigorbnrH9Ft7mogW1MmvViaHJkBif2kSa1f4",
"weight": 1
}
],
"accounts": [],
"waits": []
}
}
],
"total_resources": {
"owner": "eosriobrazil",
"net_weight": "32.4628 EOS",
"cpu_weight": "32.9628 EOS",
"ram_bytes": 145360
},
"self_delegated_bandwidth": {
"from": "eosriobrazil",
"to": "eosriobrazil",
"net_weight": "32.4628 EOS",
"cpu_weight": "32.9628 EOS"
},
"refund_request": {
"owner": "eosriobrazil",
"request_time": "2018-07-09T20:54:31",
"net_amount": "2.9284 EOS",
"cpu_amount": "2.9284 EOS"
},
"voter_info": {
"owner": "eosriobrazil",
"proxy": "",
"producers": [],
"staked": 804256,
"last_vote_weight": "171334771736.95532226562500000",
"proxied_vote_weight": "0.00000000000000000",
"is_proxy": 0
}
}`