Skip to content

Commit

Permalink
temp: eth address as account id
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Dec 20, 2024
1 parent 122a438 commit e5c5b52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions core/auth/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/Layr-Labs/eigenda/core"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
)

Expand Down Expand Up @@ -49,8 +48,8 @@ func (s *LocalBlobRequestSigner) SignBlobRequest(header core.BlobAuthHeader) ([]

func (s *LocalBlobRequestSigner) GetAccountID() (string, error) {

publicKeyBytes := crypto.FromECDSAPub(&s.PrivateKey.PublicKey)
return hexutil.Encode(publicKeyBytes), nil
accountId := crypto.PubkeyToAddress(s.PrivateKey.PublicKey).Hex()
return accountId, nil

}

Expand Down
6 changes: 2 additions & 4 deletions core/auth/v2/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

core "github.com/Layr-Labs/eigenda/core/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
)

Expand Down Expand Up @@ -63,9 +62,8 @@ func (s *LocalBlobRequestSigner) SignPaymentStateRequest() ([]byte, error) {

func (s *LocalBlobRequestSigner) GetAccountID() (string, error) {

publicKeyBytes := crypto.FromECDSAPub(&s.PrivateKey.PublicKey)
return hexutil.Encode(publicKeyBytes), nil

accountId := crypto.PubkeyToAddress(s.PrivateKey.PublicKey).Hex()
return accountId, nil
}

type LocalNoopSigner struct{}
Expand Down

0 comments on commit e5c5b52

Please sign in to comment.