/
types.go
37 lines (30 loc) · 1016 Bytes
/
types.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
package types
const MaxHashSubmissionsToExport = 20000
type BeaconExports []BeaconExport
type BeaconTimestampGenesisExports []BeaconTimestampGenesisExport
// BeaconTimestampLegacy is onlyused to support old style timestamp output for the legact REST endpoint
type BeaconTimestampLegacy struct {
BeaconID uint64 `json:"beacon_id"`
TimestampID uint64 `json:"timestamp_id"`
SubmitTime uint64 `json:"submit_time"`
Hash string `json:"hash"`
Owner string `json:"owner"`
}
func NewBeacon(beaconId uint64, moniker string, name string, lastTimeStampId uint64, owner string) (Beacon, error) {
b := Beacon{
BeaconId: beaconId,
Moniker: moniker,
Name: name,
LastTimestampId: lastTimeStampId,
Owner: owner,
}
return b, nil
}
func NewBeaconTimestamp(timestampId uint64, submitTime uint64, hash string) (BeaconTimestamp, error) {
bTs := BeaconTimestamp{
TimestampId: timestampId,
SubmitTime: submitTime,
Hash: hash,
}
return bTs, nil
}