Update cloud.js

This commit is contained in:
tripathyr 2023-10-15 13:01:09 +05:30 committed by GitHub
parent d445a389fc
commit c5f4e61678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,11 @@ function proxyID(address) {
bytes = ripemd160(Crypto.SHA256(Crypto.util.hexToBytes(address), { bytes = ripemd160(Crypto.SHA256(Crypto.util.hexToBytes(address), {
asBytes: true asBytes: true
})); }));
} else if ((address.length == 42 && address.startsWith("0x")) || (address.length == 40 && !address.startsWith("0x"))){ //Ethereum Address
if (address.startsWith("0x")) { address = address.substring(2);}
bytes = Crypto.util.hexToBytes(address), { asBytes: true };
} }
if (!bytes) if (!bytes)
throw "Invalid address: " + address; throw "Invalid address: " + address;
else { else {
@ -157,4 +161,4 @@ Object.defineProperties(cloud, {
order: { order: {
get: () => kBucket.order get: () => kBucket.order
} }
}); });