Longer Etherscan throttle slot interval.

This commit is contained in:
Richard Moore 2020-07-16 05:29:33 -04:00
parent 63dd3d4682
commit 9f20258d5d
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
2 changed files with 13 additions and 11 deletions

@ -142,6 +142,7 @@ export class EtherscanProvider extends BaseProvider{
const connection = {
url: url,
throttleSlotInterval: 1000,
throttleCallback: (attempt: number, url: string) => {
if (this.apiKey === defaultApiKey) {
showThrottleMessage();
@ -351,6 +352,7 @@ export class EtherscanProvider extends BaseProvider{
const connection = {
url: url,
throttleSlotInterval: 1000,
throttleCallback: (attempt: number, url: string) => {
if (this.apiKey === defaultApiKey) {
showThrottleMessage();

@ -446,7 +446,7 @@ function testProvider(providerName: string, networkName: string) {
// to our address; we just have to live with jerks sending us
// money. *smile emoji*
this.timeout(20000);
this.timeout(60000);
return provider.getBalance(test.address).then((balance) => {
equals("Balance", test.balance, balance);
return waiter(delay);
@ -456,7 +456,7 @@ function testProvider(providerName: string, networkName: string) {
if (test.code) {
it(`fetches address code: ${ test.address }`, function() {
this.timeout(20000);
this.timeout(60000);
return provider.getCode(test.address).then((code) => {
equals("Code", test.code, code);
return waiter(delay);
@ -467,7 +467,7 @@ function testProvider(providerName: string, networkName: string) {
if (test.storage) {
Object.keys(test.storage).forEach((position) => {
it(`fetches storage: ${ test.address }:${ position }`, function() {
this.timeout(20000);
this.timeout(60000);
return provider.getStorageAt(test.address, bnify(position)).then((value) => {
equals("Storage", test.storage[position], value);
return waiter(delay);
@ -478,7 +478,7 @@ function testProvider(providerName: string, networkName: string) {
if (test.name) {
it(`fetches the ENS name: ${ test.name }`, function() {
this.timeout(20000);
this.timeout(60000);
return provider.resolveName(test.name).then((address) => {
equals("ENS Name", test.address, address);
return waiter(delay);
@ -498,7 +498,7 @@ function testProvider(providerName: string, networkName: string) {
}
it(`fetches block (by number) #${ test.number }`, function() {
this.timeout(20000);
this.timeout(60000);
return checkBlock(provider.getBlock(test.number));
});
@ -508,7 +508,7 @@ function testProvider(providerName: string, networkName: string) {
}
it(`fetches block (by hash) ${ test.hash }`, function() {
this.timeout(20000);
this.timeout(60000);
return checkBlock(provider.getBlock(test.hash));
});
});
@ -534,7 +534,7 @@ function testProvider(providerName: string, networkName: string) {
}
it(`fetches transaction: ${ test.hash }`, function() {
this.timeout(20000);
this.timeout(60000);
return testTransaction(test);
});
});
@ -558,7 +558,7 @@ function testProvider(providerName: string, networkName: string) {
}
it(`fetches transaction receipt: ${ test.transactionHash }`, function() {
this.timeout(100000);
this.timeout(60000);
return testTransactionReceipt(test);
});
});
@ -626,7 +626,7 @@ describe("Test Basic Authentication", function() {
function test(name: string, url: TestCase): void {
it("tests " + name, function() {
this.timeout(20000);
this.timeout(60000);
return ethers.utils.fetchJson(url).then((data) => {
assert.equal(data.authenticated, true, "authenticates user");
});
@ -656,7 +656,7 @@ describe("Test Basic Authentication", function() {
test("insecure url", insecureForced);
it("tests insecure connections fail", function() {
this.timeout(20000);
this.timeout(60000);
assert.throws(() => {
return ethers.utils.fetchJson(insecure);
}, (error: Error) => {
@ -769,7 +769,7 @@ describe("Test Events", function() {
}
it("InfuraProvider", async function() {
this.timeout(50000);
this.timeout(60000);
const provider = new ethers.providers.InfuraProvider("rinkeby");
await testBlockEvent(provider);
});