-
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 #1978 from aeternity/release/13.3.2
Release v13.3.2
- Loading branch information
Showing
22 changed files
with
121 additions
and
74 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -16,10 +16,7 @@ export async function getCachedIncreasedGasPrice(node: Node): Promise<bigint> { | |
|
||
// TODO: remove after requiring [email protected] | ||
const { nodeVersion } = await node._getCachedStatus(); | ||
// TODO: remove remove '6.12.0+' check after releasing 6.13.0 | ||
if (!nodeVersion.startsWith('6.12.0+') && !semverSatisfies(nodeVersion, '6.13.0', '8.0.0')) { | ||
return 0n; | ||
} | ||
if (!semverSatisfies(nodeVersion, '6.13.0')) return 0n; | ||
|
||
const { minGasPrice, utilization } = (await node.getRecentGasPrices())[0]; | ||
let gasPrice = utilization < 70 ? 0n : BigInt( | ||
|
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 |
---|---|---|
@@ -1,21 +1,22 @@ | ||
export default function semverSatisfies( | ||
version: string, | ||
geVersion: string, | ||
ltVersion: string, | ||
): boolean { | ||
function verCmp(a: string, b: string): number { | ||
const getComponents = (v: string): number[] => v | ||
.split(/[-+]/)[0].split('.').map((i) => +i); | ||
|
||
const versionComponents = getComponents(version); | ||
const geComponents = getComponents(geVersion); | ||
const ltComponents = getComponents(ltVersion); | ||
const aComponents = getComponents(a); | ||
const bComponents = getComponents(b); | ||
|
||
const base = Math.max(...versionComponents, ...geComponents, ...ltComponents) + 1; | ||
const base = Math.max(...aComponents, ...bComponents) + 1; | ||
const componentsToNumber = (components: number[]): number => components.reverse() | ||
.reduce((acc, n, idx) => acc + n * base ** idx, 0); | ||
|
||
const vNumber = componentsToNumber(versionComponents); | ||
const geNumber = componentsToNumber(geComponents); | ||
const ltNumber = componentsToNumber(ltComponents); | ||
return vNumber >= geNumber && vNumber < ltNumber; | ||
return componentsToNumber(aComponents) - componentsToNumber(bComponents); | ||
} | ||
|
||
export default function semverSatisfies( | ||
version: string, | ||
geVersion: string, | ||
ltVersion?: string, | ||
): boolean { | ||
return verCmp(version, geVersion) >= 0 | ||
&& (ltVersion == null || verCmp(version, ltVersion) < 0); | ||
} |
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
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
Oops, something went wrong.