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
b4d05579
Commit
b4d05579
authored
May 12, 2020
by
whisker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix amount bug
parent
fc43ccae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
allRelayerTest.sh
plugin/dapp/x2Ethereum/cmd/build/allRelayerTest.sh
+1
-0
perf_test.sh
plugin/dapp/x2Ethereum/cmd/build/perf_test.sh
+15
-16
keeper.go
plugin/dapp/x2Ethereum/executor/ethbridge/keeper.go
+1
-0
No files found.
plugin/dapp/x2Ethereum/cmd/build/allRelayerTest.sh
View file @
b4d05579
...
@@ -42,6 +42,7 @@ ethReceiverAddr2="0x0c05ba5c230fdaa503b53702af1962e08d0c60bf"
...
@@ -42,6 +42,7 @@ ethReceiverAddr2="0x0c05ba5c230fdaa503b53702af1962e08d0c60bf"
ethReceiverAddrKey2
=
"9dc6df3a8ab139a54d8a984f54958ae0661f880229bf3bdbb886b87d58b56a08"
ethReceiverAddrKey2
=
"9dc6df3a8ab139a54d8a984f54958ae0661f880229bf3bdbb886b87d58b56a08"
maturityDegree
=
10
maturityDegree
=
10
tokenAddrBty
=
""
tokenAddrBty
=
""
tokenAddr
=
""
function
kill_ebrelayerC
()
{
function
kill_ebrelayerC
()
{
kill_ebrelayer
"./C/ebrelayer"
kill_ebrelayer
"./C/ebrelayer"
...
...
plugin/dapp/x2Ethereum/cmd/build/perf_test.sh
View file @
b4d05579
...
@@ -2,13 +2,12 @@
...
@@ -2,13 +2,12 @@
set
-x
set
-x
source
"./publicTest.sh"
source
"./publicTest.sh"
source
"./allRelayerTest.sh"
CLIA
=
"./ebcli_A"
CLIA
=
"./ebcli_A"
Chain33_CLI
=
""
Chain33_CLI
=
""
Ethsender
=
"0xa4ea64a583f6e51c3799335b28a8f0529570a635"
Ethsender
=
"0xa4ea64a583f6e51c3799335b28a8f0529570a635"
tokenAddr
=
"0x9C3D40A44a2F61Ef8D46fa8C7A731C08FB16cCEF"
testcAddr
=
"0xb43393f9f588fC18Bbd8E99716c25291dB804b41"
ethSender0PrivateKey
=
"3fa21584ae2e4fd74db9b58e2386f5481607dfa4d7ba0617aaa7858e5025dc1e"
ethSender0PrivateKey
=
"3fa21584ae2e4fd74db9b58e2386f5481607dfa4d7ba0617aaa7858e5025dc1e"
...
@@ -111,8 +110,8 @@ loop_send_lock_bty() {
...
@@ -111,8 +110,8 @@ loop_send_lock_bty() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
preEthBalance[
$i
]=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
preEthBalance[
$i
]=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
Bty
}
"
| jq
-r
".balance"
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum lock
-q
"
${
tokenAddr
}
"
-a
1
-r
${
ethAddress
[i]
}
-t
bty
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum lock
-q
"
${
tokenAddr
Bty
}
"
-a
1
-r
${
ethAddress
[i]
}
-t
bty
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
echo
${
i
}
"lock chain33 tx hash:"
${
ethTxHash
}
echo
${
i
}
"lock chain33 tx hash:"
${
ethTxHash
}
let
i++
let
i++
done
done
...
@@ -121,7 +120,7 @@ loop_send_lock_bty() {
...
@@ -121,7 +120,7 @@ loop_send_lock_bty() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
Bty
}
"
| jq
-r
".balance"
)
res
=
$((
nowEthBalance
-
preEthBalance[i]
))
res
=
$((
nowEthBalance
-
preEthBalance[i]
))
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
check_number
"
${
res
}
"
1
check_number
"
${
res
}
"
1
...
@@ -142,9 +141,9 @@ loop_send_burn_bty() {
...
@@ -142,9 +141,9 @@ loop_send_burn_bty() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
preEthBalance[
$i
]=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
preEthBalance[
$i
]=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
Bty
}
"
| jq
-r
".balance"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
1
-k
"
${
privateKeys
[i]
}
"
-t
"
${
tokenAddr
}
"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
1
-k
"
${
privateKeys
[i]
}
"
-t
"
${
tokenAddr
Bty
}
"
)
ethTxHash
=
$(${
CLIA
}
relayer ethereum burn-async
-m
1
-k
"
${
privateKeys
[i]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
"
${
tokenAddr
}
"
)
ethTxHash
=
$(${
CLIA
}
relayer ethereum burn-async
-m
1
-k
"
${
privateKeys
[i]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
"
${
tokenAddr
Bty
}
"
)
echo
${
i
}
"burn-async tx hash:"
${
ethTxHash
}
echo
${
i
}
"burn-async tx hash:"
${
ethTxHash
}
let
i++
let
i++
done
done
...
@@ -153,7 +152,7 @@ loop_send_burn_bty() {
...
@@ -153,7 +152,7 @@ loop_send_burn_bty() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
Bty
}
"
| jq
-r
".balance"
)
res
=
$((
preEthBalance[i]
-
nowEthBalance
))
res
=
$((
preEthBalance[i]
-
nowEthBalance
))
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
check_number
"
${
res
}
"
1
check_number
"
${
res
}
"
1
...
@@ -172,20 +171,20 @@ loop_send_lock_erc20() {
...
@@ -172,20 +171,20 @@ loop_send_lock_erc20() {
preChain33Balance
=
$(${
Chain33_CLI
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
testc | jq
".res"
| jq
".[]"
| jq
".balance"
|
sed
's/\"//g'
)
preChain33Balance
=
$(${
Chain33_CLI
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
testc | jq
".res"
| jq
".[]"
| jq
".balance"
|
sed
's/\"//g'
)
i
=
0
i
=
0
preEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
${
t
estc
Addr
}
"
| jq
-r
".balance"
)
preEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
${
t
oken
Addr
}
"
| jq
-r
".balance"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
10
-k
"
${
privateKeys
[8]
}
"
-t
"
${
t
estc
Addr
}
"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
10
-k
"
${
privateKeys
[8]
}
"
-t
"
${
t
oken
Addr
}
"
)
echo
${
i
}
"lock-async erc20 approve tx hash:"
${
approveTxHash
}
echo
${
i
}
"lock-async erc20 approve tx hash:"
${
approveTxHash
}
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
ethTxHash
=
$(${
CLIA
}
relayer ethereum lock-async
-m
1
-k
"
${
privateKeys
[8]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
"
${
t
estc
Addr
}
"
)
ethTxHash
=
$(${
CLIA
}
relayer ethereum lock-async
-m
1
-k
"
${
privateKeys
[8]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
"
${
t
oken
Addr
}
"
)
echo
${
i
}
"lock-async erc20 tx hash:"
${
ethTxHash
}
echo
${
i
}
"lock-async erc20 tx hash:"
${
ethTxHash
}
let
i++
let
i++
done
done
eth_block_wait
$((
maturityDegree
+
2
))
eth_block_wait
$((
maturityDegree
+
2
))
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
${
t
estc
Addr
}
"
| jq
-r
".balance"
)
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
${
t
oken
Addr
}
"
| jq
-r
".balance"
)
res
=
$((
preEthBalance
-
nowEthBalance
))
res
=
$((
preEthBalance
-
nowEthBalance
))
echo
${
i
}
"preBalance"
${
preEthBalance
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
echo
${
i
}
"preBalance"
${
preEthBalance
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
check_number
"
${
diff
}
"
10
check_number
"
${
diff
}
"
10
...
@@ -205,8 +204,8 @@ loop_send_burn_erc20() {
...
@@ -205,8 +204,8 @@ loop_send_burn_erc20() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
preEthBalance[i]
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
t
estc
Addr
}
"
| jq
-r
".balance"
)
preEthBalance[i]
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
t
oken
Addr
}
"
| jq
-r
".balance"
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum burn
-a
1
-r
${
ethAddress
[i]
}
-t
testc
-q
"
${
t
estc
Addr
}
"
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum burn
-a
1
-r
${
ethAddress
[i]
}
-t
testc
-q
"
${
t
oken
Addr
}
"
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
echo
${
i
}
"burn chain33 tx hash:"
${
ethTxHash
}
echo
${
i
}
"burn chain33 tx hash:"
${
ethTxHash
}
let
i++
let
i++
done
done
...
@@ -215,7 +214,7 @@ loop_send_burn_erc20() {
...
@@ -215,7 +214,7 @@ loop_send_burn_erc20() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
t
estc
Addr
}
"
| jq
-r
".balance"
)
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
t
oken
Addr
}
"
| jq
-r
".balance"
)
res
=
$((
nowEthBalance
-
preEthBalance[i]
))
res
=
$((
nowEthBalance
-
preEthBalance[i]
))
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
check_number
"
${
res
}
"
1
check_number
"
${
res
}
"
1
...
...
plugin/dapp/x2Ethereum/executor/ethbridge/keeper.go
View file @
b4d05579
...
@@ -97,6 +97,7 @@ func (k Keeper) ProcessSuccessfulClaimForBurn(claim, execAddr, tokenSymbol strin
...
@@ -97,6 +97,7 @@ func (k Keeper) ProcessSuccessfulClaimForBurn(claim, execAddr, tokenSymbol strin
// ProcessBurn processes the burn of bridged coins from the given sender
// ProcessBurn processes the burn of bridged coins from the given sender
func
(
k
Keeper
)
ProcessBurn
(
address
,
execAddr
,
amount
,
tokenAddress
string
,
d
int64
,
accDB
*
account
.
DB
)
(
*
types2
.
Receipt
,
error
)
{
func
(
k
Keeper
)
ProcessBurn
(
address
,
execAddr
,
amount
,
tokenAddress
string
,
d
int64
,
accDB
*
account
.
DB
)
(
*
types2
.
Receipt
,
error
)
{
var
a
int64
var
a
int64
a
,
_
=
strconv
.
ParseInt
(
types
.
TrimZeroAndDot
(
amount
),
10
,
64
)
receipt
,
err
:=
accDB
.
ExecWithdraw
(
execAddr
,
address
,
a
)
receipt
,
err
:=
accDB
.
ExecWithdraw
(
execAddr
,
address
,
a
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
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