Skip to content

Commit

Permalink
fix: use rand bytes len 48
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Jul 8, 2024
1 parent b37c377 commit 219336b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions p2p/integrationtest/provider/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"math/big"
"time"

bls "github.com/ethereum/go-ethereum/crypto/bls12381"
providerapiv1 "github.com/primev/mev-commit/p2p/gen/go/providerapi/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
Expand Down Expand Up @@ -112,11 +111,12 @@ func (b *ProviderClient) CheckAndStake() error {
return nil
}

g1 := bls.NewG1()
privKey, _ := rand.Int(rand.Reader, g1.Q())
blsPubkey := g1.One()
g1.MulScalar(blsPubkey, blsPubkey, privKey)
blsPubkeyBytes := g1.ToBytes(blsPubkey)
blsPubkeyBytes := make([]byte, 48)
_, err = rand.Read(blsPubkeyBytes)
if err != nil {
b.logger.Error("failed to generate mock BLS public key", "err", err)
return err
}

_, err = b.client.RegisterStake(context.Background(), &providerapiv1.StakeRequest{
Amount: "10000000000000000000",
Expand Down

0 comments on commit 219336b

Please sign in to comment.