Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
token-bridge
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
movabridge
token-bridge
Commits
3baa11b2
Commit
3baa11b2
authored
Nov 19, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set event validator_status to failure if tx failed.
parent
f68a1f7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
db.go
dao/db.go
+2
-1
eth.go
dao/eth.go
+6
-2
No files found.
dao/db.go
View file @
3baa11b2
package
dao
import
(
"code.wuban.net.cn/movabridge/token-bridge/constant"
dbModel
"code.wuban.net.cn/movabridge/token-bridge/model/db"
"gorm.io/gorm"
"gorm.io/gorm/clause"
...
...
@@ -28,7 +29,7 @@ func (d *Dao) SetStorageHeight(key string, intValue int64) (err error) {
func
(
d
*
Dao
)
GetUnprocessedBridgeEvents
(
limit
int
,
offset
int
)
(
events
[]
*
dbModel
.
BridgeEvent
,
err
error
)
{
err
=
d
.
db
.
Model
(
&
dbModel
.
BridgeEvent
{})
.
Where
(
"`from_chain_tx_hash` != '' AND `to_chain_status` < ? AND `validator_status` = ?"
,
2
,
0
)
.
Where
(
"`from_chain_tx_hash` != '' AND `to_chain_status` < ? AND `validator_status` = ?"
,
2
,
constant
.
ValidatorStatusNoPrecess
)
.
Order
(
"created_at ASC"
)
.
Limit
(
limit
)
.
Offset
(
offset
)
.
...
...
dao/eth.go
View file @
3baa11b2
...
...
@@ -192,8 +192,12 @@ func (d *Dao) SubmitInTransfer(event *dbModel.BridgeEvent) error {
return
err
}
if
receipt
.
Status
!=
types
.
ReceiptStatusSuccessful
{
log
.
WithField
(
"chainId"
,
chain
.
conf
.
ChainId
)
.
WithField
(
"tx"
,
tx
.
Hash
()
.
Hex
())
.
Error
(
"tx failed"
)
return
errors
.
New
(
"tx failed"
)
log
.
WithFields
(
log
.
Fields
{
"chainId"
:
chain
.
conf
.
ChainId
,
"tx"
:
tx
.
Hash
()
.
Hex
(),
})
.
Error
(
"submit in transfer receipt failed"
)
//log.WithField("chainId", chain.conf.ChainId).WithField("tx", tx.Hash().Hex()).Error("tx failed")
return
d
.
UpdateBridgeValidatorOperation
(
event
,
constant
.
ValidatorStatusFailure
)
}
// update validator status.
log
.
WithFields
(
log
.
Fields
{
...
...
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