Commit 873bc000 authored by Kero's avatar Kero Committed by GitHub

indexer: update format string for uuid.UUID (#9772)

* indexer: update format string for uuid.UUID

The relayEvent variable is of type uuid.UUID, but it's being formatted as an
integer (%d). This will cause a runtime error. Use %s to format the UUID as a
string.

* indexer: constraint l2_block_headers.timestamp > 0

* indexer: doc bigint.Clamp assumption
parent f2a9caef
......@@ -8,7 +8,7 @@ var (
)
// Clamp returns a new big.Int for `end` to which `end - start` <= size.
// @note (start, end) is an inclusive range
// @note (start, end) is an inclusive range. This function assumes that `start` is not greater than `end`.
func Clamp(start, end *big.Int, size uint64) *big.Int {
temp := new(big.Int)
count := temp.Sub(end, start).Uint64() + 1
......
......@@ -119,7 +119,7 @@ func (db bridgeMessagesDB) MarkRelayedL1BridgeMessage(messageHash common.Hash, r
if message.RelayedMessageEventGUID != nil && message.RelayedMessageEventGUID.ID() == relayEvent.ID() {
return nil
} else if message.RelayedMessageEventGUID != nil {
return fmt.Errorf("relayed message %s re-relayed with a different event %d", messageHash, relayEvent)
return fmt.Errorf("relayed message %s re-relayed with a different event %s", messageHash, relayEvent)
}
message.RelayedMessageEventGUID = &relayEvent
......
......@@ -33,7 +33,7 @@ CREATE TABLE IF NOT EXISTS l2_block_headers (
hash VARCHAR PRIMARY KEY,
parent_hash VARCHAR NOT NULL UNIQUE,
number UINT256 NOT NULL UNIQUE,
timestamp INTEGER NOT NULL,
timestamp INTEGER NOT NULL CHECK (timestamp > 0),
-- Raw Data
rlp_bytes VARCHAR NOT NULL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment