Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions database/plugin/metadata/sqlite/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (d *MetadataStoreSqlite) SetStakeDeregistration(
slot uint64,
txn *gorm.DB,
) error {
stakeKey := cert.StakeDeregistration.Credential.Bytes()
stakeKey := cert.StakeCredential.Credential.Bytes()
tmpAccount, err := d.GetAccount(stakeKey, txn)
if err != nil {
return err
Expand Down Expand Up @@ -206,7 +206,7 @@ func (d *MetadataStoreSqlite) SetStakeRegistration(
slot, deposit uint64,
txn *gorm.DB,
) error {
stakeKey := cert.StakeRegistration.Credential.Bytes()
stakeKey := cert.StakeCredential.Credential.Bytes()
tmpItem := models.StakeRegistration{
StakingKey: stakeKey,
AddedSlot: slot,
Expand Down
2 changes: 1 addition & 1 deletion database/plugin/metadata/sqlite/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (d *MetadataStoreSqlite) GetStakeRegistrations(
for _, cert := range certs {
tmpCert = lcommon.StakeRegistrationCertificate{
CertType: lcommon.CertificateTypeStakeRegistration,
StakeRegistration: lcommon.Credential{
StakeCredential: lcommon.Credential{
// TODO: determine correct type
// CredType: lcommon.CredentialTypeAddrKeyHash,
Credential: lcommon.CredentialHash(cert.StakingKey),
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
connectrpc.com/connect v1.18.1
connectrpc.com/grpchealth v1.4.0
connectrpc.com/grpcreflect v1.3.0
github.com/blinklabs-io/gouroboros v0.133.0
github.com/blinklabs-io/gouroboros v0.134.1
github.com/blinklabs-io/ouroboros-mock v0.3.8
github.com/dgraph-io/badger/v4 v4.8.0
github.com/glebarez/sqlite v1.11.0
Expand Down Expand Up @@ -50,14 +50,14 @@ require (
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.20.0 // indirect
github.com/blinklabs-io/plutigo v0.0.7 // indirect
github.com/blinklabs-io/plutigo v0.0.10 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.5 // indirect
github.com/btcsuite/btcd/btcutil v1.1.6 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect
github.com/consensys/gnark-crypto v0.18.0 // indirect
github.com/consensys/gnark-crypto v0.19.0 // indirect
github.com/decred/dcrd/crypto/blake256 v1.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU=
github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/blinklabs-io/gouroboros v0.133.0 h1:/ts+A6YWS+10WgYORKT9UGqCfuCDnMUAWVR+cFwv92E=
github.com/blinklabs-io/gouroboros v0.133.0/go.mod h1:A/vuCLJDIEqjTqzXkfY4HGUmLc+aGR03tjJ8qmTAxcA=
github.com/blinklabs-io/gouroboros v0.134.1 h1:mobm99ieNY5A+9pgaWo616LYNkPFbA2E5UHSnQPCQvg=
github.com/blinklabs-io/gouroboros v0.134.1/go.mod h1:jYzafdK0peltC1ZawLnFNGAq/ZwFrbNZc0z/nH03J2U=
github.com/blinklabs-io/ouroboros-mock v0.3.8 h1:+DAt2rx0ouZUxee5DBMgZq3I1+ZdxFSHG9g3tYl/FKU=
github.com/blinklabs-io/ouroboros-mock v0.3.8/go.mod h1:UwQIf4KqZwO13P9d90fbi3UL/X7JaJfeEbqk+bEeFQA=
github.com/blinklabs-io/plutigo v0.0.7 h1:wgb7v47FggrZEfikolV12WhPsWEXzFyzLtak5IrAOEk=
github.com/blinklabs-io/plutigo v0.0.7/go.mod h1:gxTWAu9n7+4SgQ+zAoO91LYU+5WanUNdRkl9mLdm8f8=
github.com/blinklabs-io/plutigo v0.0.10 h1:h/yg65Krkzkg45AfOhbZLRgGD51zwS8RR91eQa5qDow=
github.com/blinklabs-io/plutigo v0.0.10/go.mod h1:L639Q8i2cSRuBhjgCHttPR0nnYwwsYVT4Btz7KpQjSw=
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M=
github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A=
Expand Down Expand Up @@ -85,8 +85,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 h1:aQ3y1lwWyqYPiWZThqv1aFbZMiM9vblcSArJRf2Irls=
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/consensys/gnark-crypto v0.18.0 h1:vIye/FqI50VeAr0B3dx+YjeIvmc3LWz4yEfbWBpTUf0=
github.com/consensys/gnark-crypto v0.18.0/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c=
github.com/consensys/gnark-crypto v0.19.0 h1:zXCqeY2txSaMl6G5wFpZzMWJU9HPNh8qxPnYJ1BL9vA=
github.com/consensys/gnark-crypto v0.19.0/go.mod h1:rT23F0XSZqE0mUA0+pRtnL56IbPxs6gp4CeRsBk4XS0=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
7 changes: 6 additions & 1 deletion ledger/eras/conway.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ func EvaluateTxConway(
// Evaluate scripts
var retTotalExUnits lcommon.ExUnits
retRedeemerExUnits := make(map[lcommon.RedeemerKey]lcommon.ExUnits)
var txInfoV3 script.TxInfo = script.NewTxInfoV3FromTransaction(tx, slices.Concat(resolvedInputs, resolvedRefInputs))
var txInfoV3 script.TxInfo
var err error
txInfoV3, err = script.NewTxInfoV3FromTransaction(ls, tx, slices.Concat(resolvedInputs, resolvedRefInputs))
if err != nil {
return 0, lcommon.ExUnits{}, nil, err
}
for _, redeemerPair := range txInfoV3.(script.TxInfoV3).Redeemers {
purpose := redeemerPair.Key
if purpose == nil {
Expand Down
15 changes: 15 additions & 0 deletions ledger/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package ledger

import (
"time"

"github.com/blinklabs-io/dingo/database"
lcommon "github.com/blinklabs-io/gouroboros/ledger/common"
)
Expand Down Expand Up @@ -71,3 +73,16 @@ func (lv *LedgerView) StakeRegistration(
// stakingKey = lcommon.NewBlake2b224(stakingKey)
return lv.ls.db.GetStakeRegistrations(stakingKey, lv.txn)
}

func (lv *LedgerView) TimeToSlot(t time.Time) (uint64, error) {
return lv.ls.TimeToSlot(t)
}

func (lv *LedgerView) SlotToTime(slot uint64) (time.Time, error) {
return lv.ls.SlotToTime(slot)
}

func (lv *LedgerView) PoolCurrentState(poolId []byte) (*lcommon.PoolRegistrationCertificate, *uint64, error) {
// TODO: implement this
return nil, nil, nil
}
Loading