diff --git a/.gitignore b/.gitignore index 0a2d3cb..9f25c5e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ # JetBrains IDEs .idea/* +.DS_Store \ No newline at end of file diff --git a/db/badger/core/responses.go b/db/badger/core/responses.go index 62166ff..5d4fbb7 100644 --- a/db/badger/core/responses.go +++ b/db/badger/core/responses.go @@ -59,12 +59,19 @@ func makeTransactionResponse( hash primitives.Data32, data *dbt.Transaction, ) *response.Transaction { + // It is not allowed to burn more gas than the gas limit. However, because of an error there were + // invalid gas consumption records. Below control is added to support the following fix. + // https://github.com/aurora-is-near/aurora-relayer/pull/348/files + gas := data.GasLimit.Uint64() + if gas > *utils.Constants.GasLimit() { + gas = *utils.Constants.GasLimit() + } tx := &response.Transaction{ BlockHash: blockHash, BlockNumber: primitives.HexUint(height), From: data.From, - Gas: primitives.HexUint(data.GasLimit.Uint64()), + Gas: primitives.HexUint(gas), GasPrice: data.GasPrice, Hash: hash, Input: data.Input,