Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bridge-backend
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
bridge-backend
Commits
c5037ac1
Commit
c5037ac1
authored
Sep 18, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
3d0871f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
builder.go
dao/builder.go
+2
-2
dbtx.go
dao/dbtx.go
+4
-2
No files found.
dao/builder.go
View file @
c5037ac1
...
...
@@ -180,7 +180,7 @@ func (s *Dao) filterTransferIn(chain ChainInterface, txLog types.Log, ctx contex
log
.
WithField
(
"chain"
,
chain
.
Name
())
.
WithError
(
err
)
.
Error
(
"parse TransferInExecution log"
)
return
err
}
if
err
:=
s
.
UpdateBridgeResult
(
ctx
,
chain
.
GetChain
()
.
ChainId
,
event
.
InId
.
Int64
(),
TransferChainExecuted
);
err
!=
nil
{
if
err
:=
s
.
UpdateBridgeResult
(
ctx
,
chain
.
GetChain
()
.
ChainId
,
event
.
InId
.
Int64
(),
TransferChainExecuted
,
txLog
.
TxHash
);
err
!=
nil
{
log
.
WithField
(
"chain"
,
chain
.
Name
())
.
WithFields
(
log
.
Fields
{
"error"
:
err
.
Error
(),
})
.
Error
(
"db update transfer in execution event"
)
...
...
@@ -192,7 +192,7 @@ func (s *Dao) filterTransferIn(chain ChainInterface, txLog types.Log, ctx contex
log
.
WithField
(
"chain"
,
chain
.
Name
())
.
WithError
(
err
)
.
Error
(
"parse TransferInExecution log"
)
return
err
}
if
err
:=
s
.
UpdateBridgeResult
(
ctx
,
chain
.
GetChain
()
.
ChainId
,
event
.
InId
.
Int64
(),
TransferChainRejected
);
err
!=
nil
{
if
err
:=
s
.
UpdateBridgeResult
(
ctx
,
chain
.
GetChain
()
.
ChainId
,
event
.
InId
.
Int64
(),
TransferChainRejected
,
txLog
.
TxHash
);
err
!=
nil
{
log
.
WithField
(
"chain"
,
chain
.
Name
())
.
WithFields
(
log
.
Fields
{
"error"
:
err
.
Error
(),
})
.
Error
(
"db update transfer in execution event"
)
...
...
dao/dbtx.go
View file @
c5037ac1
...
...
@@ -4,6 +4,7 @@ import (
"code.wuban.net.cn/movabridge/bridge-backend/constant"
dbModel
"code.wuban.net.cn/movabridge/bridge-backend/model/db"
"context"
"github.com/ethereum/go-ethereum/common"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
...
...
@@ -114,13 +115,14 @@ func (d *Dao) FillOutTransferEventInfo(ctx context.Context, outEvent *dbModel.Br
return
err
}
func
(
d
*
Dao
)
UpdateBridgeResult
(
ctx
context
.
Context
,
toChainId
int64
,
inId
int64
,
result
constant
.
TransferStatus
)
error
{
func
(
d
*
Dao
)
UpdateBridgeResult
(
ctx
context
.
Context
,
toChainId
int64
,
inId
int64
,
result
constant
.
TransferStatus
,
txhash
common
.
Hash
)
error
{
collection
:=
d
.
db
.
Collection
(
new
(
dbModel
.
BridgeEvent
)
.
TableName
())
filter
:=
bson
.
M
{
"to_chain"
:
toChainId
,
"in_id"
:
inId
}
update
:=
bson
.
M
{
"$set"
:
bson
.
M
{
"to_chain_status"
:
int
(
result
),
"to_chain_tx_hash"
:
txhash
.
Hex
(),
"to_chain_status"
:
int
(
result
),
},
}
opts
:=
options
.
Update
()
.
SetUpsert
(
true
)
...
...
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