|
|
@ -248,10 +248,10 @@ PublicKey.fromX = function(odd, x) { |
|
|
|
* @param {String} [compressed] - If the public key is compressed |
|
|
|
* @returns {null|Error} An error if exists |
|
|
|
*/ |
|
|
|
PublicKey.getValidationError = function(data, compressed) { |
|
|
|
PublicKey.getValidationError = function(data) { |
|
|
|
var error; |
|
|
|
try { |
|
|
|
new PublicKey(data, compressed); |
|
|
|
new PublicKey(data); |
|
|
|
} catch (e) { |
|
|
|
error = e; |
|
|
|
} |
|
|
@ -266,8 +266,8 @@ PublicKey.getValidationError = function(data, compressed) { |
|
|
|
* @param {String} [compressed] - If the public key is compressed |
|
|
|
* @returns {Boolean} If the public key would be valid |
|
|
|
*/ |
|
|
|
PublicKey.isValid = function(data, compressed) { |
|
|
|
return !PublicKey.getValidationError(data, compressed); |
|
|
|
PublicKey.isValid = function(data) { |
|
|
|
return !PublicKey.getValidationError(data); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|