forked from DeathwingTheBoss/hivego
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestMocks.go
55 lines (47 loc) · 1.27 KB
/
testMocks.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
package hivego
import "time"
func getTestVoteOp() HiveOperation {
return voteOperation{
Voter: "xeroc",
Author: "xeroc",
Permlink: "piston",
Weight: 10000,
opText: "vote",
}
}
func getTestCustomJsonOp() HiveOperation {
return customJsonOperation{
RequiredAuths: []string{},
RequiredPostingAuths: []string{"xeroc"},
Id: "test-id",
Json: "{\"testk\":\"testv\"}",
opText: "custom_json",
}
}
func getTestAccountUpdateOp() HiveOperation {
return accountUpdateOperation{
Account: "sniperduel17",
Owner: nil,
Active: nil,
Posting: nil,
MemoKey: "STM6n4WcwyiC63udKYR8jDFuzG9T48dhy2Qb5sVmQ9MyNuKM7xE29",
JsonMetadata: "{\"foo\":\"bar\"}",
opText: "account_update",
}
}
func getTwoTestOps() []HiveOperation {
return []HiveOperation{getTestVoteOp(), getTestCustomJsonOp()}
}
func getTestTx(ops []HiveOperation) hiveTransaction {
exp, _ := time.Parse("2006-01-02T15:04:05", "2016-08-08T12:24:17")
expStr := exp.Format("2006-01-02T15:04:05")
return hiveTransaction{
RefBlockNum: 36029,
RefBlockPrefix: 1164960351,
Expiration: expStr,
Operations: ops,
}
}
func getTestVoteTx() hiveTransaction {
return getTestTx([]HiveOperation{getTestVoteOp()})
}