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
8966343e
Commit
8966343e
authored
Sep 15, 2021
by
hezhengjun
Committed by
33cn
Sep 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify fetch of operation type
parent
0d5e2b35
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
chain33.go
plugin/dapp/cross2eth/ebrelayer/relayer/chain33/chain33.go
+1
-3
ethereum.go
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
+1
-3
events.go
plugin/dapp/cross2eth/ebrelayer/relayer/events/events.go
+3
-2
No files found.
plugin/dapp/cross2eth/ebrelayer/relayer/chain33/chain33.go
View file @
8966343e
...
@@ -370,10 +370,9 @@ func (chain33Relayer *Relayer4Chain33) relayLockBurnToChain33(claim *ebTypes.Eth
...
@@ -370,10 +370,9 @@ func (chain33Relayer *Relayer4Chain33) relayLockBurnToChain33(claim *ebTypes.Eth
}
}
var
tokenAddr
string
var
tokenAddr
string
operationType
:=
""
operationType
:=
events
.
ClaimType
(
claim
.
ClaimType
)
.
String
()
if
int32
(
events
.
ClaimTypeBurn
)
==
claim
.
ClaimType
{
if
int32
(
events
.
ClaimTypeBurn
)
==
claim
.
ClaimType
{
//burn 分支
//burn 分支
operationType
=
"Burn"
if
ebTypes
.
SYMBOL_BTY
==
claim
.
Symbol
{
if
ebTypes
.
SYMBOL_BTY
==
claim
.
Symbol
{
tokenAddr
=
ebTypes
.
BTYAddrChain33
tokenAddr
=
ebTypes
.
BTYAddrChain33
}
else
{
}
else
{
...
@@ -385,7 +384,6 @@ func (chain33Relayer *Relayer4Chain33) relayLockBurnToChain33(claim *ebTypes.Eth
...
@@ -385,7 +384,6 @@ func (chain33Relayer *Relayer4Chain33) relayLockBurnToChain33(claim *ebTypes.Eth
}
}
}
else
{
}
else
{
//lock 分支
//lock 分支
operationType
=
"Lock"
var
exist
bool
var
exist
bool
tokenAddr
,
exist
=
chain33Relayer
.
symbol2Addr
[
claim
.
Symbol
]
tokenAddr
,
exist
=
chain33Relayer
.
symbol2Addr
[
claim
.
Symbol
]
if
!
exist
{
if
!
exist
{
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
View file @
8966343e
...
@@ -473,9 +473,8 @@ func (ethRelayer *Relayer4Ethereum) handleChain33Msg(chain33Msg *events.Chain33M
...
@@ -473,9 +473,8 @@ func (ethRelayer *Relayer4Ethereum) handleChain33Msg(chain33Msg *events.Chain33M
prophecyClaim
:=
ethtxs
.
Chain33MsgToProphecyClaim
(
*
chain33Msg
)
prophecyClaim
:=
ethtxs
.
Chain33MsgToProphecyClaim
(
*
chain33Msg
)
var
tokenAddr
common
.
Address
var
tokenAddr
common
.
Address
exist
:=
false
exist
:=
false
operationType
:=
""
operationType
:=
chain33Msg
.
ClaimType
.
String
()
if
chain33Msg
.
ClaimType
==
events
.
ClaimTypeLock
{
if
chain33Msg
.
ClaimType
==
events
.
ClaimTypeLock
{
operationType
=
"lock"
tokenAddr
,
exist
=
ethRelayer
.
symbol2Addr
[
prophecyClaim
.
Symbol
]
tokenAddr
,
exist
=
ethRelayer
.
symbol2Addr
[
prophecyClaim
.
Symbol
]
if
!
exist
{
if
!
exist
{
relayerLog
.
Info
(
"handleChain33Msg"
,
"Query address from ethereum for symbol"
,
prophecyClaim
.
Symbol
)
relayerLog
.
Info
(
"handleChain33Msg"
,
"Query address from ethereum for symbol"
,
prophecyClaim
.
Symbol
)
...
@@ -497,7 +496,6 @@ func (ethRelayer *Relayer4Ethereum) handleChain33Msg(chain33Msg *events.Chain33M
...
@@ -497,7 +496,6 @@ func (ethRelayer *Relayer4Ethereum) handleChain33Msg(chain33Msg *events.Chain33M
tokenAddr
=
common
.
HexToAddress
(
addr
)
tokenAddr
=
common
.
HexToAddress
(
addr
)
}
}
}
else
{
}
else
{
operationType
=
"burn"
tokenAddr
,
exist
=
ethRelayer
.
symbol2LockAddr
[
prophecyClaim
.
Symbol
]
tokenAddr
,
exist
=
ethRelayer
.
symbol2LockAddr
[
prophecyClaim
.
Symbol
]
if
!
exist
{
if
!
exist
{
//因为是burn操作,必须从允许lock的token地址中进行查询
//因为是burn操作,必须从允许lock的token地址中进行查询
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/events/events.go
View file @
8966343e
...
@@ -10,8 +10,9 @@ type Event int
...
@@ -10,8 +10,9 @@ type Event int
var
eventsLog
=
log
.
New
(
"module"
,
"cross2eth_relayer"
)
var
eventsLog
=
log
.
New
(
"module"
,
"cross2eth_relayer"
)
const
(
const
(
ClaimTypeBurn
=
ClaimType
(
1
)
ClaimTypeUnknown
=
ClaimType
(
0
)
ClaimTypeLock
=
ClaimType
(
2
)
ClaimTypeBurn
=
ClaimType
(
1
)
ClaimTypeLock
=
ClaimType
(
2
)
)
)
const
(
const
(
...
...
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