Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
a2ede293
Commit
a2ede293
authored
Jun 04, 2020
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updata ethereum_test.go
parent
41e56ff3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
auxiliary.go
plugin/dapp/x2ethereum/ebrelayer/ethtxs/auxiliary.go
+11
-3
ethereum_test.go
...pp/x2ethereum/ebrelayer/relayer/ethereum/ethereum_test.go
+0
-0
No files found.
plugin/dapp/x2ethereum/ebrelayer/ethtxs/auxiliary.go
View file @
a2ede293
...
...
@@ -3,6 +3,7 @@ package ethtxs
import
(
"context"
"errors"
"fmt"
"math/big"
"github.com/33cn/plugin/plugin/dapp/x2ethereum/ebrelayer/ethcontract/generated"
...
...
@@ -64,6 +65,13 @@ func CreateBridgeToken(symbol string, client ethinterface.EthClientSpec, para *O
if
nil
!=
err
{
return
""
,
err
}
sim
,
isSim
:=
client
.
(
*
ethinterface
.
SimExtend
)
if
isSim
{
fmt
.
Println
(
"Use the simulator"
)
sim
.
Commit
()
}
err
=
waitEthTxFinished
(
client
,
tx
.
Hash
(),
"CreateBridgeToken"
)
if
nil
!=
err
{
return
""
,
err
...
...
@@ -406,7 +414,7 @@ func LockEthErc20Asset(ownerPrivateKeyStr, tokenAddrStr, chain33Receiver string,
}
func
LockEthErc20AssetAsync
(
ownerPrivateKeyStr
,
tokenAddrStr
,
chain33Receiver
string
,
amount
*
big
.
Int
,
client
ethinterface
.
EthClientSpec
,
bridgeBank
*
generated
.
BridgeBank
)
(
string
,
error
)
{
txslog
.
Info
(
"LockEthErc20Asset"
,
"ownerPrivateKeyStr"
,
ownerPrivateKeyStr
,
"tokenAddrStr"
,
tokenAddrStr
,
"chain33Receiver"
,
chain33Receiver
,
"amount"
,
amount
.
String
())
txslog
.
Info
(
"LockEthErc20Asset
Async
"
,
"ownerPrivateKeyStr"
,
ownerPrivateKeyStr
,
"tokenAddrStr"
,
tokenAddrStr
,
"chain33Receiver"
,
chain33Receiver
,
"amount"
,
amount
.
String
())
ownerPrivateKey
,
err
:=
crypto
.
ToECDSA
(
common
.
FromHex
(
ownerPrivateKeyStr
))
if
nil
!=
err
{
return
""
,
err
...
...
@@ -415,7 +423,7 @@ func LockEthErc20AssetAsync(ownerPrivateKeyStr, tokenAddrStr, chain33Receiver st
auth
,
err
:=
PrepareAuth
(
client
,
ownerPrivateKey
,
ownerAddr
)
if
nil
!=
err
{
txslog
.
Error
(
"LockEthErc20Asset"
,
"PrepareAuth err"
,
err
.
Error
())
txslog
.
Error
(
"LockEthErc20Asset
Async
"
,
"PrepareAuth err"
,
err
.
Error
())
return
""
,
err
}
//ETH转账,空地址,且设置value
...
...
@@ -429,7 +437,7 @@ func LockEthErc20AssetAsync(ownerPrivateKeyStr, tokenAddrStr, chain33Receiver st
}
tx
,
err
:=
bridgeBank
.
Lock
(
auth
,
[]
byte
(
chain33Receiver
),
tokenAddr
,
amount
)
if
nil
!=
err
{
txslog
.
Error
(
"LockEthErc20Asset"
,
"lock err"
,
err
.
Error
())
txslog
.
Error
(
"LockEthErc20Asset
Async
"
,
"lock err"
,
err
.
Error
())
_
,
err
=
revokeNonce
(
ownerAddr
)
if
err
!=
nil
{
return
""
,
err
...
...
plugin/dapp/x2ethereum/ebrelayer/relayer/ethereum/ethereum_test.go
View file @
a2ede293
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment