radiance: use new shred API

Change-Id: Idd8f51b45561cfe6b9230d5a3555119efe14f867
This commit is contained in:
Richard Patel 2022-12-17 04:29:36 +00:00
parent ec8deb7ac2
commit a4b5063ff0
4 changed files with 5 additions and 4 deletions

View File

@ -62,7 +62,7 @@ func run(c *cobra.Command, args []string) {
}
// Create new walker object
walker, err := blockstore.NewBlockWalk(handles)
walker, err := blockstore.NewBlockWalk(handles, 2 /*TODO*/)
if err != nil {
klog.Exitf("Failed to create multi-DB iterator: %s", err)
}

View File

@ -10,6 +10,7 @@ go_library(
"@com_github_gagliardetto_binary//:binary",
"@com_github_gagliardetto_solana_go//:solana-go",
"@com_github_ipld_go_car//:go-car",
"@com_github_multiformats_go_multicodec//:go-multicodec",
"@com_github_spf13_cobra//:cobra",
"@io_k8s_klog_v2//:klog",
],

View File

@ -9,8 +9,8 @@ import (
bin "github.com/gagliardetto/binary"
"github.com/gagliardetto/solana-go"
"github.com/ipld/go-car"
"github.com/multiformats/go-multicodec"
"github.com/spf13/cobra"
"go.firedancer.io/radiance/pkg/ipld/ipldgen"
"k8s.io/klog/v2"
)
@ -42,7 +42,7 @@ func run(_ *cobra.Command, args []string) {
} else if err != nil {
klog.Exitf("Failed to read block: %s", err)
}
if block.Cid().Type() == ipldgen.SolanaTx {
if multicodec.Code(block.Cid().Type()) == multicodec.Raw {
var tx solana.Transaction
if err := bin.UnmarshalBin(&tx, block.RawData()); err != nil {
klog.Errorf("Invalid CID %s: %s", block.Cid(), err)

View File

@ -62,7 +62,7 @@ func run(c *cobra.Command, _ []string) {
}
// Open block iterator.
walker, err := blockstore.NewBlockWalk([]blockstore.WalkHandle{{DB: db}})
walker, err := blockstore.NewBlockWalk([]blockstore.WalkHandle{{DB: db}}, 2)
if err != nil {
klog.Fatal(err)
}