Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(tests): migrate remaining tests ts #1520

Merged
merged 1 commit into from
Jun 16, 2022

Conversation

martinkaintas
Copy link
Collaborator

No description provided.

test/integration/ga.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@subhod-i subhod-i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the pending todos comments.

tsconfig.json Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
test/utils.ts Outdated Show resolved Hide resolved
test/unit/memory-account.ts Outdated Show resolved Hide resolved
@@ -43,23 +43,23 @@ describe('MemoryAccount', function () {
})

it('Init with secretKey as hex string', async () => {
const acc = MemoryAccount({ keypair: testAcc })
return acc.address().should.eventually.be.equal(testAcc.publicKey)
const acc: _AccountMemory = MemoryAccount({ keypair: testAcc })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const acc: _AccountMemory = MemoryAccount({ keypair: testAcc })
const acc = MemoryAccount({ keypair: testAcc })

didn't we already defined MemoryAccount as _AccountMemory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it's a stamp, so acc gets an any type without the : _AccountMemory

test/integration/ga.ts Outdated Show resolved Hide resolved
test/integration/contract.ts Outdated Show resolved Hide resolved
test/integration/contract.ts Outdated Show resolved Hide resolved
test/integration/contract.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
test/integration/accounts.ts Outdated Show resolved Hide resolved
test/integration/accounts.ts Outdated Show resolved Hide resolved
test/integration/accounts.ts Outdated Show resolved Hide resolved
const queryFee = 500000
const ttl = { RelativeTTL: [50] }

before(async () => {
contract = await aeSdk.getContractInstance({ source: oracleContract })
await contract.deploy()
await contract.deploy([], {})
if (contract.deployInfo.address == null) throw new InternalError('Expected to not happen, required for TS')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can deploy function assert that deployInfo.address would be present?
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a function like this one, and use it to assert that deployInfo.address will be present at a certain scope. But I don't think we can make deploy itself do both.

 export function assertAddress (address: any): asserts address is EncodedData<'ct'> {
 if (address == null) throw new IllegalArgumentError('Address is required')
}

test/integration/paying-for.ts Outdated Show resolved Hide resolved
test/integration/paying-for.ts Outdated Show resolved Hide resolved
test/integration/rpc.ts Outdated Show resolved Hide resolved
test/integration/rpc.ts Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Jun 16, 2022

This pull request introduces 5 alerts when merging 71d3592 into 88d25af - view on LGTM.com

new alerts:

  • 5 for Syntax error

BREAKING CHANGE: `computeBidFee` accepts `startFee`, `increment` as options
@lgtm-com
Copy link

lgtm-com bot commented Jun 16, 2022

This pull request introduces 5 alerts when merging 4e2ece7 into 88d25af - view on LGTM.com

new alerts:

  • 5 for Syntax error

@davidyuk davidyuk merged commit 5ffd323 into aeternity:develop Jun 16, 2022
@davidyuk davidyuk deleted the feature/ts-tests branch June 16, 2022 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants