Skip to content

Commit 6736203

Browse files
committed
fix: go fmt
1 parent f845c32 commit 6736203

File tree

2 files changed

+61
-60
lines changed

2 files changed

+61
-60
lines changed

cmd/ulxly/ulxly.go

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -347,50 +347,50 @@ func balanceTree() error {
347347
return err
348348
}
349349
type BalanceEntry struct {
350-
OriginNetwork uint32 `json:"originNetwork"`
351-
OriginTokenAddress common.Address `json:"originTokenAddress"`
352-
TotalSupply string `json:"totalSupply"`
353-
}
354-
355-
var balanceEntries []BalanceEntry
356-
for tokenKey, balance := range balances {
357-
if balance.Cmp(big.NewInt(0)) == 0 {
358-
continue
359-
}
360-
361-
var token TokenInfo
362-
token, err = TokenInfoStringToStruct(tokenKey)
363-
if err != nil {
364-
return err
365-
}
366-
367-
if token.OriginNetwork.Uint64() == uint64(l2NetworkID) {
368-
continue
369-
}
350+
OriginNetwork uint32 `json:"originNetwork"`
351+
OriginTokenAddress common.Address `json:"originTokenAddress"`
352+
TotalSupply string `json:"totalSupply"`
353+
}
354+
355+
var balanceEntries []BalanceEntry
356+
for tokenKey, balance := range balances {
357+
if balance.Cmp(big.NewInt(0)) == 0 {
358+
continue
359+
}
360+
361+
var token TokenInfo
362+
token, err = TokenInfoStringToStruct(tokenKey)
363+
if err != nil {
364+
return err
365+
}
366+
367+
if token.OriginNetwork.Uint64() == uint64(l2NetworkID) {
368+
continue
369+
}
370370

371371
balanceEntries = append(balanceEntries, BalanceEntry{
372372
OriginNetwork: uint32(token.OriginNetwork.Uint64()),
373373
OriginTokenAddress: token.OriginTokenAddress,
374374
TotalSupply: balance.String(),
375375
})
376-
}
377-
378-
// Create the response structure
379-
response := struct {
380-
Root string `json:"root"`
381-
Balances []BalanceEntry `json:"balances"`
382-
}{
383-
Root: root.String(),
384-
Balances: balanceEntries,
385-
}
386-
387-
// Marshal to JSON with proper formatting
388-
jsonOutput, err := json.MarshalIndent(response, "", " ")
389-
if err != nil {
390-
return err
391-
}
392-
393-
fmt.Println(string(jsonOutput))
376+
}
377+
378+
// Create the response structure
379+
response := struct {
380+
Root string `json:"root"`
381+
Balances []BalanceEntry `json:"balances"`
382+
}{
383+
Root: root.String(),
384+
Balances: balanceEntries,
385+
}
386+
387+
// Marshal to JSON with proper formatting
388+
jsonOutput, err := json.MarshalIndent(response, "", " ")
389+
if err != nil {
390+
return err
391+
}
392+
393+
fmt.Println(string(jsonOutput))
394394
return nil
395395
}
396396

p2p/database/datastore.go

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,34 @@ type DatastoreEvent struct {
5757
// DatastoreHeader stores the data in manner that can be easily written without
5858
// loss of precision.
5959
type DatastoreHeader struct {
60-
ParentHash *datastore.Key
61-
UncleHash string `datastore:",noindex"`
62-
Coinbase string `datastore:",noindex"`
63-
Root string `datastore:",noindex"`
64-
TxHash string `datastore:",noindex"`
65-
ReceiptHash string `datastore:",noindex"`
66-
Bloom []byte `datastore:",noindex"`
67-
Difficulty string `datastore:",noindex"`
68-
Number string
69-
GasLimit string `datastore:",noindex"`
70-
GasUsed string
71-
Time time.Time
72-
Extra []byte `datastore:",noindex"`
73-
MixDigest string `datastore:",noindex"`
74-
Nonce string `datastore:",noindex"`
75-
BaseFee string `datastore:",noindex"`
76-
TimeFirstSeen time.Time
77-
TTL time.Time
78-
IsParent bool
60+
ParentHash *datastore.Key
61+
UncleHash string `datastore:",noindex"`
62+
Coinbase string `datastore:",noindex"`
63+
Root string `datastore:",noindex"`
64+
TxHash string `datastore:",noindex"`
65+
ReceiptHash string `datastore:",noindex"`
66+
Bloom []byte `datastore:",noindex"`
67+
Difficulty string `datastore:",noindex"`
68+
Number string
69+
GasLimit string `datastore:",noindex"`
70+
GasUsed string
71+
Time time.Time
72+
Extra []byte `datastore:",noindex"`
73+
MixDigest string `datastore:",noindex"`
74+
Nonce string `datastore:",noindex"`
75+
BaseFee string `datastore:",noindex"`
76+
TimeFirstSeen time.Time
77+
TTL time.Time
78+
IsParent bool
79+
SensorFirstSeen string
7980
}
8081

8182
// DatastoreBlock represents a block stored in datastore.
8283
type DatastoreBlock struct {
8384
*DatastoreHeader
84-
TotalDifficulty string `datastore:",noindex"`
85-
Transactions []*datastore.Key `datastore:",noindex"`
86-
Uncles []*datastore.Key `datastore:",noindex"`
85+
TotalDifficulty string `datastore:",noindex"`
86+
Transactions []*datastore.Key `datastore:",noindex"`
87+
Uncles []*datastore.Key `datastore:",noindex"`
8788
TimeFirstSeenHash time.Time
8889
SensorFirstSeenHash string
8990
}

0 commit comments

Comments
 (0)