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
a1c96130
Commit
a1c96130
authored
Dec 20, 2021
by
hezhengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add permission process for token withdraw
parent
832075c0
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
465 additions
and
77 deletions
+465
-77
ethereumRelayerCmd.go
plugin/dapp/cross2eth/ebcli/ethereumRelayerCmd.go
+4
-0
relayer.proto
plugin/dapp/cross2eth/ebrelayer/proto/relayer.proto
+22
-2
ethereum.go
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
+97
-28
store.go
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/store.go
+60
-12
manager.go
plugin/dapp/cross2eth/ebrelayer/relayer/manager.go
+1
-1
relayer.pb.go
plugin/dapp/cross2eth/ebrelayer/types/relayer.pb.go
+281
-34
No files found.
plugin/dapp/cross2eth/ebcli/ethereumRelayerCmd.go
View file @
a1c96130
...
@@ -1204,16 +1204,20 @@ func addCfgWithdrawFlags(cmd *cobra.Command) {
...
@@ -1204,16 +1204,20 @@ func addCfgWithdrawFlags(cmd *cobra.Command) {
_
=
cmd
.
MarkFlagRequired
(
"symbol"
)
_
=
cmd
.
MarkFlagRequired
(
"symbol"
)
cmd
.
Flags
()
.
Int64P
(
"fee"
,
"f"
,
0
,
"fee amount"
)
cmd
.
Flags
()
.
Int64P
(
"fee"
,
"f"
,
0
,
"fee amount"
)
_
=
cmd
.
MarkFlagRequired
(
"fee"
)
_
=
cmd
.
MarkFlagRequired
(
"fee"
)
cmd
.
Flags
()
.
Int64P
(
"amount"
,
"a"
,
0
,
"accumulative amount allowed to be withdrew per day"
)
_
=
cmd
.
MarkFlagRequired
(
"amount"
)
}
}
func
CfgWithdraw
(
cmd
*
cobra
.
Command
,
_
[]
string
)
{
func
CfgWithdraw
(
cmd
*
cobra
.
Command
,
_
[]
string
)
{
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
symbol
,
_
:=
cmd
.
Flags
()
.
GetString
(
"symbol"
)
symbol
,
_
:=
cmd
.
Flags
()
.
GetString
(
"symbol"
)
fee
,
_
:=
cmd
.
Flags
()
.
GetInt64
(
"fee"
)
fee
,
_
:=
cmd
.
Flags
()
.
GetInt64
(
"fee"
)
amount
,
_
:=
cmd
.
Flags
()
.
GetInt64
(
"amount"
)
req
:=
&
ebTypes
.
CfgWithdrawReq
{
req
:=
&
ebTypes
.
CfgWithdrawReq
{
Symbol
:
symbol
,
Symbol
:
symbol
,
FeeAmount
:
fee
,
FeeAmount
:
fee
,
AmountPerDay
:
amount
,
}
}
var
res
rpctypes
.
Reply
var
res
rpctypes
.
Reply
...
...
plugin/dapp/cross2eth/ebrelayer/proto/relayer.proto
View file @
a1c96130
...
@@ -249,10 +249,30 @@ message ResendChain33EventReq {
...
@@ -249,10 +249,30 @@ message ResendChain33EventReq {
message
CfgWithdrawReq
{
message
CfgWithdrawReq
{
string
symbol
=
1
;
string
symbol
=
1
;
int64
feeAmount
=
2
;
int64
feeAmount
=
2
;
int64
amountPerDay
=
3
;
}
}
message
WithdrawSymbol2Fee
{
message
withdrawPara
{
map
<
string
,
int64
>
symbol2Fee
=
1
;
int64
fee
=
1
;
int64
amountPerDay
=
2
;
}
message
WithdrawSymbol2Para
{
map
<
string
,
withdrawPara
>
symbol2Para
=
1
;
}
message
WithdrawTx
{
string
chain33Sender
=
1
;
string
ethereumReceiver
=
2
;
string
symbol
=
4
;
int64
amount
=
5
;
int64
nonce
=
6
;
string
txHashOnChain33
=
7
;
string
txHashOnEthereum
=
8
;
int32
year
=
9
;
int32
month
=
10
;
int32
day
=
11
;
string
status
=
12
;
}
}
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
View file @
a1c96130
...
@@ -20,6 +20,8 @@ import (
...
@@ -20,6 +20,8 @@ import (
"sync/atomic"
"sync/atomic"
"time"
"time"
chain33EvmCommon
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/common"
"github.com/33cn/plugin/plugin/dapp/cross2eth/ebrelayer/utils"
"github.com/33cn/plugin/plugin/dapp/cross2eth/ebrelayer/utils"
dbm
"github.com/33cn/chain33/common/db"
dbm
"github.com/33cn/chain33/common/db"
...
@@ -75,7 +77,7 @@ type Relayer4Ethereum struct {
...
@@ -75,7 +77,7 @@ type Relayer4Ethereum struct {
symbol2Addr
map
[
string
]
common
.
Address
symbol2Addr
map
[
string
]
common
.
Address
symbol2LockAddr
map
[
string
]
ebTypes
.
TokenAddress
symbol2LockAddr
map
[
string
]
ebTypes
.
TokenAddress
mulSignAddr
string
mulSignAddr
string
withdrawFee
map
[
string
]
int64
withdrawFee
map
[
string
]
*
ebTypes
.
WithdrawPara
}
}
var
(
var
(
...
@@ -463,7 +465,6 @@ func (ethRelayer *Relayer4Ethereum) proc() {
...
@@ -463,7 +465,6 @@ func (ethRelayer *Relayer4Ethereum) proc() {
var
timer
*
time
.
Ticker
var
timer
*
time
.
Ticker
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
continueFailCount
:=
int32
(
0
)
for
range
ethRelayer
.
unlockchan
{
for
range
ethRelayer
.
unlockchan
{
relayerLog
.
Info
(
"Received ethRelayer.unlockchan"
)
relayerLog
.
Info
(
"Received ethRelayer.unlockchan"
)
ethRelayer
.
rwLock
.
RLock
()
ethRelayer
.
rwLock
.
RLock
()
...
@@ -485,7 +486,7 @@ latter:
...
@@ -485,7 +486,7 @@ latter:
for
{
for
{
select
{
select
{
case
<-
timer
.
C
:
case
<-
timer
.
C
:
ethRelayer
.
procNewHeight
(
ctx
,
&
continueFailCount
)
ethRelayer
.
procNewHeight
(
ctx
)
case
err
:=
<-
ethRelayer
.
bridgeBankSub
.
Err
()
:
case
err
:=
<-
ethRelayer
.
bridgeBankSub
.
Err
()
:
relayerLog
.
Error
(
"proc"
,
"bridgeBankSub err"
,
err
.
Error
())
relayerLog
.
Error
(
"proc"
,
"bridgeBankSub err"
,
err
.
Error
())
ethRelayer
.
subscribeEvent
()
ethRelayer
.
subscribeEvent
()
...
@@ -508,7 +509,39 @@ func (ethRelayer *Relayer4Ethereum) handleChain33Msg(chain33Msg *events.Chain33M
...
@@ -508,7 +509,39 @@ func (ethRelayer *Relayer4Ethereum) handleChain33Msg(chain33Msg *events.Chain33M
return
return
}
}
type
WithdrawTx
struct
{
Chain33Sender
chain33EvmCommon
.
Address
EthereumReceiver
common
.
Address
TokenContractAddress
chain33EvmCommon
.
Address
Symbol
string
Amount
*
big
.
Int
TxHash
[]
byte
Nonce
int64
year
int
month
int
day
int
}
func
(
ethRelayer
*
Relayer4Ethereum
)
checkPermissionWithinOneDay
(
withdrawTx
*
ebTypes
.
WithdrawTx
)
(
bool
,
error
)
{
totalAlready
,
err
:=
ethRelayer
.
getWithdrawsWithinSameDay
(
withdrawTx
)
if
nil
!=
err
{
relayerLog
.
Error
(
"checkPermissionWithinOneDay"
,
"Failed to getWithdrawsWithinSameDay due to"
,
err
.
Error
())
return
false
,
errors
.
New
(
"ErrGetWithdrawsWithinSameDay"
)
}
withdrawPara
,
ok
:=
ethRelayer
.
withdrawFee
[
withdrawTx
.
Symbol
]
if
!
ok
{
relayerLog
.
Error
(
"checkPermissionWithinOneDay"
,
"No withdraw parameter configured for symbol "
,
withdrawTx
.
Symbol
)
return
false
,
errors
.
New
(
"ErrNoWithdrawParaCfged"
)
}
if
totalAlready
+
withdrawTx
.
Amount
>
withdrawPara
.
AmountPerDay
{
relayerLog
.
Error
(
"checkPermissionWithinOneDay"
,
"No withdraw parameter configured for symbol "
,
withdrawTx
.
Symbol
)
return
false
,
errors
.
New
(
"ErrWithdrawAmountTooBig"
)
}
return
true
,
nil
}
func
(
ethRelayer
*
Relayer4Ethereum
)
handleLogWithdraw
(
chain33Msg
*
events
.
Chain33Msg
)
{
func
(
ethRelayer
*
Relayer4Ethereum
)
handleLogWithdraw
(
chain33Msg
*
events
.
Chain33Msg
)
{
//只有通过代理人登录的中继器,才处理提币事件
if
!
ethRelayer
.
processWithDraw
{
if
!
ethRelayer
.
processWithDraw
{
relayerLog
.
Info
(
"handleLogWithdraw"
,
"Needn't process withdraw for this relay validator"
,
ethRelayer
.
ethSender
)
relayerLog
.
Info
(
"handleLogWithdraw"
,
"Needn't process withdraw for this relay validator"
,
ethRelayer
.
ethSender
)
return
return
...
@@ -521,6 +554,29 @@ func (ethRelayer *Relayer4Ethereum) handleLogWithdraw(chain33Msg *events.Chain33
...
@@ -521,6 +554,29 @@ func (ethRelayer *Relayer4Ethereum) handleLogWithdraw(chain33Msg *events.Chain33
return
return
}
}
now
:=
time
.
Now
()
year
,
month
,
day
:=
now
.
Date
()
withdrawTx
:=
&
ebTypes
.
WithdrawTx
{
Chain33Sender
:
chain33Msg
.
Chain33Sender
.
String
(),
EthereumReceiver
:
chain33Msg
.
EthereumReceiver
.
String
(),
Symbol
:
chain33Msg
.
Symbol
,
Amount
:
chain33Msg
.
Amount
.
Int64
(),
TxHashOnChain33
:
common
.
Bytes2Hex
(
chain33Msg
.
TxHash
),
Nonce
:
chain33Msg
.
Nonce
,
Year
:
int32
(
year
),
Month
:
int32
(
month
),
Day
:
int32
(
day
),
}
if
ok
,
err
:=
ethRelayer
.
checkPermissionWithinOneDay
(
withdrawTx
);
!
ok
{
withdrawTx
.
Status
=
err
.
Error
()
err
:=
ethRelayer
.
setWithdraw
(
withdrawTx
)
if
nil
!=
err
{
relayerLog
.
Error
(
"handleLogWithdraw"
,
"Failed to setWithdraw due to:"
,
err
.
Error
())
}
return
}
tokenAddr
:=
common
.
HexToAddress
(
withdrawFromChain33TokenInfo
.
Address
)
tokenAddr
:=
common
.
HexToAddress
(
withdrawFromChain33TokenInfo
.
Address
)
//从chain33进行withdraw回来的token需要根据精度进行相应的缩放
//从chain33进行withdraw回来的token需要根据精度进行相应的缩放
if
8
!=
withdrawFromChain33TokenInfo
.
Decimal
{
if
8
!=
withdrawFromChain33TokenInfo
.
Decimal
{
...
@@ -546,9 +602,19 @@ func (ethRelayer *Relayer4Ethereum) handleLogWithdraw(chain33Msg *events.Chain33
...
@@ -546,9 +602,19 @@ func (ethRelayer *Relayer4Ethereum) handleLogWithdraw(chain33Msg *events.Chain33
"Receiver on Ethereum"
,
chain33Msg
.
EthereumReceiver
.
String
())
"Receiver on Ethereum"
,
chain33Msg
.
EthereumReceiver
.
String
())
//TODO:此处需要完成在以太坊发送以太或者ERC20数字资产的操作
//TODO:此处需要完成在以太坊发送以太或者ERC20数字资产的操作
withdrawTx
.
Status
=
"Withdraw Tx has been sent to Ethereum"
err
:=
ethRelayer
.
setWithdraw
(
withdrawTx
)
if
nil
!=
err
{
relayerLog
.
Error
(
"handleLogWithdraw"
,
"Failed to setWithdraw due to:"
,
err
.
Error
())
}
return
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
handleLogLockBurn
(
chain33Msg
*
events
.
Chain33Msg
)
{
func
(
ethRelayer
*
Relayer4Ethereum
)
handleLogLockBurn
(
chain33Msg
*
events
.
Chain33Msg
)
{
//对于通过代理人登录的中继器,不处理lock和burn事件
if
ethRelayer
.
processWithDraw
{
relayerLog
.
Info
(
"handleLogWithdraw"
,
"Needn't process lock and burn for this withdraw process specified validator"
,
ethRelayer
.
ethSender
)
return
}
relayerLog
.
Info
(
"handleLogLockBurn"
,
"Received chain33Msg"
,
chain33Msg
,
"tx hash string"
,
common
.
Bytes2Hex
(
chain33Msg
.
TxHash
))
relayerLog
.
Info
(
"handleLogLockBurn"
,
"Received chain33Msg"
,
chain33Msg
,
"tx hash string"
,
common
.
Bytes2Hex
(
chain33Msg
.
TxHash
))
// Parse the Chain33Msg into a ProphecyClaim for relay to Ethereum
// Parse the Chain33Msg into a ProphecyClaim for relay to Ethereum
...
@@ -648,30 +714,33 @@ func (ethRelayer *Relayer4Ethereum) handleLogLockBurn(chain33Msg *events.Chain33
...
@@ -648,30 +714,33 @@ func (ethRelayer *Relayer4Ethereum) handleLogLockBurn(chain33Msg *events.Chain33
"Chain33Sender"
,
statics
.
Chain33Sender
)
"Chain33Sender"
,
statics
.
Chain33Sender
)
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
procNewHeight
(
ctx
context
.
Context
,
continueFailCount
*
int32
)
{
func
(
ethRelayer
*
Relayer4Ethereum
)
getCurrentHeight
(
ctx
context
.
Context
)
(
uint64
,
error
)
{
head
,
err
:=
ethRelayer
.
clientSpec
.
HeaderByNumber
(
ctx
,
nil
)
head
,
err
:=
ethRelayer
.
clientSpec
.
HeaderByNumber
(
ctx
,
nil
)
if
nil
!=
err
{
if
nil
==
err
{
*
continueFailCount
++
return
head
.
Number
.
Uint64
(),
nil
if
*
continueFailCount
>=
5
{
}
//TODO: 需要在下面添加报警处理
for
{
time
.
Sleep
(
5
*
time
.
Second
)
ethRelayer
.
clientSpec
,
err
=
ethtxs
.
SetupWebsocketEthClient
(
ethRelayer
.
providerHttp
)
ethRelayer
.
clientSpec
,
err
=
ethtxs
.
SetupWebsocketEthClient
(
ethRelayer
.
providerHttp
)
if
err
!=
nil
{
if
err
!=
nil
{
relayerLog
.
Error
(
"SetupWebsocketEthClient"
,
"err"
,
err
)
relayerLog
.
Error
(
"getCurrentHeight"
,
"Failed to SetupWebsocketEthClient due to:"
,
err
.
Error
()
)
return
continue
}
}
head
,
err
:=
ethRelayer
.
clientSpec
.
HeaderByNumber
(
ctx
,
nil
)
if
nil
!=
err
{
relayerLog
.
Error
(
"getCurrentHeight"
,
"Failed to HeaderByNumber due to:"
,
err
.
Error
())
continue
}
}
//retry
return
head
.
Number
.
Uint64
(),
nil
head
,
err
=
ethRelayer
.
clientSpec
.
HeaderByNumber
(
ctx
,
nil
)
if
err
!=
nil
{
relayerLog
.
Error
(
"Failed to get ethereum height"
,
"provider"
,
ethRelayer
.
provider
,
"continueFailCount"
,
continueFailCount
,
"err"
,
err
.
Error
())
return
}
}
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
procNewHeight
(
ctx
context
.
Context
)
{
currentHeight
,
_
:=
ethRelayer
.
getCurrentHeight
(
ctx
)
ethRelayer
.
updateTxStatus
()
ethRelayer
.
updateTxStatus
()
*
continueFailCount
=
0
//currentHeight := head.Number.Uint64()
currentHeight
:=
head
.
Number
.
Uint64
()
relayerLog
.
Info
(
"procNewHeight"
,
"currentHeight"
,
currentHeight
,
"ethRelayer.eventLogIndex.Height"
,
ethRelayer
.
eventLogIndex
.
Height
,
"uint64(ethRelayer.maturityDegree)"
,
uint64
(
ethRelayer
.
maturityDegree
))
relayerLog
.
Info
(
"procNewHeight"
,
"currentHeight"
,
currentHeight
,
"ethRelayer.eventLogIndex.Height"
,
ethRelayer
.
eventLogIndex
.
Height
,
"uint64(ethRelayer.maturityDegree)"
,
uint64
(
ethRelayer
.
maturityDegree
))
//一次最大只获取10个logEvent进行处理
//一次最大只获取10个logEvent进行处理
...
@@ -795,12 +864,8 @@ func (ethRelayer *Relayer4Ethereum) filterLogEvents() {
...
@@ -795,12 +864,8 @@ func (ethRelayer *Relayer4Ethereum) filterLogEvents() {
height4BridgeBankLogAt
=
deployHeight
height4BridgeBankLogAt
=
deployHeight
}
}
header
,
err
:=
ethRelayer
.
clientSpec
.
HeaderByNumber
(
context
.
Background
(),
nil
)
curHeightUint64
,
_
:=
ethRelayer
.
getCurrentHeight
(
context
.
Background
())
if
err
!=
nil
{
curHeight
:=
int64
(
curHeightUint64
)
errinfo
:=
fmt
.
Sprintf
(
"Failed to get HeaderByNumbers due to:%s"
,
err
.
Error
())
panic
(
errinfo
)
}
curHeight
:=
int64
(
header
.
Number
.
Uint64
())
relayerLog
.
Info
(
"filterLogEvents"
,
"curHeight:"
,
curHeight
)
relayerLog
.
Info
(
"filterLogEvents"
,
"curHeight:"
,
curHeight
)
bridgeBankSig
:=
make
(
map
[
string
]
bool
)
bridgeBankSig
:=
make
(
map
[
string
]
bool
)
...
@@ -1133,9 +1198,13 @@ func (ethRelayer *Relayer4Ethereum) SetMultiSignAddr(address string) {
...
@@ -1133,9 +1198,13 @@ func (ethRelayer *Relayer4Ethereum) SetMultiSignAddr(address string) {
ethRelayer
.
setMultiSignAddress
(
address
)
ethRelayer
.
setMultiSignAddress
(
address
)
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
CfgWithdraw
(
symbol
string
,
feeAmount
int64
)
error
{
func
(
ethRelayer
*
Relayer4Ethereum
)
CfgWithdraw
(
symbol
string
,
feeAmount
,
amountPerDay
int64
)
error
{
withdrawPara
:=
&
ebTypes
.
WithdrawPara
{
Fee
:
feeAmount
,
AmountPerDay
:
amountPerDay
,
}
ethRelayer
.
rwLock
.
Lock
()
ethRelayer
.
rwLock
.
Lock
()
ethRelayer
.
withdrawFee
[
symbol
]
=
feeAmount
ethRelayer
.
withdrawFee
[
symbol
]
=
withdrawPara
ethRelayer
.
rwLock
.
Unlock
()
ethRelayer
.
rwLock
.
Unlock
()
return
ethRelayer
.
setWithdrawFee
(
ethRelayer
.
withdrawFee
)
return
ethRelayer
.
setWithdrawFee
(
ethRelayer
.
withdrawFee
)
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/store.go
View file @
a1c96130
...
@@ -27,7 +27,8 @@ var (
...
@@ -27,7 +27,8 @@ var (
ethLockTxUpdateTxIndex
=
[]
byte
(
"eth-ethLockTxUpdateTxIndex"
)
ethLockTxUpdateTxIndex
=
[]
byte
(
"eth-ethLockTxUpdateTxIndex"
)
ethBurnTxUpdateTxIndex
=
[]
byte
(
"eth-ethBurnTxUpdateTxIndex"
)
ethBurnTxUpdateTxIndex
=
[]
byte
(
"eth-ethBurnTxUpdateTxIndex"
)
multiSignAddressPrefix
=
[]
byte
(
"eth-multiSignAddress"
)
multiSignAddressPrefix
=
[]
byte
(
"eth-multiSignAddress"
)
withdrawFeeKey
=
[]
byte
(
"eth-withdrawFee"
)
withdrawParaKey
=
[]
byte
(
"eth-withdrawPara"
)
withdrawTokenPrefix
=
[]
byte
(
"eth-withdrawTokenPrefix"
)
)
)
func
ethTokenSymbol2AddrKey
(
symbol
string
)
[]
byte
{
func
ethTokenSymbol2AddrKey
(
symbol
string
)
[]
byte
{
...
@@ -385,27 +386,74 @@ func (ethRelayer *Relayer4Ethereum) getMultiSignAddress() string {
...
@@ -385,27 +386,74 @@ func (ethRelayer *Relayer4Ethereum) getMultiSignAddress() string {
return
string
(
bytes
)
return
string
(
bytes
)
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
setWithdrawFee
(
symbol2
Fee
map
[
string
]
int64
)
error
{
func
(
ethRelayer
*
Relayer4Ethereum
)
setWithdrawFee
(
symbol2
Para
map
[
string
]
*
ebTypes
.
WithdrawPara
)
error
{
withdrawSymbol2Fee
:=
&
ebTypes
.
WithdrawSymbol2
Fee
{
withdrawSymbol2Fee
:=
&
ebTypes
.
WithdrawSymbol2
Para
{
Symbol2
Fee
:
symbol2Fee
,
Symbol2
Para
:
symbol2Para
,
}
}
bytes
:=
chain33Types
.
Encode
(
withdrawSymbol2Fee
)
bytes
:=
chain33Types
.
Encode
(
withdrawSymbol2Fee
)
return
ethRelayer
.
db
.
Set
(
withdraw
Fee
Key
,
bytes
)
return
ethRelayer
.
db
.
Set
(
withdraw
Para
Key
,
bytes
)
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
restoreWithdrawFee
()
map
[
string
]
int64
{
func
(
ethRelayer
*
Relayer4Ethereum
)
restoreWithdrawFee
()
map
[
string
]
*
ebTypes
.
WithdrawPara
{
bytes
,
_
:=
ethRelayer
.
db
.
Get
(
withdraw
Fee
Key
)
bytes
,
_
:=
ethRelayer
.
db
.
Get
(
withdraw
Para
Key
)
if
0
==
len
(
bytes
)
{
if
0
==
len
(
bytes
)
{
result
:=
make
(
map
[
string
]
int64
)
result
:=
make
(
map
[
string
]
*
ebTypes
.
WithdrawPara
)
return
result
return
result
}
}
var
withdrawSymbol2
Fee
ebTypes
.
WithdrawSymbol2Fee
var
withdrawSymbol2
Para
ebTypes
.
WithdrawSymbol2Para
if
err
:=
chain33Types
.
Decode
(
bytes
,
&
withdrawSymbol2
Fee
);
nil
!=
err
{
if
err
:=
chain33Types
.
Decode
(
bytes
,
&
withdrawSymbol2
Para
);
nil
!=
err
{
result
:=
make
(
map
[
string
]
int64
)
result
:=
make
(
map
[
string
]
*
ebTypes
.
WithdrawPara
)
return
result
return
result
}
}
return
withdrawSymbol2Fee
.
Symbol2Fee
return
withdrawSymbol2Para
.
Symbol2Para
}
func
calcWithdrawKey
(
chain33Sender
,
symbol
string
,
year
,
month
,
day
int
,
nonce
int64
)
[]
byte
{
return
[]
byte
(
fmt
.
Sprintf
(
"%s-%s-%s-%d-%d-%d-%d"
,
withdrawTokenPrefix
,
chain33Sender
,
symbol
,
year
,
month
,
day
,
nonce
))
}
func
calcWithdrawKeyPrefix
(
chain33Sender
,
symbol
string
,
year
,
month
,
day
int
)
[]
byte
{
return
[]
byte
(
fmt
.
Sprintf
(
"%s-%s-%s-%d-%d-%d"
,
withdrawTokenPrefix
,
chain33Sender
,
symbol
,
year
,
month
,
day
))
}
func
(
ethRelayer
*
Relayer4Ethereum
)
setWithdraw
(
withdrawTx
*
ebTypes
.
WithdrawTx
)
error
{
chain33Sender
:=
withdrawTx
.
Chain33Sender
symbol
:=
withdrawTx
.
Symbol
year
:=
withdrawTx
.
Year
month
:=
withdrawTx
.
Month
day
:=
withdrawTx
.
Day
key
:=
calcWithdrawKey
(
chain33Sender
,
symbol
,
int
(
year
),
int
(
month
),
int
(
day
),
withdrawTx
.
Nonce
)
bytes
:=
chain33Types
.
Encode
(
withdrawTx
)
return
ethRelayer
.
db
.
Set
(
key
,
bytes
)
}
func
(
ethRelayer
*
Relayer4Ethereum
)
getWithdrawsWithinSameDay
(
withdrawTx
*
ebTypes
.
WithdrawTx
)
(
int64
,
error
)
{
chain33Sender
:=
withdrawTx
.
Chain33Sender
symbol
:=
withdrawTx
.
Symbol
year
:=
withdrawTx
.
Year
month
:=
withdrawTx
.
Month
day
:=
withdrawTx
.
Day
prefix
:=
calcWithdrawKeyPrefix
(
chain33Sender
,
symbol
,
int
(
year
),
int
(
month
),
int
(
day
))
helper
:=
dbm
.
NewListHelper
(
ethRelayer
.
db
)
datas
:=
helper
.
List
(
prefix
,
nil
,
100
,
dbm
.
ListASC
)
if
nil
==
datas
{
return
0
,
nil
}
withdrawTotal
:=
int64
(
0
)
for
_
,
data
:=
range
datas
{
var
info
ebTypes
.
WithdrawTx
err
:=
chain33Types
.
Decode
(
data
,
&
info
)
if
nil
!=
err
{
return
0
,
err
}
withdrawTotal
+=
info
.
Amount
}
return
withdrawTotal
,
nil
}
}
plugin/dapp/cross2eth/ebrelayer/relayer/manager.go
View file @
a1c96130
...
@@ -1109,7 +1109,7 @@ func (manager *Manager) CfgWithdraw(cfgWithdrawReq *relayerTypes.CfgWithdrawReq,
...
@@ -1109,7 +1109,7 @@ func (manager *Manager) CfgWithdraw(cfgWithdrawReq *relayerTypes.CfgWithdrawReq,
if
err
:=
manager
.
checkPermission
();
nil
!=
err
{
if
err
:=
manager
.
checkPermission
();
nil
!=
err
{
return
err
return
err
}
}
err
:=
manager
.
ethRelayer
.
CfgWithdraw
(
cfgWithdrawReq
.
Symbol
,
cfgWithdrawReq
.
FeeAmount
)
err
:=
manager
.
ethRelayer
.
CfgWithdraw
(
cfgWithdrawReq
.
Symbol
,
cfgWithdrawReq
.
FeeAmount
,
cfgWithdrawReq
.
AmountPerDay
)
resultCfg
:=
true
resultCfg
:=
true
if
err
!=
nil
{
if
err
!=
nil
{
resultCfg
=
false
resultCfg
=
false
...
...
plugin/dapp/cross2eth/ebrelayer/types/relayer.pb.go
View file @
a1c96130
...
@@ -2438,6 +2438,7 @@ type CfgWithdrawReq struct {
...
@@ -2438,6 +2438,7 @@ type CfgWithdrawReq struct {
Symbol
string
`protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
Symbol
string
`protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
FeeAmount
int64
`protobuf:"varint,2,opt,name=feeAmount,proto3" json:"feeAmount,omitempty"`
FeeAmount
int64
`protobuf:"varint,2,opt,name=feeAmount,proto3" json:"feeAmount,omitempty"`
AmountPerDay
int64
`protobuf:"varint,3,opt,name=amountPerDay,proto3" json:"amountPerDay,omitempty"`
}
}
func
(
x
*
CfgWithdrawReq
)
Reset
()
{
func
(
x
*
CfgWithdrawReq
)
Reset
()
{
...
@@ -2486,16 +2487,24 @@ func (x *CfgWithdrawReq) GetFeeAmount() int64 {
...
@@ -2486,16 +2487,24 @@ func (x *CfgWithdrawReq) GetFeeAmount() int64 {
return
0
return
0
}
}
type
WithdrawSymbol2Fee
struct
{
func
(
x
*
CfgWithdrawReq
)
GetAmountPerDay
()
int64
{
if
x
!=
nil
{
return
x
.
AmountPerDay
}
return
0
}
type
WithdrawPara
struct
{
state
protoimpl
.
MessageState
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
unknownFields
protoimpl
.
UnknownFields
Symbol2Fee
map
[
string
]
int64
`protobuf:"bytes,1,rep,name=symbol2Fee,proto3" json:"symbol2Fee,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
Fee
int64
`protobuf:"varint,1,opt,name=fee,proto3" json:"fee,omitempty"`
AmountPerDay
int64
`protobuf:"varint,2,opt,name=amountPerDay,proto3" json:"amountPerDay,omitempty"`
}
}
func
(
x
*
Withdraw
Symbol2Fee
)
Reset
()
{
func
(
x
*
Withdraw
Para
)
Reset
()
{
*
x
=
Withdraw
Symbol2Fee
{}
*
x
=
Withdraw
Para
{}
if
protoimpl
.
UnsafeEnabled
{
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_relayer_proto_msgTypes
[
37
]
mi
:=
&
file_relayer_proto_msgTypes
[
37
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
...
@@ -2503,13 +2512,13 @@ func (x *WithdrawSymbol2Fee) Reset() {
...
@@ -2503,13 +2512,13 @@ func (x *WithdrawSymbol2Fee) Reset() {
}
}
}
}
func
(
x
*
Withdraw
Symbol2Fee
)
String
()
string
{
func
(
x
*
Withdraw
Para
)
String
()
string
{
return
protoimpl
.
X
.
MessageStringOf
(
x
)
return
protoimpl
.
X
.
MessageStringOf
(
x
)
}
}
func
(
*
Withdraw
Symbol2Fee
)
ProtoMessage
()
{}
func
(
*
Withdraw
Para
)
ProtoMessage
()
{}
func
(
x
*
Withdraw
Symbol2Fee
)
ProtoReflect
()
protoreflect
.
Message
{
func
(
x
*
Withdraw
Para
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_relayer_proto_msgTypes
[
37
]
mi
:=
&
file_relayer_proto_msgTypes
[
37
]
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
...
@@ -2521,18 +2530,199 @@ func (x *WithdrawSymbol2Fee) ProtoReflect() protoreflect.Message {
...
@@ -2521,18 +2530,199 @@ func (x *WithdrawSymbol2Fee) ProtoReflect() protoreflect.Message {
return
mi
.
MessageOf
(
x
)
return
mi
.
MessageOf
(
x
)
}
}
// Deprecated: Use Withdraw
Symbol2Fee
.ProtoReflect.Descriptor instead.
// Deprecated: Use Withdraw
Para
.ProtoReflect.Descriptor instead.
func
(
*
Withdraw
Symbol2Fee
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
Withdraw
Para
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_relayer_proto_rawDescGZIP
(),
[]
int
{
37
}
return
file_relayer_proto_rawDescGZIP
(),
[]
int
{
37
}
}
}
func
(
x
*
WithdrawSymbol2Fee
)
GetSymbol2Fee
()
map
[
string
]
int64
{
func
(
x
*
WithdrawPara
)
GetFee
()
int64
{
if
x
!=
nil
{
return
x
.
Fee
}
return
0
}
func
(
x
*
WithdrawPara
)
GetAmountPerDay
()
int64
{
if
x
!=
nil
{
return
x
.
AmountPerDay
}
return
0
}
type
WithdrawSymbol2Para
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
Symbol2Para
map
[
string
]
*
WithdrawPara
`protobuf:"bytes,1,rep,name=symbol2Para,proto3" json:"symbol2Para,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func
(
x
*
WithdrawSymbol2Para
)
Reset
()
{
*
x
=
WithdrawSymbol2Para
{}
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_relayer_proto_msgTypes
[
38
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
}
}
func
(
x
*
WithdrawSymbol2Para
)
String
()
string
{
return
protoimpl
.
X
.
MessageStringOf
(
x
)
}
func
(
*
WithdrawSymbol2Para
)
ProtoMessage
()
{}
func
(
x
*
WithdrawSymbol2Para
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_relayer_proto_msgTypes
[
38
]
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
if
ms
.
LoadMessageInfo
()
==
nil
{
ms
.
StoreMessageInfo
(
mi
)
}
return
ms
}
return
mi
.
MessageOf
(
x
)
}
// Deprecated: Use WithdrawSymbol2Para.ProtoReflect.Descriptor instead.
func
(
*
WithdrawSymbol2Para
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_relayer_proto_rawDescGZIP
(),
[]
int
{
38
}
}
func
(
x
*
WithdrawSymbol2Para
)
GetSymbol2Para
()
map
[
string
]
*
WithdrawPara
{
if
x
!=
nil
{
if
x
!=
nil
{
return
x
.
Symbol2
Fee
return
x
.
Symbol2
Para
}
}
return
nil
return
nil
}
}
type
WithdrawTx
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
unknownFields
protoimpl
.
UnknownFields
Chain33Sender
string
`protobuf:"bytes,1,opt,name=chain33Sender,proto3" json:"chain33Sender,omitempty"`
EthereumReceiver
string
`protobuf:"bytes,2,opt,name=ethereumReceiver,proto3" json:"ethereumReceiver,omitempty"`
Symbol
string
`protobuf:"bytes,4,opt,name=symbol,proto3" json:"symbol,omitempty"`
Amount
int64
`protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"`
Nonce
int64
`protobuf:"varint,6,opt,name=nonce,proto3" json:"nonce,omitempty"`
TxHashOnChain33
string
`protobuf:"bytes,7,opt,name=txHashOnChain33,proto3" json:"txHashOnChain33,omitempty"`
TxHashOnEthereum
string
`protobuf:"bytes,8,opt,name=txHashOnEthereum,proto3" json:"txHashOnEthereum,omitempty"`
Year
int32
`protobuf:"varint,9,opt,name=year,proto3" json:"year,omitempty"`
Month
int32
`protobuf:"varint,10,opt,name=month,proto3" json:"month,omitempty"`
Day
int32
`protobuf:"varint,11,opt,name=day,proto3" json:"day,omitempty"`
Status
string
`protobuf:"bytes,12,opt,name=status,proto3" json:"status,omitempty"`
}
func
(
x
*
WithdrawTx
)
Reset
()
{
*
x
=
WithdrawTx
{}
if
protoimpl
.
UnsafeEnabled
{
mi
:=
&
file_relayer_proto_msgTypes
[
39
]
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
ms
.
StoreMessageInfo
(
mi
)
}
}
func
(
x
*
WithdrawTx
)
String
()
string
{
return
protoimpl
.
X
.
MessageStringOf
(
x
)
}
func
(
*
WithdrawTx
)
ProtoMessage
()
{}
func
(
x
*
WithdrawTx
)
ProtoReflect
()
protoreflect
.
Message
{
mi
:=
&
file_relayer_proto_msgTypes
[
39
]
if
protoimpl
.
UnsafeEnabled
&&
x
!=
nil
{
ms
:=
protoimpl
.
X
.
MessageStateOf
(
protoimpl
.
Pointer
(
x
))
if
ms
.
LoadMessageInfo
()
==
nil
{
ms
.
StoreMessageInfo
(
mi
)
}
return
ms
}
return
mi
.
MessageOf
(
x
)
}
// Deprecated: Use WithdrawTx.ProtoReflect.Descriptor instead.
func
(
*
WithdrawTx
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_relayer_proto_rawDescGZIP
(),
[]
int
{
39
}
}
func
(
x
*
WithdrawTx
)
GetChain33Sender
()
string
{
if
x
!=
nil
{
return
x
.
Chain33Sender
}
return
""
}
func
(
x
*
WithdrawTx
)
GetEthereumReceiver
()
string
{
if
x
!=
nil
{
return
x
.
EthereumReceiver
}
return
""
}
func
(
x
*
WithdrawTx
)
GetSymbol
()
string
{
if
x
!=
nil
{
return
x
.
Symbol
}
return
""
}
func
(
x
*
WithdrawTx
)
GetAmount
()
int64
{
if
x
!=
nil
{
return
x
.
Amount
}
return
0
}
func
(
x
*
WithdrawTx
)
GetNonce
()
int64
{
if
x
!=
nil
{
return
x
.
Nonce
}
return
0
}
func
(
x
*
WithdrawTx
)
GetTxHashOnChain33
()
string
{
if
x
!=
nil
{
return
x
.
TxHashOnChain33
}
return
""
}
func
(
x
*
WithdrawTx
)
GetTxHashOnEthereum
()
string
{
if
x
!=
nil
{
return
x
.
TxHashOnEthereum
}
return
""
}
func
(
x
*
WithdrawTx
)
GetYear
()
int32
{
if
x
!=
nil
{
return
x
.
Year
}
return
0
}
func
(
x
*
WithdrawTx
)
GetMonth
()
int32
{
if
x
!=
nil
{
return
x
.
Month
}
return
0
}
func
(
x
*
WithdrawTx
)
GetDay
()
int32
{
if
x
!=
nil
{
return
x
.
Day
}
return
0
}
func
(
x
*
WithdrawTx
)
GetStatus
()
string
{
if
x
!=
nil
{
return
x
.
Status
}
return
""
}
var
File_relayer_proto
protoreflect
.
FileDescriptor
var
File_relayer_proto
protoreflect
.
FileDescriptor
var
file_relayer_proto_rawDesc
=
[]
byte
{
var
file_relayer_proto_rawDesc
=
[]
byte
{
...
@@ -2810,22 +3000,52 @@ var file_relayer_proto_rawDesc = []byte{
...
@@ -2810,22 +3000,52 @@ var file_relayer_proto_rawDesc = []byte{
0x72
,
0x22
,
0x2f
,
0x0a
,
0x15
,
0x52
,
0x65
,
0x73
,
0x65
,
0x6e
,
0x64
,
0x43
,
0x68
,
0x61
,
0x69
,
0x6e
,
0x72
,
0x22
,
0x2f
,
0x0a
,
0x15
,
0x52
,
0x65
,
0x73
,
0x65
,
0x6e
,
0x64
,
0x43
,
0x68
,
0x61
,
0x69
,
0x6e
,
0x33
,
0x33
,
0x45
,
0x76
,
0x65
,
0x6e
,
0x74
,
0x52
,
0x65
,
0x71
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x68
,
0x65
,
0x33
,
0x33
,
0x45
,
0x76
,
0x65
,
0x6e
,
0x74
,
0x52
,
0x65
,
0x71
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x68
,
0x65
,
0x69
,
0x67
,
0x68
,
0x74
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x03
,
0x52
,
0x06
,
0x68
,
0x65
,
0x69
,
0x67
,
0x69
,
0x67
,
0x68
,
0x74
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x03
,
0x52
,
0x06
,
0x68
,
0x65
,
0x69
,
0x67
,
0x68
,
0x74
,
0x22
,
0x
46
,
0x0a
,
0x0e
,
0x43
,
0x66
,
0x67
,
0x57
,
0x69
,
0x74
,
0x68
,
0x64
,
0x72
,
0x61
,
0x68
,
0x74
,
0x22
,
0x
6a
,
0x0a
,
0x0e
,
0x43
,
0x66
,
0x67
,
0x57
,
0x69
,
0x74
,
0x68
,
0x64
,
0x72
,
0x61
,
0x77
,
0x52
,
0x65
,
0x71
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x18
,
0x01
,
0x77
,
0x52
,
0x65
,
0x71
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x12
,
0x1c
,
0x0a
,
0x09
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x12
,
0x1c
,
0x0a
,
0x09
,
0x66
,
0x65
,
0x65
,
0x41
,
0x6d
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x03
,
0x52
,
0x66
,
0x65
,
0x65
,
0x41
,
0x6d
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x03
,
0x52
,
0x09
,
0x66
,
0x65
,
0x65
,
0x41
,
0x6d
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x22
,
0x9e
,
0x01
,
0x0a
,
0x12
,
0x57
,
0x09
,
0x66
,
0x65
,
0x65
,
0x41
,
0x6d
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x12
,
0x22
,
0x0a
,
0x0c
,
0x61
,
0x6d
,
0x69
,
0x74
,
0x68
,
0x64
,
0x72
,
0x61
,
0x77
,
0x53
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x46
,
0x65
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x50
,
0x65
,
0x72
,
0x44
,
0x61
,
0x79
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x03
,
0x65
,
0x12
,
0x49
,
0x0a
,
0x0a
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x46
,
0x65
,
0x65
,
0x18
,
0x52
,
0x0c
,
0x61
,
0x6d
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x50
,
0x65
,
0x72
,
0x44
,
0x61
,
0x79
,
0x22
,
0x44
,
0x01
,
0x20
,
0x03
,
0x28
,
0x0b
,
0x32
,
0x29
,
0x2e
,
0x74
,
0x79
,
0x70
,
0x65
,
0x73
,
0x2e
,
0x57
,
0x69
,
0x0a
,
0x0c
,
0x77
,
0x69
,
0x74
,
0x68
,
0x64
,
0x72
,
0x61
,
0x77
,
0x50
,
0x61
,
0x72
,
0x61
,
0x12
,
0x10
,
0x74
,
0x68
,
0x64
,
0x72
,
0x61
,
0x77
,
0x53
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x46
,
0x65
,
0x65
,
0x0a
,
0x03
,
0x66
,
0x65
,
0x65
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x03
,
0x52
,
0x03
,
0x66
,
0x65
,
0x65
,
0x2e
,
0x53
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x46
,
0x65
,
0x65
,
0x45
,
0x6e
,
0x74
,
0x72
,
0x79
,
0x12
,
0x22
,
0x0a
,
0x0c
,
0x61
,
0x6d
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x50
,
0x65
,
0x72
,
0x44
,
0x61
,
0x79
,
0x52
,
0x0a
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x46
,
0x65
,
0x65
,
0x1a
,
0x3d
,
0x0a
,
0x0f
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x03
,
0x52
,
0x0c
,
0x61
,
0x6d
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x50
,
0x65
,
0x53
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x46
,
0x65
,
0x65
,
0x45
,
0x6e
,
0x74
,
0x72
,
0x79
,
0x12
,
0x72
,
0x44
,
0x61
,
0x79
,
0x22
,
0xb9
,
0x01
,
0x0a
,
0x13
,
0x57
,
0x69
,
0x74
,
0x68
,
0x64
,
0x72
,
0x61
,
0x77
,
0x53
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x50
,
0x61
,
0x72
,
0x61
,
0x12
,
0x4d
,
0x0a
,
0x0b
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x50
,
0x61
,
0x72
,
0x61
,
0x18
,
0x01
,
0x20
,
0x03
,
0x28
,
0x0b
,
0x32
,
0x2b
,
0x2e
,
0x74
,
0x79
,
0x70
,
0x65
,
0x73
,
0x2e
,
0x57
,
0x69
,
0x74
,
0x68
,
0x64
,
0x72
,
0x61
,
0x77
,
0x53
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x50
,
0x61
,
0x72
,
0x61
,
0x2e
,
0x53
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x50
,
0x61
,
0x72
,
0x61
,
0x45
,
0x6e
,
0x74
,
0x72
,
0x79
,
0x52
,
0x0b
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x50
,
0x61
,
0x72
,
0x61
,
0x1a
,
0x53
,
0x0a
,
0x10
,
0x53
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x32
,
0x50
,
0x61
,
0x72
,
0x61
,
0x45
,
0x6e
,
0x74
,
0x72
,
0x79
,
0x12
,
0x10
,
0x0a
,
0x03
,
0x6b
,
0x65
,
0x79
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x03
,
0x6b
,
0x65
,
0x10
,
0x0a
,
0x03
,
0x6b
,
0x65
,
0x79
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x03
,
0x6b
,
0x65
,
0x79
,
0x12
,
0x14
,
0x0a
,
0x05
,
0x76
,
0x61
,
0x6c
,
0x75
,
0x65
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x03
,
0x79
,
0x12
,
0x29
,
0x0a
,
0x05
,
0x76
,
0x61
,
0x6c
,
0x75
,
0x65
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x52
,
0x05
,
0x76
,
0x61
,
0x6c
,
0x75
,
0x65
,
0x3a
,
0x02
,
0x38
,
0x01
,
0x42
,
0x0a
,
0x5a
,
0x08
,
0x2e
,
0x32
,
0x13
,
0x2e
,
0x74
,
0x79
,
0x70
,
0x65
,
0x73
,
0x2e
,
0x77
,
0x69
,
0x74
,
0x68
,
0x64
,
0x72
,
0x61
,
0x2e
,
0x2f
,
0x74
,
0x79
,
0x70
,
0x65
,
0x73
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
0x77
,
0x50
,
0x61
,
0x72
,
0x61
,
0x52
,
0x05
,
0x76
,
0x61
,
0x6c
,
0x75
,
0x65
,
0x3a
,
0x02
,
0x38
,
0x01
,
0x22
,
0xce
,
0x02
,
0x0a
,
0x0a
,
0x57
,
0x69
,
0x74
,
0x68
,
0x64
,
0x72
,
0x61
,
0x77
,
0x54
,
0x78
,
0x12
,
0x24
,
0x0a
,
0x0d
,
0x63
,
0x68
,
0x61
,
0x69
,
0x6e
,
0x33
,
0x33
,
0x53
,
0x65
,
0x6e
,
0x64
,
0x65
,
0x72
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x0d
,
0x63
,
0x68
,
0x61
,
0x69
,
0x6e
,
0x33
,
0x33
,
0x53
,
0x65
,
0x6e
,
0x64
,
0x65
,
0x72
,
0x12
,
0x2a
,
0x0a
,
0x10
,
0x65
,
0x74
,
0x68
,
0x65
,
0x72
,
0x65
,
0x75
,
0x6d
,
0x52
,
0x65
,
0x63
,
0x65
,
0x69
,
0x76
,
0x65
,
0x72
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x10
,
0x65
,
0x74
,
0x68
,
0x65
,
0x72
,
0x65
,
0x75
,
0x6d
,
0x52
,
0x65
,
0x63
,
0x65
,
0x69
,
0x76
,
0x65
,
0x72
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x18
,
0x04
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x73
,
0x79
,
0x6d
,
0x62
,
0x6f
,
0x6c
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x61
,
0x6d
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x18
,
0x05
,
0x20
,
0x01
,
0x28
,
0x03
,
0x52
,
0x06
,
0x61
,
0x6d
,
0x6f
,
0x75
,
0x6e
,
0x74
,
0x12
,
0x14
,
0x0a
,
0x05
,
0x6e
,
0x6f
,
0x6e
,
0x63
,
0x65
,
0x18
,
0x06
,
0x20
,
0x01
,
0x28
,
0x03
,
0x52
,
0x05
,
0x6e
,
0x6f
,
0x6e
,
0x63
,
0x65
,
0x12
,
0x28
,
0x0a
,
0x0f
,
0x74
,
0x78
,
0x48
,
0x61
,
0x73
,
0x68
,
0x4f
,
0x6e
,
0x43
,
0x68
,
0x61
,
0x69
,
0x6e
,
0x33
,
0x33
,
0x18
,
0x07
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x0f
,
0x74
,
0x78
,
0x48
,
0x61
,
0x73
,
0x68
,
0x4f
,
0x6e
,
0x43
,
0x68
,
0x61
,
0x69
,
0x6e
,
0x33
,
0x33
,
0x12
,
0x2a
,
0x0a
,
0x10
,
0x74
,
0x78
,
0x48
,
0x61
,
0x73
,
0x68
,
0x4f
,
0x6e
,
0x45
,
0x74
,
0x68
,
0x65
,
0x72
,
0x65
,
0x75
,
0x6d
,
0x18
,
0x08
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x10
,
0x74
,
0x78
,
0x48
,
0x61
,
0x73
,
0x68
,
0x4f
,
0x6e
,
0x45
,
0x74
,
0x68
,
0x65
,
0x72
,
0x65
,
0x75
,
0x6d
,
0x12
,
0x12
,
0x0a
,
0x04
,
0x79
,
0x65
,
0x61
,
0x72
,
0x18
,
0x09
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x04
,
0x79
,
0x65
,
0x61
,
0x72
,
0x12
,
0x14
,
0x0a
,
0x05
,
0x6d
,
0x6f
,
0x6e
,
0x74
,
0x68
,
0x18
,
0x0a
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x05
,
0x6d
,
0x6f
,
0x6e
,
0x74
,
0x68
,
0x12
,
0x10
,
0x0a
,
0x03
,
0x64
,
0x61
,
0x79
,
0x18
,
0x0b
,
0x20
,
0x01
,
0x28
,
0x05
,
0x52
,
0x03
,
0x64
,
0x61
,
0x79
,
0x12
,
0x16
,
0x0a
,
0x06
,
0x73
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x18
,
0x0c
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x06
,
0x73
,
0x74
,
0x61
,
0x74
,
0x75
,
0x73
,
0x42
,
0x0a
,
0x5a
,
0x08
,
0x2e
,
0x2e
,
0x2f
,
0x74
,
0x79
,
0x70
,
0x65
,
0x73
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
}
}
var
(
var
(
...
@@ -2840,7 +3060,7 @@ func file_relayer_proto_rawDescGZIP() []byte {
...
@@ -2840,7 +3060,7 @@ func file_relayer_proto_rawDescGZIP() []byte {
return
file_relayer_proto_rawDescData
return
file_relayer_proto_rawDescData
}
}
var
file_relayer_proto_msgTypes
=
make
([]
protoimpl
.
MessageInfo
,
39
)
var
file_relayer_proto_msgTypes
=
make
([]
protoimpl
.
MessageInfo
,
41
)
var
file_relayer_proto_goTypes
=
[]
interface
{}{
var
file_relayer_proto_goTypes
=
[]
interface
{}{
(
*
Account4Relayer
)(
nil
),
// 0: types.Account4Relayer
(
*
Account4Relayer
)(
nil
),
// 0: types.Account4Relayer
(
*
ValidatorAddr4EthRelayer
)(
nil
),
// 1: types.ValidatorAddr4EthRelayer
(
*
ValidatorAddr4EthRelayer
)(
nil
),
// 1: types.ValidatorAddr4EthRelayer
...
@@ -2879,19 +3099,22 @@ var file_relayer_proto_goTypes = []interface{}{
...
@@ -2879,19 +3099,22 @@ var file_relayer_proto_goTypes = []interface{}{
(
*
BalanceLockedReq
)(
nil
),
// 34: types.BalanceLockedReq
(
*
BalanceLockedReq
)(
nil
),
// 34: types.BalanceLockedReq
(
*
ResendChain33EventReq
)(
nil
),
// 35: types.ResendChain33EventReq
(
*
ResendChain33EventReq
)(
nil
),
// 35: types.ResendChain33EventReq
(
*
CfgWithdrawReq
)(
nil
),
// 36: types.CfgWithdrawReq
(
*
CfgWithdrawReq
)(
nil
),
// 36: types.CfgWithdrawReq
(
*
WithdrawSymbol2Fee
)(
nil
),
// 37: types.WithdrawSymbol2Fee
(
*
WithdrawPara
)(
nil
),
// 37: types.withdrawPara
nil
,
// 38: types.WithdrawSymbol2Fee.Symbol2FeeEntry
(
*
WithdrawSymbol2Para
)(
nil
),
// 38: types.WithdrawSymbol2Para
(
*
WithdrawTx
)(
nil
),
// 39: types.WithdrawTx
nil
,
// 40: types.WithdrawSymbol2Para.Symbol2ParaEntry
}
}
var
file_relayer_proto_depIdxs
=
[]
int32
{
var
file_relayer_proto_depIdxs
=
[]
int32
{
25
,
// 0: types.TokenAddressArray.tokenAddress:type_name -> types.TokenAddress
25
,
// 0: types.TokenAddressArray.tokenAddress:type_name -> types.TokenAddress
24
,
// 1: types.TokenStaticsResponse.e2Cstatics:type_name -> types.Ethereum2Chain33Statics
24
,
// 1: types.TokenStaticsResponse.e2Cstatics:type_name -> types.Ethereum2Chain33Statics
23
,
// 2: types.TokenStaticsResponse.c2Estatics:type_name -> types.Chain33ToEthereumStatics
23
,
// 2: types.TokenStaticsResponse.c2Estatics:type_name -> types.Chain33ToEthereumStatics
38
,
// 3: types.WithdrawSymbol2Fee.symbol2Fee:type_name -> types.WithdrawSymbol2Fee.Symbol2FeeEntry
40
,
// 3: types.WithdrawSymbol2Para.symbol2Para:type_name -> types.WithdrawSymbol2Para.Symbol2ParaEntry
4
,
// [4:4] is the sub-list for method output_type
37
,
// 4: types.WithdrawSymbol2Para.Symbol2ParaEntry.value:type_name -> types.withdrawPara
4
,
// [4:4] is the sub-list for method input_type
5
,
// [5:5] is the sub-list for method output_type
4
,
// [4:4] is the sub-list for extension type_name
5
,
// [5:5] is the sub-list for method input_type
4
,
// [4:4] is the sub-list for extension extendee
5
,
// [5:5] is the sub-list for extension type_name
0
,
// [0:4] is the sub-list for field type_name
5
,
// [5:5] is the sub-list for extension extendee
0
,
// [0:5] is the sub-list for field type_name
}
}
func
init
()
{
file_relayer_proto_init
()
}
func
init
()
{
file_relayer_proto_init
()
}
...
@@ -3345,7 +3568,31 @@ func file_relayer_proto_init() {
...
@@ -3345,7 +3568,31 @@ func file_relayer_proto_init() {
}
}
}
}
file_relayer_proto_msgTypes
[
37
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
file_relayer_proto_msgTypes
[
37
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
WithdrawSymbol2Fee
);
i
{
switch
v
:=
v
.
(
*
WithdrawPara
);
i
{
case
0
:
return
&
v
.
state
case
1
:
return
&
v
.
sizeCache
case
2
:
return
&
v
.
unknownFields
default
:
return
nil
}
}
file_relayer_proto_msgTypes
[
38
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
WithdrawSymbol2Para
);
i
{
case
0
:
return
&
v
.
state
case
1
:
return
&
v
.
sizeCache
case
2
:
return
&
v
.
unknownFields
default
:
return
nil
}
}
file_relayer_proto_msgTypes
[
39
]
.
Exporter
=
func
(
v
interface
{},
i
int
)
interface
{}
{
switch
v
:=
v
.
(
*
WithdrawTx
);
i
{
case
0
:
case
0
:
return
&
v
.
state
return
&
v
.
state
case
1
:
case
1
:
...
@@ -3363,7 +3610,7 @@ func file_relayer_proto_init() {
...
@@ -3363,7 +3610,7 @@ func file_relayer_proto_init() {
GoPackagePath
:
reflect
.
TypeOf
(
x
{})
.
PkgPath
(),
GoPackagePath
:
reflect
.
TypeOf
(
x
{})
.
PkgPath
(),
RawDescriptor
:
file_relayer_proto_rawDesc
,
RawDescriptor
:
file_relayer_proto_rawDesc
,
NumEnums
:
0
,
NumEnums
:
0
,
NumMessages
:
39
,
NumMessages
:
41
,
NumExtensions
:
0
,
NumExtensions
:
0
,
NumServices
:
0
,
NumServices
:
0
,
},
},
...
...
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