Skip to content

Commit

Permalink
fix_: remove go-ethereum's UnmarshalPubkey usage
Browse files Browse the repository at this point in the history
fixes: #6330
  • Loading branch information
osmaczko committed Feb 6, 2025
1 parent a05fa5f commit e803219
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion appdatabase/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"

"github.com/status-im/status-go/appdatabase/migrations"
migrationsprevnodecfg "github.com/status-im/status-go/appdatabase/migrationsprevnodecfg"
"github.com/status-im/status-go/eth-node/crypto"
"github.com/status-im/status-go/nodecfg"
"github.com/status-im/status-go/services/wallet/bigint"
w_common "github.com/status-im/status-go/services/wallet/common"
Expand Down
16 changes: 8 additions & 8 deletions wakuv1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ import (

"go.uber.org/zap"

"github.com/status-im/status-go/logutils"

ethtypes "github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/waku/types"
"github.com/status-im/status-go/wakuv1/common"

ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/rpc"

gocommon "github.com/status-im/status-go/common"
"github.com/status-im/status-go/eth-node/crypto"
ethtypes "github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/logutils"
"github.com/status-im/status-go/waku/types"
"github.com/status-im/status-go/wakuv1/common"
)

// List of errors
Expand Down Expand Up @@ -362,7 +362,7 @@ func (api *PublicWakuAPI) Messages(ctx context.Context, crit types.Criteria) (*r
return nil, ErrInvalidSymmetricKey
}
filter.KeySym = key
filter.SymKeyHash = crypto.Keccak256Hash(filter.KeySym)
filter.SymKeyHash = ethcommon.Hash(crypto.Keccak256Hash(filter.KeySym))
}

// listen for messages that are encrypted with the given public key
Expand Down
18 changes: 9 additions & 9 deletions wakuv2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ import (

"go.uber.org/zap"

"google.golang.org/protobuf/proto"

"github.com/waku-org/go-waku/waku/v2/payload"
"github.com/waku-org/go-waku/waku/v2/protocol/pb"

ethtypes "github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/logutils"
"github.com/status-im/status-go/waku/types"
"github.com/status-im/status-go/wakuv2/common"

ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/rpc"

"google.golang.org/protobuf/proto"

gocommon "github.com/status-im/status-go/common"
"github.com/status-im/status-go/eth-node/crypto"
ethtypes "github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/logutils"
"github.com/status-im/status-go/waku/types"
"github.com/status-im/status-go/wakuv2/common"
)

// List of errors
Expand Down Expand Up @@ -320,7 +320,7 @@ func (api *PublicWakuAPI) Messages(ctx context.Context, crit types.Criteria) (*r
return nil, ErrInvalidSymmetricKey
}
filter.KeySym = key
filter.SymKeyHash = crypto.Keccak256Hash(filter.KeySym)
filter.SymKeyHash = ethcommon.Hash(crypto.Keccak256Hash(filter.KeySym))
}

// listen for messages that are encrypted with the given public key
Expand Down
2 changes: 1 addition & 1 deletion wakuv2/persistence/signed_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"go.uber.org/zap"

"github.com/ethereum/go-ethereum/crypto"
"github.com/status-im/status-go/eth-node/crypto"
)

// DBStore is a MessageProvider that has a *sql.DB connection
Expand Down

0 comments on commit e803219

Please sign in to comment.