Skip to content

Commit

Permalink
Merge branch 'b/testnet' into b/master
Browse files Browse the repository at this point in the history
  • Loading branch information
romever committed Jul 16, 2024
2 parents 64decba + 2e51f56 commit 8dcb9ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion api/internal/logic/runtime/runtimetransactioninfologic.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,19 @@ func (l *RuntimeTransactionInfoLogic) RuntimeTransactionInfo(req *types.RuntimeT
return nil, errort.NewDefaultError()
}

if txModel == nil {
return nil, nil
}

runtimeName := ""
runtimeModel, err := l.svcCtx.RuntimeModel.FindOneByRuntimeId(l.ctx, runtimeId)
if err != nil && !errors.Is(err, sqlx.ErrNotFound) {
logc.Errorf(l.ctx, "find runtime info error, %v", err)
return nil, errort.NewDefaultError()
}
if runtimeModel != nil {
runtimeName = runtimeModel.Name
}

var consensusTx *types.RuntimeTransactionConsensusTx = nil
var evmTx *types.RuntimeTransactionEvmTx = nil
Expand All @@ -71,6 +79,7 @@ func (l *RuntimeTransactionInfoLogic) RuntimeTransactionInfo(req *types.RuntimeT
return nil, errort.NewDefaultError()
}
evmTx = &types.RuntimeTransactionEvmTx{
Hash: txModel.EvmHash,
From: txModel.EvmFrom,
To: txModel.EvmTo,
Nonce: int64(txData.Nonce()),
Expand Down Expand Up @@ -150,7 +159,7 @@ func (l *RuntimeTransactionInfoLogic) RuntimeTransactionInfo(req *types.RuntimeT

resp = &types.RuntimeTransactionInfoResponse{
RuntimeId: runtimeId,
RuntimeName: runtimeModel.Name,
RuntimeName: runtimeName,
TxHash: txModel.TxHash,
Round: txModel.Round,
Result: txModel.Result,
Expand Down
1 change: 1 addition & 0 deletions api/internal/types/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/oasisscan.api
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ type (
Nonce int64 `json:"nonce"`
}
RuntimeTransactionEvmTx {
Hash string `json:"hash"`
From string `json:"from"`
To string `json:"to"`
Nonce int64 `json:"nonce"`
Expand Down

0 comments on commit 8dcb9ac

Please sign in to comment.