update rpc tests (#276)

* update rpc tests

* cleanup

* add log assertion to getTransacionReceipt

* fix queurier_test

* address comment
This commit is contained in:
noot
2020-05-04 18:02:26 -04:00
committed by GitHub
parent 26d4e968e0
commit ce0feb307b
10 changed files with 147 additions and 159 deletions
+4 -4
View File
@@ -28,7 +28,7 @@ type Backend interface {
PendingTransactions() ([]*Transaction, error)
// Used by log filter
GetTxLogs(txHash common.Hash) ([]*ethtypes.Log, error)
GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, error)
// TODO: Bloom methods
}
@@ -154,12 +154,12 @@ func (e *EthermintBackend) getGasLimit() (int64, error) {
return gasLimit, nil
}
// GetTxLogs returns the logs given a transaction hash.
func (e *EthermintBackend) GetTxLogs(txHash common.Hash) ([]*ethtypes.Log, error) {
// GetTransactionLogs returns the logs given a transaction hash.
func (e *EthermintBackend) GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, error) {
// do we need to use the block height somewhere?
ctx := e.cliCtx
res, _, err := ctx.QueryWithData(fmt.Sprintf("custom/%s/%s/%s", types.ModuleName, evm.QueryTxLogs, txHash.Hex()), nil)
res, _, err := ctx.QueryWithData(fmt.Sprintf("custom/%s/%s/%s", types.ModuleName, evm.QueryTransactionLogs, txHash.Hex()), nil)
if err != nil {
return nil, err
}
+3 -3
View File
@@ -241,9 +241,9 @@ func (e *PublicEthAPI) GetCode(address common.Address, blockNumber BlockNumber)
return out.Code, nil
}
// GetTxLogs returns the logs given a transaction hash.
func (e *PublicEthAPI) GetTxLogs(txHash common.Hash) ([]*ethtypes.Log, error) {
return e.backend.GetTxLogs(txHash)
// GetTransactionLogs returns the logs given a transaction hash.
func (e *PublicEthAPI) GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, error) {
return e.backend.GetTransactionLogs(txHash)
}
// Sign signs the provided data using the private key of address via Geth's signature standard.
+1 -1
View File
@@ -273,7 +273,7 @@ func (f *Filter) checkMatches(block map[string]interface{}) ([]*ethtypes.Log, er
unfiltered := []*ethtypes.Log{}
for _, tx := range transactions {
logs, err := f.backend.GetTxLogs(common.BytesToHash(tx[:]))
logs, err := f.backend.GetTransactionLogs(common.BytesToHash(tx[:]))
if err != nil {
return nil, err
}