You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add nullable check to estimateGas validation (#849)
MM seems to send a null data param in the transaction object.
We should not be validating in that case.
- Expand trace logs to `eth.estimateGas()` to highlight param
- Add nullable concept to validation object params and set data in transaction object to nullable
- Expand `predefined.INVALID_PARAMETER` logs to make failures easier to troubleshoot
- Updated and expanded tests to confirm `isValidAndNonNullableParam` logic
- Updated RPC tests impacted by addition of value to the log
Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: Nana Essilfie-Conduah <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>
Co-authored-by: georgi-l95 <[email protected]>
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(1,'Expected 0x prefixed string representing the hash (32 bytes) in object, 0x prefixed hexadecimal block number, or the string "latest", "earliest" or "pending'));
1457
+
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(1,'Expected 0x prefixed string representing the hash (32 bytes) in object, 0x prefixed hexadecimal block number, or the string "latest", "earliest" or "pending, value: newest'));
1458
1458
}
1459
1459
});
1460
1460
@@ -1469,7 +1469,7 @@ describe('@api RPC Server Acceptance Tests', function () {
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(1,'Expected 0x prefixed string representing the hash (32 bytes) in object, 0x prefixed hexadecimal block number, or the string "latest", "earliest" or "pending'));
1472
+
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(1,'Expected 0x prefixed string representing the hash (32 bytes) in object, 0x prefixed hexadecimal block number, or the string "latest", "earliest" or "pending, value: 123'));
1473
1473
}
1474
1474
});
1475
1475
@@ -1485,7 +1485,7 @@ describe('@api RPC Server Acceptance Tests', function () {
1485
1485
Assertions.expectedError();
1486
1486
}catch(error){
1487
1487
1488
-
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(`'blockHash' for BlockHashObject`,'Expected 0x prefixed string representing the hash (32 bytes) of a block'));
1488
+
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(`'blockHash' for BlockHashObject`,'Expected 0x prefixed string representing the hash (32 bytes) of a block, value: 0x123'));
1489
1489
}
1490
1490
});
1491
1491
@@ -1500,7 +1500,7 @@ describe('@api RPC Server Acceptance Tests', function () {
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(`'blockNumber' for BlockNumberObject`,'Expected 0x prefixed hexadecimal block number, or the string "latest", "earliest" or "pending"'));
1503
+
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(`'blockNumber' for BlockNumberObject`,'Expected 0x prefixed hexadecimal block number, or the string "latest", "earliest" or "pending", value: 123'));
0 commit comments