Updated dist files.

This commit is contained in:
Richard Moore 2019-07-23 01:04:32 -03:00
parent 99c7b1ca94
commit 47663ca26b
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
27 changed files with 117 additions and 67 deletions

@ -3,6 +3,13 @@ Changelog
This change log is managed by `scripts/cmds/update-versions` but may be manually updated.
ethers/v5.0.0-beta.147 (2019-07-23 1:04)
----------------------------------------
- Use the CLI solc instead of solc directly for ABI testcase generation. ([99c7b1c](https://github.com/ethers-io/ethers.js/commit/99c7b1ca94382490b9757fd51375a7ad4259b831))
- Added experimental UTF-8 functions for escaping non-ascii strings. ([b132e32](https://github.com/ethers-io/ethers.js/commit/b132e32172c9d63e59209628dadd5796dd6291c8))
- Bump Solidity version in CLI to 0.5.10. ([6005248](https://github.com/ethers-io/ethers.js/commit/600524842e1a4b857e8428a45c0c7d1baa0624ee))
ethers/v5.0.0-beta.146 (2019-07-20 21:06)
-----------------------------------------

@ -1 +1 @@
export declare const version = "5.0.0-beta.133";
export declare const version = "5.0.0-beta.134";

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "5.0.0-beta.133";
exports.version = "5.0.0-beta.134";

@ -1,6 +1,6 @@
{
"name": "@ethersproject/cli",
"version": "5.0.0-beta.133",
"version": "5.0.0-beta.134",
"description": "Command-Line Interface scripts and releated utilities.",
"main": "index.js",
"scripts": {
@ -28,5 +28,5 @@
"publishConfig": {
"access": "public"
},
"tarballHash": "0x791abec776da3fa3fa11ef3301f527739929ab1a7ba186d24f5c75b618a091ea"
"tarballHash": "0xa43400fbcdc8b1642a96f867b45531429e4cdce0bbbbad31f68bfd43b6961e8a"
}

@ -1 +1 @@
export const version = "5.0.0-beta.133";
export const version = "5.0.0-beta.134";

@ -1 +1 @@
export declare const version = "5.0.0-beta.146";
export declare const version = "5.0.0-beta.147";

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "5.0.0-beta.146";
exports.version = "5.0.0-beta.147";

@ -14009,7 +14009,7 @@ exports.info = info;
},{}],68:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "5.0.0-beta.146";
exports.version = "5.0.0-beta.147";
},{}],69:[function(require,module,exports){
"use strict";
@ -14168,6 +14168,7 @@ exports.SigningKey = signing_key_1.SigningKey;
var strings_1 = require("@ethersproject/strings");
exports.formatBytes32String = strings_1.formatBytes32String;
exports.parseBytes32String = strings_1.parseBytes32String;
exports._toEscapedUtf8String = strings_1._toEscapedUtf8String;
exports.toUtf8Bytes = strings_1.toUtf8Bytes;
exports.toUtf8String = strings_1.toUtf8String;
var transactions_1 = require("@ethersproject/transactions");
@ -18685,7 +18686,7 @@ function toUtf8Bytes(str, form) {
exports.toUtf8Bytes = toUtf8Bytes;
;
// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499
function toUtf8String(bytes, ignoreErrors) {
function processUtf8String(bytes, processFunc, ignoreErrors) {
bytes = bytes_1.arrayify(bytes);
var result = "";
var i = 0;
@ -18694,7 +18695,7 @@ function toUtf8String(bytes, ignoreErrors) {
var c = bytes[i++];
// 0xxx xxxx
if (c >> 7 === 0) {
result += String.fromCharCode(c);
result += processFunc(c);
continue;
}
// Multibyte; how many bytes left for this character?
@ -18778,14 +18779,48 @@ function toUtf8String(bytes, ignoreErrors) {
continue;
}
if (res <= 0xffff) {
result += String.fromCharCode(res);
result += processFunc(res);
continue;
}
res -= 0x10000;
result += String.fromCharCode(((res >> 10) & 0x3ff) + 0xd800, (res & 0x3ff) + 0xdc00);
result += processFunc(((res >> 10) & 0x3ff) + 0xd800, (res & 0x3ff) + 0xdc00);
}
return result;
}
function escapeChar(value) {
var hex = ("0000" + value.toString(16));
return "\\u" + hex.substring(hex.length - 4);
}
function _toEscapedUtf8String(bytes, ignoreErrors) {
return '"' + processUtf8String(bytes, function (left, right) {
if (right == null) {
if (left < 256) {
switch (left) {
case 8: return "\\b";
case 9: return "\\t";
case 10: return "\\n";
case 13: return "\\r";
case 34: return "\\\"";
case 92: return "\\\\";
}
if (left >= 32 && left < 127) {
return String.fromCharCode(left);
}
}
return escapeChar(left);
}
return escapeChar(left) + escapeChar(right);
}, ignoreErrors) + '"';
}
exports._toEscapedUtf8String = _toEscapedUtf8String;
function toUtf8String(bytes, ignoreErrors) {
return processUtf8String(bytes, function (left, right) {
if (right == null) {
return String.fromCharCode(left);
}
return String.fromCharCode(left, right);
}, ignoreErrors);
}
exports.toUtf8String = toUtf8String;
function formatBytes32String(text) {
// Get the bytes

File diff suppressed because one or more lines are too long

@ -1,6 +1,6 @@
{
"name": "ethers",
"version": "5.0.0-beta.146",
"version": "5.0.0-beta.147",
"description": "Error utility functions for ethers.",
"main": "index.js",
"scripts": {
@ -56,5 +56,5 @@
"publishConfig": {
"tag": "next"
},
"tarballHash": "0x9360b235b2db232c03a9ffd7a5608a778a815c9c6cb62ec48733a60a6b179e15"
"tarballHash": "0xf1e4a7160dd3434770165090dccbc143a917afec0e23dd4bd581c0484b11270c"
}

@ -1 +1 @@
export const version = "5.0.0-beta.146";
export const version = "5.0.0-beta.147";

@ -12,7 +12,7 @@ import { randomBytes } from "@ethersproject/random";
import { checkProperties, deepCopy, defineReadOnly, resolveProperties, shallowCopy } from "@ethersproject/properties";
import * as RLP from "@ethersproject/rlp";
import { computePublicKey, recoverPublicKey, SigningKey } from "@ethersproject/signing-key";
import { formatBytes32String, parseBytes32String, toUtf8Bytes, toUtf8String } from "@ethersproject/strings";
import { formatBytes32String, parseBytes32String, _toEscapedUtf8String, toUtf8Bytes, toUtf8String } from "@ethersproject/strings";
import { computeAddress, parse as parseTransaction, recoverAddress, serialize as serializeTransaction } from "@ethersproject/transactions";
import { commify, formatEther, parseEther, formatUnits, parseUnits } from "@ethersproject/units";
import { verifyMessage } from "@ethersproject/wallet";
@ -23,4 +23,4 @@ import { CoerceFunc } from "@ethersproject/abi";
import { Bytes, BytesLike, Hexable } from "@ethersproject/bytes";
import { ConnectionInfo, OnceBlockable, PollOptions } from "@ethersproject/web";
import { EncryptOptions, ProgressCallback } from "@ethersproject/json-wallets";
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, toUtf8Bytes, toUtf8String, formatBytes32String, parseBytes32String, hashMessage, namehash, id, getAddress, getIcapAddress, getContractAddress, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithms, UnicodeNormalizationForm, Bytes, BytesLike, Hexable, CoerceFunc, Indexed, ConnectionInfo, OnceBlockable, PollOptions, EncryptOptions, ProgressCallback };
export { AbiCoder, defaultAbiCoder, Fragment, EventFragment, FunctionFragment, ParamType, FormatTypes, RLP, fetchJson, poll, checkProperties, deepCopy, defineReadOnly, resolveProperties, shallowCopy, arrayify, concat, stripZeros, zeroPad, defaultPath, HDNode, SigningKey, Interface, base64, hexlify, isHexString, hexStripZeros, hexValue, hexZeroPad, hexDataLength, hexDataSlice, _toEscapedUtf8String, toUtf8Bytes, toUtf8String, formatBytes32String, parseBytes32String, hashMessage, namehash, id, getAddress, getIcapAddress, getContractAddress, isAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, recoverAddress, computePublicKey, recoverPublicKey, verifyMessage, mnemonicToEntropy, entropyToMnemonic, isValidMnemonic, mnemonicToSeed, SupportedAlgorithms, UnicodeNormalizationForm, Bytes, BytesLike, Hexable, CoerceFunc, Indexed, ConnectionInfo, OnceBlockable, PollOptions, EncryptOptions, ProgressCallback };

@ -76,6 +76,7 @@ exports.SigningKey = signing_key_1.SigningKey;
var strings_1 = require("@ethersproject/strings");
exports.formatBytes32String = strings_1.formatBytes32String;
exports.parseBytes32String = strings_1.parseBytes32String;
exports._toEscapedUtf8String = strings_1._toEscapedUtf8String;
exports.toUtf8Bytes = strings_1.toUtf8Bytes;
exports.toUtf8String = strings_1.toUtf8String;
var transactions_1 = require("@ethersproject/transactions");

@ -1 +1 @@
export declare const version = "5.0.0-beta.125";
export declare const version = "5.0.0-beta.126";

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "5.0.0-beta.125";
exports.version = "5.0.0-beta.126";

@ -7,6 +7,7 @@ export declare enum UnicodeNormalizationForm {
NFKD = "NFKD"
}
export declare function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm): Uint8Array;
export declare function _toEscapedUtf8String(bytes: BytesLike, ignoreErrors?: boolean): string;
export declare function toUtf8String(bytes: BytesLike, ignoreErrors?: boolean): string;
export declare function formatBytes32String(text: string): string;
export declare function parseBytes32String(bytes: BytesLike): string;

@ -54,7 +54,7 @@ function toUtf8Bytes(str, form) {
exports.toUtf8Bytes = toUtf8Bytes;
;
// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499
function toUtf8String(bytes, ignoreErrors) {
function processUtf8String(bytes, processFunc, ignoreErrors) {
bytes = bytes_1.arrayify(bytes);
var result = "";
var i = 0;
@ -63,7 +63,7 @@ function toUtf8String(bytes, ignoreErrors) {
var c = bytes[i++];
// 0xxx xxxx
if (c >> 7 === 0) {
result += String.fromCharCode(c);
result += processFunc(c);
continue;
}
// Multibyte; how many bytes left for this character?
@ -147,14 +147,48 @@ function toUtf8String(bytes, ignoreErrors) {
continue;
}
if (res <= 0xffff) {
result += String.fromCharCode(res);
result += processFunc(res);
continue;
}
res -= 0x10000;
result += String.fromCharCode(((res >> 10) & 0x3ff) + 0xd800, (res & 0x3ff) + 0xdc00);
result += processFunc(((res >> 10) & 0x3ff) + 0xd800, (res & 0x3ff) + 0xdc00);
}
return result;
}
function escapeChar(value) {
var hex = ("0000" + value.toString(16));
return "\\u" + hex.substring(hex.length - 4);
}
function _toEscapedUtf8String(bytes, ignoreErrors) {
return '"' + processUtf8String(bytes, function (left, right) {
if (right == null) {
if (left < 256) {
switch (left) {
case 8: return "\\b";
case 9: return "\\t";
case 10: return "\\n";
case 13: return "\\r";
case 34: return "\\\"";
case 92: return "\\\\";
}
if (left >= 32 && left < 127) {
return String.fromCharCode(left);
}
}
return escapeChar(left);
}
return escapeChar(left) + escapeChar(right);
}, ignoreErrors) + '"';
}
exports._toEscapedUtf8String = _toEscapedUtf8String;
function toUtf8String(bytes, ignoreErrors) {
return processUtf8String(bytes, function (left, right) {
if (right == null) {
return String.fromCharCode(left);
}
return String.fromCharCode(left, right);
}, ignoreErrors);
}
exports.toUtf8String = toUtf8String;
function formatBytes32String(text) {
// Get the bytes

@ -1,6 +1,6 @@
{
"name": "@ethersproject/strings",
"version": "5.0.0-beta.125",
"version": "5.0.0-beta.126",
"description": "String utility functions.",
"main": "index.js",
"scripts": {
@ -22,5 +22,5 @@
"publishConfig": {
"access": "public"
},
"tarballHash": "0x9e647e336090067257da0bb65710eb42992ce8bd99fc0a8af4b29c360afdf73b"
"tarballHash": "0x4a8d8de5aa1d3e72db5a2bb3554c7efa1681257b0b3d2c0764d3edf8c221879b"
}

@ -1 +1 @@
export const version = "5.0.0-beta.125";
export const version = "5.0.0-beta.126";

@ -1 +1 @@
export declare const version = "5.0.0-beta.126";
export declare const version = "5.0.0-beta.127";

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "5.0.0-beta.126";
exports.version = "5.0.0-beta.127";

@ -1,7 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//let web3 = new Web3(new Web3.providers.HttpProvider('http://127.0.0.1:8549'));
var solc_1 = require("solc");
//import { compile as _compile } from "solc";
var solc_1 = require("@ethersproject/cli/solc");
var __1 = require("..");
var ethereumjs_util_1 = require("ethereumjs-util");
function hasPrefix(str, prefix) {
@ -54,37 +55,6 @@ var Code = /** @class */ (function () {
};
return Code;
}());
function compile(source) {
var input = {
language: "Solidity",
sources: {
"test.sol": {
content: source
}
},
settings: {
optimizer: {
enabled: true,
runs: 200
},
evmVersion: "byzantium",
outputSelection: {
"*": {
"*": ["evm.bytecode"]
}
}
}
};
var output = JSON.parse(solc_1.compile(JSON.stringify(input)));
var errors = (output.errors || []).filter(function (e) { return (e.severity == "error"); });
if (errors.length) {
errors.forEach(function (error) {
console.log(error.formattedMessage);
});
process.exit();
}
return "0x" + output.contracts["test.sol"].Test.evm.bytecode.object;
}
var chars = [];
function addChars(start, length) {
for (var i = start; i < start + length; i++) {
@ -546,7 +516,7 @@ for (var i = 0; i < 100; i++) {
var solidity = generateSolidity(params);
console.log(solidity);
console.log(i);
var bytecode = compile(solidity);
var bytecode = solc_1.compile(solidity)[0].bytecode;
//console.log(params.map(p => p.type).join(", "));
//console.log(bytecode);
var testcase = {

@ -1 +1 @@
export const version = "5.0.0-beta.126";
export const version = "5.0.0-beta.127";

@ -1,6 +1,6 @@
{
"name": "@ethersproject/tests",
"version": "5.0.0-beta.132",
"version": "5.0.0-beta.133",
"description": "Testing package for ethers.",
"main": "index.js",
"browser": {
@ -32,5 +32,5 @@
"publishConfig": {
"access": "public"
},
"tarballHash": "0x6c95c6d6f4728ecf658afa2e153234540cff5bca93c67c430c9d8cc489820a45"
"tarballHash": "0x0a8f2bdc128213d07671ec9d813d7f725d0a7146a497d49a4e03705a825d116b"
}

@ -1 +1 @@
export const version = "5.0.0-beta.132";
export const version = "5.0.0-beta.133";

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "5.0.0-beta.132";
exports.version = "5.0.0-beta.133";

@ -263,8 +263,10 @@ describe('Test UTF-8 coder', function () {
var str = randomString(seed);
var bytes = ethers_1.ethers.utils.toUtf8Bytes(str);
var str2 = ethers_1.ethers.utils.toUtf8String(bytes);
var escaped = JSON.parse(ethers_1.ethers.utils._toEscapedUtf8String(bytes));
assert_1.default.ok(Buffer.from(str).equals(Buffer.from(bytes)), 'bytes not generated correctly - ' + bytes);
assert_1.default.equal(str2, str, 'conversion not reflexive - ' + bytes);
assert_1.default.equal(escaped, str, 'conversion not reflexive - ' + bytes);
}
});
});