mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-18 04:40:03 +02:00
jsontime: skip aliases and use actual format and location
This is so weird. this works in tests but not when running the application. I guess there is some weird global state race condition going on because its used by antelope-go. Should rewrite the jsontime api because I have forked it anyway.
This commit is contained in:
parent
01054fb0bf
commit
2b3dc35393
2 changed files with 3 additions and 9 deletions
|
|
@ -1,8 +1,6 @@
|
||||||
package json
|
package json
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
jsontime "github.com/eosswedenorg-go/jsontime/v2"
|
jsontime "github.com/eosswedenorg-go/jsontime/v2"
|
||||||
"github.com/eosswedenorg/thalos/api/message"
|
"github.com/eosswedenorg/thalos/api/message"
|
||||||
)
|
)
|
||||||
|
|
@ -17,10 +15,6 @@ func createCodec() message.Codec {
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// Set timeformat used by SHIP api
|
|
||||||
jsontime.AddTimeFormatAlias("ship", "2006-01-02T15:04:05.000")
|
|
||||||
jsontime.AddLocaleAlias("ship", time.UTC)
|
|
||||||
|
|
||||||
// Register the json codec.
|
// Register the json codec.
|
||||||
message.RegisterCodec("json", createCodec())
|
message.RegisterCodec("json", createCodec())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ type AccountAuthSequence struct {
|
||||||
type TransactionTrace struct {
|
type TransactionTrace struct {
|
||||||
ID string `json:"id" msgpack:"id"`
|
ID string `json:"id" msgpack:"id"`
|
||||||
BlockNum uint32 `json:"blocknum" msgpack:"blocknum"`
|
BlockNum uint32 `json:"blocknum" msgpack:"blocknum"`
|
||||||
Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp" time_format:"ship" time_location:"ship"`
|
Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp" time_format:"2006-01-02T15:04:05.000" time_location:"UTC"`
|
||||||
Status string `json:"status" msgpack:"status"`
|
Status string `json:"status" msgpack:"status"`
|
||||||
CPUUsageUS uint32 `json:"cpu_usage_us" msgpack:"cpu_usage_us"`
|
CPUUsageUS uint32 `json:"cpu_usage_us" msgpack:"cpu_usage_us"`
|
||||||
NetUsageWords uint32 `json:"net_usage_words" msgpack:"net_usage_words"`
|
NetUsageWords uint32 `json:"net_usage_words" msgpack:"net_usage_words"`
|
||||||
|
|
@ -54,7 +54,7 @@ type ActionTrace struct {
|
||||||
|
|
||||||
BlockNum uint32 `json:"blocknum" msgpack:"blocknum"`
|
BlockNum uint32 `json:"blocknum" msgpack:"blocknum"`
|
||||||
|
|
||||||
Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp" time_format:"ship" time_location:"ship"`
|
Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp" time_format:"2006-01-02T15:04:05.000" time_location:"UTC"`
|
||||||
|
|
||||||
Receipt *ActionReceipt `json:"receipt,omitempty" msgpack:"receipt"`
|
Receipt *ActionReceipt `json:"receipt,omitempty" msgpack:"receipt"`
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ type TableDeltaRow struct {
|
||||||
|
|
||||||
type TableDelta struct {
|
type TableDelta struct {
|
||||||
BlockNum uint32 `json:"blocknum" msgpack:"blocknum"`
|
BlockNum uint32 `json:"blocknum" msgpack:"blocknum"`
|
||||||
Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp" time_format:"ship" time_location:"ship"`
|
Timestamp time.Time `json:"blocktimestamp" msgpack:"blocktimestamp" time_format:"2006-01-02T15:04:05.000" time_location:"UTC"`
|
||||||
Name string `json:"name" msgpack:"name"`
|
Name string `json:"name" msgpack:"name"`
|
||||||
Rows []TableDeltaRow `json:"rows" msgpack:"rows"`
|
Rows []TableDeltaRow `json:"rows" msgpack:"rows"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue