Skip to content

Commit

Permalink
fix tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard-Voiculescu committed Aug 8, 2024
1 parent 066c955 commit 9f0a708
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions injective/cmd/fireinjective/tools_fix_unknown_type_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/streamingfast/dstore"
firecore "github.com/streamingfast/firehose-core"
pbcosmos "github.com/streamingfast/firehose-cosmos/cosmos/pb/sf/cosmos/type/v2"
"github.com/streamingfast/firehose-cosmos/injective"
"github.com/streamingfast/logging"
"go.uber.org/zap"
proto "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
)

Expand Down Expand Up @@ -105,7 +105,7 @@ func fixUnknownTypeBlocksRunE(zlog *zap.Logger, tracer logging.Tracer) firecore.
blockCount++

injectiveBlock := &pbcosmos.Block{}
err = proto.Unmarshal(currentBlock.Payload.Value, injectiveBlock)
err = injective.UnmarshallerDiscardUnknown.Unmarshal(currentBlock.Payload.Value, injectiveBlock)
if err != nil {
return fmt.Errorf("unmarshaling block: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions injective/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"google.golang.org/protobuf/proto"
)

var unmarshallerDiscardUnknown = &proto.UnmarshalOptions{
var UnmarshallerDiscardUnknown = &proto.UnmarshalOptions{
DiscardUnknown: true,
}

Expand Down Expand Up @@ -54,7 +54,7 @@ func protoFlip(origin cosmoProto.Message, target proto.Message) error {
return fmt.Errorf("mashalling origin object %T: %w", data, err)
}

err = unmarshallerDiscardUnknown.Unmarshal(data, target)
err = UnmarshallerDiscardUnknown.Unmarshal(data, target)
if err != nil {
if e, ok := origin.(*abci.ResponseDeliverTx); ok {
fmt.Println("event data:", hex.EncodeToString(data))
Expand Down

0 comments on commit 9f0a708

Please sign in to comment.