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) (#852)
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: 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'));
649
+
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'));
651
650
}
652
651
});
653
652
@@ -662,7 +661,7 @@ describe('@api-batch-2 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'));
664
+
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'));
666
665
}
667
666
});
668
667
@@ -678,7 +677,7 @@ describe('@api-batch-2 RPC Server Acceptance Tests', function () {
678
677
Assertions.expectedError();
679
678
}catch(error){
680
679
681
-
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(`'blockHash' for BlockHashObject`,'Expected 0x prefixed string representing the hash (32 bytes) of a block'));
680
+
Assertions.jsonRpcError(error,predefined.INVALID_PARAMETER(`'blockHash' for BlockHashObject`,'Expected 0x prefixed string representing the hash (32 bytes) of a block, value: 0x123'));
682
681
}
683
682
});
684
683
@@ -693,7 +692,7 @@ describe('@api-batch-2 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"'));
695
+
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