-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1976 from aeternity/feature/devmode-poll-interval
fix: ttl validation error in dev mode by reducing polling intervals
- Loading branch information
Showing
6 changed files
with
65 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { describe, it } from 'mocha'; | ||
import { expect } from 'chai'; | ||
import { getSdk, networkId } from '.'; | ||
|
||
describe('AeSdk', () => { | ||
describe('_getPollInterval', () => { | ||
it('returns value based on options', async () => { | ||
const aeSdk = await getSdk(0); | ||
aeSdk._options._expectedMineRate = 1000; | ||
aeSdk._options._microBlockCycle = 300; | ||
expect(await aeSdk._getPollInterval('key-block')).to.be.equal(333); | ||
expect(await aeSdk._getPollInterval('micro-block')).to.be.equal(100); | ||
}); | ||
|
||
it('returns correct value', async () => { | ||
const aeSdk = await getSdk(0); | ||
delete aeSdk._options._expectedMineRate; | ||
delete aeSdk._options._microBlockCycle; | ||
const [kb, mb] = networkId === 'ae_dev' ? [0, 0] : [60000, 1000]; | ||
expect(await aeSdk._getPollInterval('key-block')).to.be.equal(kb); | ||
expect(await aeSdk._getPollInterval('micro-block')).to.be.equal(mb); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters