mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
Add ethclient.Client.BlockNumber method for access to current block number (needed by ResourceHandler) Add placeholder manifest support
20 lines
436 B
Go
20 lines
436 B
Go
package storage
|
|
|
|
import (
|
|
"crypto/ecdsa"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/ethereum/go-ethereum/crypto"
|
|
)
|
|
|
|
// matches the SignFunc type
|
|
func NewGenericResourceSigner(privKey *ecdsa.PrivateKey) SignFunc {
|
|
return func(data common.Hash) (signature Signature, err error) {
|
|
signaturebytes, err := crypto.Sign(data.Bytes(), privKey)
|
|
if err != nil {
|
|
return
|
|
}
|
|
copy(signature[:], signaturebytes)
|
|
return
|
|
}
|
|
}
|