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
fe155cbb
Commit
fe155cbb
authored
Aug 10, 2022
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug for execname
parent
b6c52534
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
paracross.go
paracross/paracross.go
+19
-9
No files found.
paracross/paracross.go
View file @
fe155cbb
...
@@ -334,7 +334,7 @@ func (p *Paracross) processBlock(height, end int64) {
...
@@ -334,7 +334,7 @@ func (p *Paracross) processBlock(height, end int64) {
if
err
!=
nil
{
if
err
!=
nil
{
p
.
logger
.
Error
(
"types33.Decode(unlock.Note, srcEvent) error:"
,
"error"
,
err
)
p
.
logger
.
Error
(
"types33.Decode(unlock.Note, srcEvent) error:"
,
"error"
,
err
)
}
}
p
.
updateBurnUnlock
(
srcEvent
,
p
.
unLockEvent
(
unlock
,
tx
,
height1
))
p
.
updateBurnUnlock
(
srcEvent
,
p
.
unLockEvent
(
unlock
.
Amount
,
unlock
.
To
,
unlock
.
Cointoken
,
"AssetWithdraw"
,
unlock
.
Note
,
tx
,
height1
))
p
.
logger
.
Info
(
"unlock <=> unLockEvent succeed!"
,
"tx"
,
util
.
FormatJSON
(
string
(
t
)))
p
.
logger
.
Info
(
"unlock <=> unLockEvent succeed!"
,
"tx"
,
util
.
FormatJSON
(
string
(
t
)))
},
},
paracorssTypes
.
ParacrossActionAssetTransfer
:
func
()
{
paracorssTypes
.
ParacrossActionAssetTransfer
:
func
()
{
...
@@ -358,7 +358,17 @@ func (p *Paracross) processBlock(height, end int64) {
...
@@ -358,7 +358,17 @@ func (p *Paracross) processBlock(height, end int64) {
if
bytes
.
Equal
(
p
.
privateKey
.
PubKey
()
.
Bytes
(),
tx
.
Signature
.
Pubkey
)
{
if
bytes
.
Equal
(
p
.
privateKey
.
PubKey
()
.
Bytes
(),
tx
.
Signature
.
Pubkey
)
{
unDoneTx
=
append
(
unDoneTx
,
tx
.
Hash
())
unDoneTx
=
append
(
unDoneTx
,
tx
.
Hash
())
hashData
=
append
(
hashData
,
tx
.
Hash
()
...
)
hashData
=
append
(
hashData
,
tx
.
Hash
()
...
)
p
.
saveUnLock
(
p
.
unLockEvent
(
action
.
GetAssetWithdraw
(),
tx
,
height1
))
unlock
:=
action
.
GetAssetWithdraw
()
p
.
saveUnLock
(
p
.
unLockEvent
(
unlock
.
Amount
,
unlock
.
To
,
unlock
.
Cointoken
,
"AssetWithdraw"
,
unlock
.
Note
,
tx
,
height1
))
}
},
paracorssTypes
.
ParacrossActionCrossAssetTransfer
:
func
()
{
// pack的交易,在只后的高度,受一定的条件触发,会再次执行,并且包含在当前高度之中的,以及执行的recipt。可以这样的获取。
if
bytes
.
Equal
(
p
.
privateKey
.
PubKey
()
.
Bytes
(),
tx
.
Signature
.
Pubkey
)
{
unDoneTx
=
append
(
unDoneTx
,
tx
.
Hash
())
hashData
=
append
(
hashData
,
tx
.
Hash
()
...
)
unlock
:=
action
.
GetCrossAssetTransfer
()
p
.
saveUnLock
(
p
.
unLockEvent
(
unlock
.
Amount
,
unlock
.
ToAddr
,
unlock
.
AssetSymbol
,
"CrossAssetTransfer"
,
[]
byte
(
unlock
.
Note
),
tx
,
height1
))
}
}
},
},
paracorssTypes
.
ParacrossActionCommit
:
func
()
{
paracorssTypes
.
ParacrossActionCommit
:
func
()
{
...
@@ -507,7 +517,7 @@ func (p *Paracross) lockCrossEvent(lock *paracorssTypes.CrossAssetTransfer, tx *
...
@@ -507,7 +517,7 @@ func (p *Paracross) lockCrossEvent(lock *paracorssTypes.CrossAssetTransfer, tx *
return
event
return
event
}
}
func
(
p
*
Paracross
)
unLockEvent
(
unlock
*
types33
.
AssetsWithdraw
,
tx
*
types33
.
Transaction
,
height
int64
)
*
types
.
Event
{
func
(
p
*
Paracross
)
unLockEvent
(
amount
int64
,
to
,
token
,
method
string
,
note
[]
byte
,
tx
*
types33
.
Transaction
,
height
int64
)
*
types
.
Event
{
event
:=
&
types
.
Event
{
event
:=
&
types
.
Event
{
TxID
:
util
.
ToHex
(
tx
.
Hash
()),
TxID
:
util
.
ToHex
(
tx
.
Hash
()),
BlockNumber
:
uint64
(
height
),
BlockNumber
:
uint64
(
height
),
...
@@ -515,14 +525,14 @@ func (p *Paracross) unLockEvent(unlock *types33.AssetsWithdraw, tx *types33.Tran
...
@@ -515,14 +525,14 @@ func (p *Paracross) unLockEvent(unlock *types33.AssetsWithdraw, tx *types33.Tran
ChainID
:
cast
.
ToString
(
p
.
chainID
),
ChainID
:
cast
.
ToString
(
p
.
chainID
),
ExecName
:
execer
,
ExecName
:
execer
,
Address
:
p
.
execAddress
,
// 合约地址
Address
:
p
.
execAddress
,
// 合约地址
CallMethod
:
"AssetsWithdraw"
,
CallMethod
:
method
,
},
},
Payload
:
&
types
.
MapAssetInfo
{
Payload
:
&
types
.
MapAssetInfo
{
EventType
:
types
.
EventType_UnLock
,
EventType
:
types
.
EventType_UnLock
,
UnlockAddress
:
unlock
.
T
o
,
// 用户地址
UnlockAddress
:
t
o
,
// 用户地址
UnlockAmount
:
unlock
.
A
mount
,
UnlockAmount
:
a
mount
,
Symbol
:
types
.
Symbol
(
unlock
.
Coin
token
),
Symbol
:
types
.
Symbol
(
token
),
Extra
:
unlock
.
N
ote
,
Extra
:
n
ote
,
Height
:
height
,
Height
:
height
,
Nonce
:
tx
.
Nonce
,
Nonce
:
tx
.
Nonce
,
},
},
...
@@ -786,7 +796,7 @@ func (p *Paracross) CreateRawAssetTransferTxExt(param *types33.CreateTx) (*types
...
@@ -786,7 +796,7 @@ func (p *Paracross) CreateRawAssetTransferTxExt(param *types33.CreateTx) (*types
AssetSymbol
:
param
.
TokenSymbol
,
AssetSymbol
:
param
.
TokenSymbol
,
Amount
:
param
.
Amount
,
Amount
:
param
.
Amount
,
ToAddr
:
param
.
GetTo
(),
ToAddr
:
param
.
GetTo
(),
//Note: string(param.GetNote()),
//
Note: string(param.GetNote()),
}}
}}
transfer
.
Value
=
v
transfer
.
Value
=
v
transfer
.
Ty
=
paracorssTypes
.
ParacrossActionCrossAssetTransfer
transfer
.
Ty
=
paracorssTypes
.
ParacrossActionCrossAssetTransfer
...
...
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