Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use the new library to parse cid from builtin_actor_event #1292

Merged
merged 2 commits into from
Apr 25, 2024
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ require (
github.com/hibiken/asynq v0.23.0
github.com/hibiken/asynq/x v0.0.0-20220413130846-5c723f597e01
github.com/ipfs/go-ipld-format v0.6.0
github.com/ipld/go-ipld-prime v0.21.0
github.com/jedib0t/go-pretty/v6 v6.2.7
github.com/libp2p/go-libp2p v0.33.2
github.com/multiformats/go-varint v0.0.7
Expand Down Expand Up @@ -209,7 +210,6 @@ require (
github.com/ipld/go-car/v2 v2.13.1 // indirect
github.com/ipld/go-codec-dagpb v1.6.0 // indirect
github.com/ipld/go-ipld-adl-hamt v0.0.0-20220616142416-9004dbd839e0 // indirect
github.com/ipld/go-ipld-prime v0.21.0 // indirect
github.com/ipld/go-ipld-selector-text-lite v0.0.1 // indirect
github.com/ipni/go-libipni v0.0.8 // indirect
github.com/ipni/index-provider v0.12.0 // indirect
Expand Down
6 changes: 5 additions & 1 deletion tasks/messages/builtinactorevent/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import (
"github.com/fxamacker/cbor/v2"
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
"github.com/ipld/go-ipld-prime"
"github.com/ipld/go-ipld-prime/codec/dagcbor"
"github.com/ipld/go-ipld-prime/node/bindnode"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
)
Expand Down Expand Up @@ -153,11 +156,12 @@ func cborValueDecode(key string, value []byte) interface{} {
}
return resultBIGINT
case CID:
err = cbor.Unmarshal(value, &resultCID)
nd, err := ipld.DecodeUsingPrototype(value, dagcbor.Decode, bindnode.Prototype((*cid.Cid)(nil), nil))
if err != nil {
log.Errorf("cbor.Unmarshal err: %v, key: %v, value: %v", err, key, value)
return nil
}
resultCID = *bindnode.Unwrap(nd).(*cid.Cid)
return resultCID
}

Expand Down