Commit efe9dcbe authored by hezhengjun's avatar hezhengjun

fix linter

parent ac44f5a2
...@@ -10,7 +10,6 @@ package ethtxs ...@@ -10,7 +10,6 @@ package ethtxs
// -------------------------------------------------------- // --------------------------------------------------------
import ( import (
"crypto/ecdsa"
"math/big" "math/big"
"strings" "strings"
...@@ -117,34 +116,6 @@ func ParseBurnLockTxReceipt(claimType events.Event, receipt *chain33Types.Receip ...@@ -117,34 +116,6 @@ func ParseBurnLockTxReceipt(claimType events.Event, receipt *chain33Types.Receip
return nil return nil
} }
// ProphecyClaimToSignedOracleClaim : packages and signs a prophecy claim's data, returning a new oracle claim
func ProphecyClaimToSignedOracleClaim(event events.NewProphecyClaimEvent, privateKey *ecdsa.PrivateKey) (*OracleClaim, error) {
// Parse relevant data into type byte[]
prophecyID := event.ProphecyID.Bytes()
sender := event.Chain33Sender
recipient := []byte(event.EthereumReceiver.Hex())
token := []byte(event.TokenAddress.Hex())
amount := event.Amount.Bytes()
validator := []byte(event.ValidatorAddress.Hex())
// Generate rawHash using ProphecyClaim data
hash := GenerateClaimHash(prophecyID, sender, recipient, token, amount, validator)
// Sign the hash using the active validator's private key
signature, err := SignClaim4Eth(hash, privateKey)
if nil != err {
return nil, err
}
// Package the ProphecyID, Message, and Signature into an OracleClaim
oracleClaim := &OracleClaim{
ProphecyID: event.ProphecyID,
Message: hash,
Signature: signature,
}
return oracleClaim, nil
}
// Chain33MsgToProphecyClaim : parses event data from a Chain33Msg, packaging it as a ProphecyClaim // Chain33MsgToProphecyClaim : parses event data from a Chain33Msg, packaging it as a ProphecyClaim
func Chain33MsgToProphecyClaim(event events.Chain33Msg) ProphecyClaim { func Chain33MsgToProphecyClaim(event events.Chain33Msg) ProphecyClaim {
claimType := event.ClaimType claimType := event.ClaimType
......
...@@ -113,7 +113,7 @@ func GetLockedFunds(bridgeBank *generated.BridgeBank, tokenAddrStr string) (stri ...@@ -113,7 +113,7 @@ func GetLockedFunds(bridgeBank *generated.BridgeBank, tokenAddrStr string) (stri
return balance.String(), nil return balance.String(), nil
} }
func GetDepositFunds(client ethinterface.EthClientSpec, tokenAddrStr string) (string, error) { func GetDepositFunds(client bind.ContractBackend, tokenAddrStr string) (string, error) {
if tokenAddrStr == "" { if tokenAddrStr == "" {
return "", errors.New("nil token address") return "", errors.New("nil token address")
} }
......
...@@ -141,7 +141,7 @@ func bindOrResumePush(cfg *relayerTypes.SyncTxReceiptConfig) { ...@@ -141,7 +141,7 @@ func bindOrResumePush(cfg *relayerTypes.SyncTxReceiptConfig) {
} }
if !res.IsOk { if !res.IsOk {
fmt.Println("Failed to AddSubscribeTxReceipt to rpc addr:", cfg.Chain33Host, "ReplySubTxReceipt", res) fmt.Println("Failed to AddSubscribeTxReceipt to rpc addr:", cfg.Chain33Host, "ReplySubTxReceipt", res)
panic("bindOrResumePush client failed due to:" + string(res.Msg)) panic("bindOrResumePush client failed due to:" + res.Msg)
} }
log.Info("bindOrResumePush", "Succeed to AddSubscribeTxReceipt for rpc address:", cfg.Chain33Host) log.Info("bindOrResumePush", "Succeed to AddSubscribeTxReceipt for rpc address:", cfg.Chain33Host)
fmt.Println("Succeed to AddPushSubscribe") fmt.Println("Succeed to AddPushSubscribe")
......
...@@ -46,7 +46,6 @@ type Relayer4Ethereum struct { ...@@ -46,7 +46,6 @@ type Relayer4Ethereum struct {
privateKey4Chain33 chain33Crypto.PrivKey privateKey4Chain33 chain33Crypto.PrivKey
ethValidator common.Address ethValidator common.Address
totalTx4Eth2Chain33 int64 totalTx4Eth2Chain33 int64
totalTx4Chain33ToEth int64
rpcURL2Chain33 string rpcURL2Chain33 string
unlockchan chan int unlockchan chan int
maturityDegree int32 maturityDegree int32
......
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