func (w *Wallet) SignHash(h Hash) (*Signature, error) {
	message := crypto.Keccak256(
		[]byte("\x19Ethereum Signed Message:\n32"),
		h.Bytes(),
	)

	sigBytes, err := crypto.Sign(message, w.PrivateKey)
	if err != nil {
		return &Signature{}, err
	}

	sig := &Signature{
		R: BytesToHash(sigBytes[0:32]),
		S: BytesToHash(sigBytes[32:64]),
		V: sigBytes[64] + 27,
	}

	return sig, nil
}
// SignHash signs a hashed message with a wallet private key
// and returns it as a Signature object
SignHash signs a hashed message with a wallet private key
and returns it as a Signature object
// SignHash signs a hashed message with a wallet private key // and returns it as a Signature object
func (w *Wallet) SignHash(h Hash) (*Signature, error) {
	message := crypto.Keccak256(
		[]byte("\x19Ethereum Signed Message:\n32"),
		h.Bytes(),
	)
	sigBytes, err := crypto.Sign(message, w.PrivateKey)
	if err != nil {
		return &Signature{}, err
	}
	sig := &Signature{
		R: BytesToHash(sigBytes[0:32]),
		S: BytesToHash(sigBytes[32:64]),
		V: sigBytes[64] + 27,
	}
	return sig, nil
}
func ( w * Wallet ) SignHash ( h Hash ) ( * Signature , error ) { message := crypto . Keccak256 ( [ ] byte ( " \x19 \n " ) , h . Bytes ( ) , ) sigBytes , err := crypto . Sign ( message , w . PrivateKey ) if err != nil { return & Signature { } , err } sig := & Signature { R : BytesToHash ( sigBytes [ 0 : 32 ] ) , S : BytesToHash ( sigBytes [ 32 : 64 ] ) , V : sigBytes [ 64 ] + 27 , } return sig , nil }
SignHash signs a hashed message with a wallet private key
and returns it as a Signature object
SignHash signs a hashed message with a wallet private key and returns it as a Signature object