-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathack.go
53 lines (48 loc) · 1.39 KB
/
ack.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
// Copyright 2017 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package constants
const (
// MaxAckHeightDelta is the maximum number of blocks in the
// future we will set our HighestAckHeight too. This means
// 200 = max number of blocks to set the max height too on top
// of our current block height.
MaxAckHeightDelta = 200
)
// Ack status levels
const (
_ int = iota
AckStatusInvalid
AckStatusUnknown
AckStatusNotConfirmed
AckStatusACK
AckStatus1Minute
AckStatusDBlockConfirmed
)
// String forms of acks returned to users
const (
AckStatusInvalidString = "Invalid"
AckStatusUnknownString = "Unknown"
AckStatusNotConfirmedString = "NotConfirmed"
AckStatusACKString = "TransactionACK"
AckStatus1MinuteString = "1Minute"
AckStatusDBlockConfirmedString = "DBlockConfirmed"
)
// AckStatusString will convert the input status int to a human readable string
func AckStatusString(status int) string {
switch status {
case AckStatusInvalid:
return AckStatusInvalidString
case AckStatusUnknown:
return AckStatusUnknownString
case AckStatusNotConfirmed:
return AckStatusNotConfirmedString
case AckStatusACK:
return AckStatusACKString
case AckStatus1Minute:
return AckStatus1MinuteString
case AckStatusDBlockConfirmed:
return AckStatusDBlockConfirmedString
}
return "na"
}