fix: empty etched at

This commit is contained in:
Gaze
2024-04-18 23:55:59 +07:00
parent 7de6357ff3
commit 83df900d7f
2 changed files with 5 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"time"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/cockroachdb/errors"
"github.com/gaze-network/indexer-network/common"
@@ -138,6 +139,9 @@ func (p *Processor) ensureGenesisRune(ctx context.Context) error {
BurnedAmount: uint128.Zero,
CompletedAt: time.Time{},
CompletedAtHeight: nil,
EtchingBlock: 1,
EtchingTxHash: chainhash.Hash{},
EtchedAt: time.Time{},
}
if err := p.runesDg.CreateRuneEntry(ctx, runeEntry, genesisRuneId.BlockHeight); err != nil {
return errors.Wrap(err, "failed to create genesis rune entry")

View File

@@ -221,11 +221,7 @@ func mapRuneEntryTypeToParams(src runes.RuneEntry, blockHeight uint64) (gen.Crea
}
}
}
var etchedAt pgtype.Timestamp
if !src.EtchedAt.IsZero() {
etchedAt.Time = src.EtchedAt
etchedAt.Valid = true
}
etchedAt := pgtype.Timestamp{Time: time.Time{}, Valid: true}
return gen.CreateRuneEntryParams{
RuneID: runeId,