Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar-client-chain33
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
sidecar-client-chain33
Commits
b505b811
Commit
b505b811
authored
Apr 11, 2022
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor code
parent
c3771bb0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
evmxgo.go
evmxgo/evmxgo.go
+6
-7
paracross.go
paracross/paracross.go
+0
-0
No files found.
evmxgo/evmxgo.go
View file @
b505b811
...
...
@@ -94,7 +94,7 @@ func (e *Evmxgo) ID() string {
}
// configPath 完整路径
func
(
e
*
Evmxgo
)
Initialize
(
configPath
string
,
ID
string
,
extra
[]
byte
)
error
{
func
(
e
*
Evmxgo
)
Initialize
(
configPath
string
,
_
string
,
_
[]
byte
)
error
{
// 初始化e.client工作
e
.
eventC
=
make
(
chan
*
pb
.
IBTP
,
10
)
e
.
done
=
make
(
chan
bool
)
...
...
@@ -110,7 +110,7 @@ func (e *Evmxgo) Initialize(configPath string, ID string, extra []byte) error {
e
.
fromID
=
chain33Config
.
Router
.
FromChain
e
.
toID
=
chain33Config
.
Router
.
ToChain
e
.
fee
=
chain33Config
.
Chain33
.
Fee
//
logger.SetLevel(hclog.LevelFromString(chain33Config.Log.Level))
logger
.
SetLevel
(
hclog
.
LevelFromString
(
chain33Config
.
Log
.
Level
))
// 初始化chain33 client rpc
client
,
err
:=
rpc
.
NewClient
(
""
,
chain33Config
.
Chain33
.
Addr
)
...
...
@@ -233,7 +233,7 @@ func (e *Evmxgo) pollAppChain() chan *types.Event {
Contract
:
&
types
.
Contract
{
ChainID
:
e
.
fromID
,
ExecName
:
ID
,
Address
:
address
.
ExecAddress
(
ID
),
//
TODO
合约地址
Address
:
address
.
ExecAddress
(
ID
),
// 合约地址
CallMethod
:
evmxgotypes
.
NameMintMapAction
,
},
Payload
:
&
types
.
MapAssetInfo
{
...
...
@@ -290,7 +290,7 @@ func (e *Evmxgo) pollAppChain() chan *types.Event {
Contract
:
&
types
.
Contract
{
ChainID
:
cast
.
ToString
(
e
.
chainID
),
ExecName
:
ID
,
Address
:
address
.
ExecAddress
(
ID
),
//
TODO
合约地址
Address
:
address
.
ExecAddress
(
ID
),
// 合约地址
CallMethod
:
evmxgotypes
.
NameBurnMapAction
,
},
Payload
:
&
types
.
MapAssetInfo
{
...
...
@@ -305,9 +305,7 @@ func (e *Evmxgo) pollAppChain() chan *types.Event {
}
e
.
saveBurn
(
event
)
e
.
saveUndoneEvent
(
event
)
ch
<-
event
// 需要保存这个事件,用于确认销毁成功。
// TODO 在公链一侧,用户发起注销,余额不够,交易失败.
// e.deleteUndoneEvent(srcEvent.TxID)
ch
<-
event
break
}
}
...
...
@@ -318,6 +316,7 @@ func (e *Evmxgo) pollAppChain() chan *types.Event {
"height:"
,
item
.
Block
.
Height
,
"tx:"
,
util
.
FormatJSON
(
tx
),
)
// 指定交易更新
case
types33
.
ExecErr
:
// Error
logger
.
Error
(
"exec error "
,
...
...
paracross/paracross.go
View file @
b505b811
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