Skip to content

Commit c838c9d

Browse files
authored
fix: align struct fields for smallest memory use (#479)
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
1 parent dd7c64b commit c838c9d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

internal/api/chainsync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func configureChainSyncRoutes(apiGroup *gin.RouterGroup) {
3636
}
3737

3838
type requestChainSyncSync struct {
39-
Slot uint64 `form:"slot"`
4039
Hash string `form:"hash"`
40+
Slot uint64 `form:"slot"`
4141
Tip bool `form:"tip"`
4242
}
4343

internal/api/localstatequery.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func configureLocalStateQueryRoutes(apiGroup *gin.RouterGroup) {
3636
}
3737

3838
type responseLocalStateQueryCurrentEra struct {
39-
Id uint8 `json:"id"`
4039
Name string `json:"name"`
40+
Id uint8 `json:"id"`
4141
}
4242

4343
// handleLocalStateQueryCurrentEra godoc
@@ -149,10 +149,10 @@ func handleLocalStateQuerySystemStart(c *gin.Context) {
149149

150150
type responseLocalStateQueryTip struct {
151151
Era string `json:"era"`
152+
Hash string `json:"hash"`
152153
EpochNo int `json:"epoch_no"`
153154
BlockNo int64 `json:"block_no"`
154155
Slot uint64 `json:"slot_no"`
155-
Hash string `json:"hash"`
156156
}
157157

158158
// handleLocalStateQueryTip godoc

internal/config/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ type Config struct {
3434
}
3535

3636
type LoggingConfig struct {
37-
Healthchecks bool `yaml:"healthchecks" envconfig:"LOGGING_HEALTHCHECKS"`
3837
Level string `yaml:"level" envconfig:"LOGGING_LEVEL"`
38+
Healthchecks bool `yaml:"healthchecks" envconfig:"LOGGING_HEALTHCHECKS"`
3939
}
4040

4141
type ApiConfig struct {
@@ -55,13 +55,13 @@ type MetricsConfig struct {
5555

5656
type NodeConfig struct {
5757
Network string `yaml:"network" envconfig:"CARDANO_NETWORK"`
58-
NetworkMagic uint32 `yaml:"networkMagic" envconfig:"CARDANO_NODE_NETWORK_MAGIC"`
5958
Address string `yaml:"address" envconfig:"CARDANO_NODE_SOCKET_TCP_HOST"`
59+
SocketPath string `yaml:"socketPath" envconfig:"CARDANO_NODE_SOCKET_PATH"`
6060
Port uint `yaml:"port" envconfig:"CARDANO_NODE_SOCKET_TCP_PORT"`
6161
QueryTimeout uint `yaml:"queryTimeout" envconfig:"CARDANO_NODE_SOCKET_QUERY_TIMEOUT"`
62-
SkipCheck bool `yaml:"skipCheck" envconfig:"CARDANO_NODE_SKIP_CHECK"`
63-
SocketPath string `yaml:"socketPath" envconfig:"CARDANO_NODE_SOCKET_PATH"`
6462
Timeout uint `yaml:"timeout" envconfig:"CARDANO_NODE_SOCKET_TIMEOUT"`
63+
NetworkMagic uint32 `yaml:"networkMagic" envconfig:"CARDANO_NODE_NETWORK_MAGIC"`
64+
SkipCheck bool `yaml:"skipCheck" envconfig:"CARDANO_NODE_SKIP_CHECK"`
6565
}
6666

6767
type UtxorpcConfig struct {

0 commit comments

Comments
 (0)