evm: fix format errors in String() of QueryEthLogs (#748)
* FIX: format errors in String() of QueryETHLogs * FINISH: add change log
This commit is contained in:
parent
dce0b0cffb
commit
bfa9a733e0
@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* (evm) [\#747](https://github.com/cosmos/ethermint/issues/747) Fix format errors in String() of QueryETHLogs
|
||||
* (evm) [\#687](https://github.com/cosmos/ethermint/issues/687) Fix nonce check to explicitly check for the correct nonce, rather than a simple 'greater than' comparison.
|
||||
* (api) [\#687](https://github.com/cosmos/ethermint/issues/687) Returns error for a transaction with an incorrect nonce.
|
||||
* (evm) [\#674](https://github.com/cosmos/ethermint/issues/674) Reset all cache after account data has been committed in `EndBlock` to make sure every node state consistent.
|
||||
|
@ -71,7 +71,13 @@ type QueryETHLogs struct {
|
||||
}
|
||||
|
||||
func (q QueryETHLogs) String() string {
|
||||
return fmt.Sprintf("%+v", q.Logs)
|
||||
var logsStr string
|
||||
logsLen := len(q.Logs)
|
||||
for i := 0; i < logsLen; i++ {
|
||||
logsStr = fmt.Sprintf("%s%v\n", logsStr, *q.Logs[i])
|
||||
}
|
||||
|
||||
return logsStr
|
||||
}
|
||||
|
||||
// QueryBloomFilter is response type for tx logs query
|
||||
|
26
x/evm/types/querier_test.go
Normal file
26
x/evm/types/querier_test.go
Normal file
@ -0,0 +1,26 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
ethtypes "github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestQueryETHLogs_String(t *testing.T) {
|
||||
const expectedQueryETHLogsStr = `{0x0000000000000000000000000000000000000000 [] [1 2 3 4] 9 0x0000000000000000000000000000000000000000000000000000000000000000 0 0x0000000000000000000000000000000000000000000000000000000000000000 0 false}
|
||||
{0x0000000000000000000000000000000000000000 [] [5 6 7 8] 10 0x0000000000000000000000000000000000000000000000000000000000000000 0 0x0000000000000000000000000000000000000000000000000000000000000000 0 false}
|
||||
`
|
||||
logs := []*ethtypes.Log{
|
||||
{
|
||||
Data: []byte{1, 2, 3, 4},
|
||||
BlockNumber: 9,
|
||||
},
|
||||
{
|
||||
Data: []byte{5, 6, 7, 8},
|
||||
BlockNumber: 10,
|
||||
},
|
||||
}
|
||||
|
||||
require.True(t, strings.EqualFold(expectedQueryETHLogsStr, QueryETHLogs{logs}.String()))
|
||||
}
|
Loading…
Reference in New Issue
Block a user