Commit 6f032d55 authored by QM's avatar QM

updata

parent 8a2227fd
...@@ -14,6 +14,7 @@ import ( ...@@ -14,6 +14,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/ethereum/go-ethereum/crypto/secp256k1"
solsha3 "github.com/miguelmota/go-solidity-sha3" solsha3 "github.com/miguelmota/go-solidity-sha3"
) )
...@@ -36,6 +37,15 @@ const ( ...@@ -36,6 +37,15 @@ const (
EthTxPending = EthTxStatus(2) EthTxPending = EthTxStatus(2)
) )
// GenerateClaimHash : Generates an OracleClaim hash from a ProphecyClaim's event data
func GenerateClaimHash(prophecyID []byte, sender []byte, recipient []byte, token []byte, amount []byte, validator []byte) common.Hash {
// Generate a hash containing the information
rawHash := crypto.Keccak256Hash(prophecyID, sender, recipient, token, amount, validator)
// Cast hash to hex encoded string
return rawHash
}
func SignClaim4Eth(hash common.Hash, privateKey *ecdsa.PrivateKey) ([]byte, error) { func SignClaim4Eth(hash common.Hash, privateKey *ecdsa.PrivateKey) ([]byte, error) {
rawSignature, _ := prefixMessage(hash, privateKey) rawSignature, _ := prefixMessage(hash, privateKey)
signature := hexutil.Bytes(rawSignature) signature := hexutil.Bytes(rawSignature)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment