Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
lmxdawn committed Jan 14, 2022
1 parent 027d337 commit d95411f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions engine/concurrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ func (c *ConCurrentEngine) GetTransactionReceipt(hash string) (int, error) {
if err != nil {
return 0, err
}
if t.Status == 1 {

}

return int(t.Status), nil
}
Expand All @@ -178,7 +175,7 @@ func NewEngine(config config.EngineConfig) (*ConCurrentEngine, error) {
var worker Worker
switch config.Protocol {
case "eth":
worker = NewEthWorker(config.Confirms, config.Rpc)
worker = NewEthWorker(config.Confirms, config.Contract, config.Rpc)
}

return &ConCurrentEngine{
Expand Down
4 changes: 3 additions & 1 deletion engine/eth_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ import (

type EthWorker struct {
confirms uint64 // 需要的确认数
contract string // 代币合约地址,为空表示主币
http *ethclient.Client
}

func NewEthWorker(confirms uint64, url string) *EthWorker {
func NewEthWorker(confirms uint64, contract string, url string) *EthWorker {
http := client.NewEthClient(url)
return &EthWorker{
confirms: confirms,
contract: contract,
http: http,
}
}
Expand Down

0 comments on commit d95411f

Please sign in to comment.