forked from cerc-io/laconicd-deprecated
update rpc tests (#276)
* update rpc tests * cleanup * add log assertion to getTransacionReceipt * fix queurier_test * address comment
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ const (
|
||||
QueryCode = types.QueryCode
|
||||
QueryNonce = types.QueryNonce
|
||||
QueryHashToHeight = types.QueryHashToHeight
|
||||
QueryTxLogs = types.QueryTxLogs
|
||||
QueryTransactionLogs = types.QueryTransactionLogs
|
||||
QueryLogsBloom = types.QueryLogsBloom
|
||||
QueryLogs = types.QueryLogs
|
||||
QueryAccount = types.QueryAccount
|
||||
|
||||
+1
-1
@@ -120,7 +120,6 @@ func handleMsgEthermint(ctx sdk.Context, k Keeper, msg types.MsgEthermint) (*sdk
|
||||
ethHash := common.BytesToHash(txHash)
|
||||
|
||||
st := types.StateTransition{
|
||||
Sender: common.BytesToAddress(msg.From.Bytes()),
|
||||
AccountNonce: msg.AccountNonce,
|
||||
Price: msg.Price.BigInt(),
|
||||
GasLimit: msg.GasLimit,
|
||||
@@ -129,6 +128,7 @@ func handleMsgEthermint(ctx sdk.Context, k Keeper, msg types.MsgEthermint) (*sdk
|
||||
Csdb: k.CommitStateDB.WithContext(ctx),
|
||||
ChainID: intChainID,
|
||||
TxHash: ðHash,
|
||||
Sender: common.BytesToAddress(msg.From.Bytes()),
|
||||
Simulate: ctx.IsCheckTx(),
|
||||
}
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ func (suite *EvmTestSuite) TestQueryTxLogs() {
|
||||
suite.Require().Equal(logs, resultData.Logs)
|
||||
|
||||
// query tx logs
|
||||
path := []string{"txLogs", fmt.Sprintf("0x%x", hash)}
|
||||
path := []string{"transactionLogs", fmt.Sprintf("0x%x", hash)}
|
||||
res, err := suite.querier(suite.ctx, path, abci.RequestQuery{})
|
||||
suite.Require().NoError(err, "failed to query txLogs")
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ func NewQuerier(keeper Keeper) sdk.Querier {
|
||||
return queryNonce(ctx, path, keeper)
|
||||
case types.QueryHashToHeight:
|
||||
return queryHashToHeight(ctx, path, keeper)
|
||||
case types.QueryTxLogs:
|
||||
return queryTxLogs(ctx, path, keeper)
|
||||
case types.QueryTransactionLogs:
|
||||
return queryTransactionLogs(ctx, path, keeper)
|
||||
case types.QueryLogsBloom:
|
||||
return queryBlockLogsBloom(ctx, path, keeper)
|
||||
case types.QueryLogs:
|
||||
@@ -161,8 +161,9 @@ func queryBlockLogsBloom(ctx sdk.Context, path []string, keeper Keeper) ([]byte,
|
||||
return bz, nil
|
||||
}
|
||||
|
||||
func queryTxLogs(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) {
|
||||
func queryTransactionLogs(ctx sdk.Context, path []string, keeper Keeper) ([]byte, error) {
|
||||
txHash := ethcmn.HexToHash(path[1])
|
||||
|
||||
logs, err := keeper.GetLogs(ctx, txHash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -26,7 +26,7 @@ func (suite *KeeperTestSuite) TestQuerier() {
|
||||
{"code", []string{types.QueryCode, "0x0"}, func() {}, true},
|
||||
{"nonce", []string{types.QueryNonce, "0x0"}, func() {}, true},
|
||||
// {"hash to height", []string{types.QueryHashToHeight, "0x0"}, func() {}, true},
|
||||
{"tx logs", []string{types.QueryTxLogs, "0x0"}, func() {}, true},
|
||||
{"tx logs", []string{types.QueryTransactionLogs, "0x0"}, func() {}, true},
|
||||
// {"logs bloom", []string{types.QueryLogsBloom, "0x0"}, func() {}, true},
|
||||
{"logs", []string{types.QueryLogs, "0x0"}, func() {}, true},
|
||||
{"account", []string{types.QueryAccount, "0x0"}, func() {}, true},
|
||||
|
||||
@@ -15,7 +15,7 @@ const (
|
||||
QueryCode = "code"
|
||||
QueryNonce = "nonce"
|
||||
QueryHashToHeight = "hashToHeight"
|
||||
QueryTxLogs = "txLogs"
|
||||
QueryTransactionLogs = "transactionLogs"
|
||||
QueryLogsBloom = "logsBloom"
|
||||
QueryLogs = "logs"
|
||||
QueryAccount = "account"
|
||||
|
||||
Reference in New Issue
Block a user