Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01b5badbb6 | ||
|
|
7357dd24ea | ||
|
|
d3592efc1d | ||
|
|
9f21b6bea8 |
@@ -4,7 +4,7 @@ Changelog
|
||||
This change log is managed by `admin/cmds/update-versions` but may be manually updated.
|
||||
|
||||
|
||||
ethers/v5.7.0 (2022-08-18 14:43)
|
||||
ethers/v5.7.0 (2022-08-18 16:17)
|
||||
--------------------------------
|
||||
|
||||
- Update PocketProvider to newer URL format. ([#2980](https://github.com/ethers-io/ethers.js/issues/2980); [10d07ca](https://github.com/ethers-io/ethers.js/commit/10d07ca6ec0622fb5a58b7e61b089166ebe8ea15))
|
||||
|
||||
@@ -1115,7 +1115,8 @@ describe("Test API Key Formatting", function () {
|
||||
assert.equal(apiKeyObject2.applicationId, applicationId);
|
||||
assert.equal(apiKeyObject2.applicationSecretKey, applicationSecretKey);
|
||||
// Test complex API key with loadBalancer
|
||||
[true, false].forEach((loadBalancer) => {
|
||||
{
|
||||
const loadBalancer = true;
|
||||
const apiKeyObject = ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId, loadBalancer
|
||||
});
|
||||
@@ -1128,27 +1129,7 @@ describe("Test API Key Formatting", function () {
|
||||
assert.equal(apiKeyObject2.applicationId, applicationId);
|
||||
assert.equal(apiKeyObject2.applicationSecretKey, applicationSecretKey);
|
||||
assert.equal(apiKeyObject2.loadBalancer, loadBalancer);
|
||||
});
|
||||
// Fails on invalid applicationId type
|
||||
assert.throws(() => {
|
||||
const apiKey = ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId: 1234,
|
||||
applicationSecretKey: applicationSecretKey
|
||||
});
|
||||
console.log(apiKey);
|
||||
}, (error) => {
|
||||
return (error.argument === "applicationId" && error.reason === "applicationSecretKey requires an applicationId");
|
||||
});
|
||||
// Fails on invalid projectSecret type
|
||||
assert.throws(() => {
|
||||
const apiKey = ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId: applicationId,
|
||||
applicationSecretKey: 1234
|
||||
});
|
||||
console.log(apiKey);
|
||||
}, (error) => {
|
||||
return (error.argument === "applicationSecretKey" && error.reason === "invalid applicationSecretKey");
|
||||
});
|
||||
}
|
||||
{
|
||||
const provider = new ethers.providers.PocketProvider("homestead", {
|
||||
applicationId: applicationId,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -238,7 +238,7 @@ describe('Test Namehash', function () {
|
||||
const namehash = ethers.utils.namehash(name);
|
||||
console.log(name, namehash);
|
||||
}, (error) => {
|
||||
return !!error.message.match(/invalid ENS address/);
|
||||
return !!error.message.match(/invalid ENS name; empty component/);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1321,43 +1321,24 @@ describe("Test API Key Formatting", function () {
|
||||
assert_1.default.equal(apiKeyObject2.applicationId, applicationId);
|
||||
assert_1.default.equal(apiKeyObject2.applicationSecretKey, applicationSecretKey);
|
||||
// Test complex API key with loadBalancer
|
||||
[true, false].forEach(function (loadBalancer) {
|
||||
var apiKeyObject = ethers_1.ethers.providers.PocketProvider.getApiKey({
|
||||
{
|
||||
var loadBalancer = true;
|
||||
var apiKeyObject_1 = ethers_1.ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId: applicationId,
|
||||
loadBalancer: loadBalancer
|
||||
});
|
||||
assert_1.default.equal(apiKeyObject.applicationId, applicationId);
|
||||
assert_1.default.equal(apiKeyObject.loadBalancer, loadBalancer);
|
||||
assert_1.default.ok(apiKeyObject.applicationSecretKey == null);
|
||||
var apiKeyObject2 = ethers_1.ethers.providers.PocketProvider.getApiKey({
|
||||
assert_1.default.equal(apiKeyObject_1.applicationId, applicationId);
|
||||
assert_1.default.equal(apiKeyObject_1.loadBalancer, loadBalancer);
|
||||
assert_1.default.ok(apiKeyObject_1.applicationSecretKey == null);
|
||||
var apiKeyObject2_1 = ethers_1.ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId: applicationId,
|
||||
applicationSecretKey: applicationSecretKey,
|
||||
loadBalancer: loadBalancer
|
||||
});
|
||||
assert_1.default.equal(apiKeyObject2.applicationId, applicationId);
|
||||
assert_1.default.equal(apiKeyObject2.applicationSecretKey, applicationSecretKey);
|
||||
assert_1.default.equal(apiKeyObject2.loadBalancer, loadBalancer);
|
||||
});
|
||||
// Fails on invalid applicationId type
|
||||
assert_1.default.throws(function () {
|
||||
var apiKey = ethers_1.ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId: 1234,
|
||||
applicationSecretKey: applicationSecretKey
|
||||
});
|
||||
console.log(apiKey);
|
||||
}, function (error) {
|
||||
return (error.argument === "applicationId" && error.reason === "applicationSecretKey requires an applicationId");
|
||||
});
|
||||
// Fails on invalid projectSecret type
|
||||
assert_1.default.throws(function () {
|
||||
var apiKey = ethers_1.ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId: applicationId,
|
||||
applicationSecretKey: 1234
|
||||
});
|
||||
console.log(apiKey);
|
||||
}, function (error) {
|
||||
return (error.argument === "applicationSecretKey" && error.reason === "invalid applicationSecretKey");
|
||||
});
|
||||
assert_1.default.equal(apiKeyObject2_1.applicationId, applicationId);
|
||||
assert_1.default.equal(apiKeyObject2_1.applicationSecretKey, applicationSecretKey);
|
||||
assert_1.default.equal(apiKeyObject2_1.loadBalancer, loadBalancer);
|
||||
}
|
||||
{
|
||||
var provider = new ethers_1.ethers.providers.PocketProvider("homestead", {
|
||||
applicationId: applicationId,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -288,7 +288,7 @@ describe('Test Namehash', function () {
|
||||
var namehash = ethers_1.ethers.utils.namehash(name);
|
||||
console.log(name, namehash);
|
||||
}, function (error) {
|
||||
return !!error.message.match(/invalid ENS address/);
|
||||
return !!error.message.match(/invalid ENS name; empty component/);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -37,7 +37,7 @@
|
||||
"scripts": {
|
||||
"test": "exit 1"
|
||||
},
|
||||
"tarballHash": "0x4baa4237143d76d0d5f14fa977b721a1ec52b92ea005a226046b41bf2c753f3b",
|
||||
"tarballHash": "0x9bc2727013dcbb208fe41974a897e0269ef56fbe2996c450f5db75972a80b4c8",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.7.0"
|
||||
}
|
||||
|
||||
@@ -1238,7 +1238,9 @@ describe("Test API Key Formatting", function() {
|
||||
assert.equal(apiKeyObject2.applicationSecretKey, applicationSecretKey);
|
||||
|
||||
// Test complex API key with loadBalancer
|
||||
[ true, false ].forEach((loadBalancer) => {
|
||||
{
|
||||
const loadBalancer = true;
|
||||
|
||||
const apiKeyObject = ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId, loadBalancer
|
||||
});
|
||||
@@ -1252,29 +1254,7 @@ describe("Test API Key Formatting", function() {
|
||||
assert.equal(apiKeyObject2.applicationId, applicationId);
|
||||
assert.equal(apiKeyObject2.applicationSecretKey, applicationSecretKey);
|
||||
assert.equal(apiKeyObject2.loadBalancer, loadBalancer);
|
||||
});
|
||||
|
||||
// Fails on invalid applicationId type
|
||||
assert.throws(() => {
|
||||
const apiKey = ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId: 1234,
|
||||
applicationSecretKey: applicationSecretKey
|
||||
});
|
||||
console.log(apiKey);
|
||||
}, (error: any) => {
|
||||
return (error.argument === "applicationId" && error.reason === "applicationSecretKey requires an applicationId");
|
||||
});
|
||||
|
||||
// Fails on invalid projectSecret type
|
||||
assert.throws(() => {
|
||||
const apiKey = ethers.providers.PocketProvider.getApiKey({
|
||||
applicationId: applicationId,
|
||||
applicationSecretKey: 1234
|
||||
});
|
||||
console.log(apiKey);
|
||||
}, (error: any) => {
|
||||
return (error.argument === "applicationSecretKey" && error.reason === "invalid applicationSecretKey");
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const provider = new ethers.providers.PocketProvider("homestead", {
|
||||
|
||||
@@ -294,7 +294,7 @@ describe('Test Namehash', function() {
|
||||
const namehash = ethers.utils.namehash(name);
|
||||
console.log(name, namehash);
|
||||
}, (error: Error) => {
|
||||
return !!error.message.match(/invalid ENS address/);
|
||||
return !!error.message.match(/invalid ENS name; empty component/);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user