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

Port more aggregator tests to cairo #304

Merged
merged 5 commits into from
Jun 15, 2023

Conversation

calvwang9
Copy link
Contributor

@calvwang9 calvwang9 temporarily deployed to integration June 13, 2023 11:23 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 13, 2023 11:23 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 13, 2023 11:23 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 13, 2023 11:43 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 13, 2023 11:43 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 13, 2023 11:43 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 13, 2023 11:54 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 13, 2023 11:54 — with GitHub Actions Inactive
@archseer
Copy link
Collaborator

Can we now remove

it('payee management', async () => {
let payees = oracles.map((oracle) => ({
transmitter: oracle.transmitter.starknetContract.address,
payee: oracle.transmitter.starknetContract.address, // reusing transmitter acocunts as payees for simplicity
}))
// call set_payees, should succeed because all payees are zero
await owner.invoke(aggregator, 'set_payees', { payees })
// call set_payees, should succeed because values are unchanged
await owner.invoke(aggregator, 'set_payees', { payees })
let oracle = oracles[0].transmitter
let transmitter = oracle.starknetContract.address
let payee = transmitter
let proposed_oracle = oracles[1].transmitter
let proposed_transmitter = proposed_oracle.starknetContract.address
let proposed_payee = proposed_transmitter
// can't transfer to self
try {
await oracle.invoke(aggregator, 'transfer_payeeship', {
transmitter,
proposed: payee,
})
expect.fail()
} catch (err: any) {
// TODO: expect(err.message).to.contain("");
}
// only payee can transfer
try {
await proposed_oracle.invoke(aggregator, 'transfer_payeeship', {
transmitter,
proposed: proposed_payee,
})
expect.fail()
} catch (err: any) {}
// successful transfer
await oracle.invoke(aggregator, 'transfer_payeeship', {
transmitter,
proposed: proposed_payee,
})
// only proposed payee can accept
try {
await oracle.invoke(aggregator, 'accept_payeeship', { transmitter })
expect.fail()
} catch (err: any) {}
// successful accept
await proposed_oracle.invoke(aggregator, 'accept_payeeship', {
transmitter,
})
})
?

(You'll have to change this line in the next test to use oracles[0]

// NOTE: previous test changed oracle0's payee to oracle1
let payee = oracles[1].transmitter
)

@archseer
Copy link
Collaborator

Oh let's also remove https://github.com/smartcontractkit/chainlink-starknet/blob/develop/contracts/test/ocr2/aggregator_proxy.test.ts since it's fully covered by cairo-test now

@calvwang9 calvwang9 temporarily deployed to integration June 14, 2023 03:52 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 14, 2023 03:52 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 14, 2023 03:52 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 14, 2023 04:04 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 14, 2023 04:04 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 14, 2023 07:46 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 14, 2023 07:46 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 14, 2023 07:46 — with GitHub Actions Inactive
@calvwang9 calvwang9 changed the title Add more aggregator cairo tests Port more aggregator tests to cairo Jun 15, 2023
@calvwang9 calvwang9 requested a review from archseer June 15, 2023 03:38
@calvwang9 calvwang9 merged commit c224a3c into develop Jun 15, 2023
@calvwang9 calvwang9 deleted the BCI-1326/aggregator-cairo-tests branch June 15, 2023 03:50
@calvwang9 calvwang9 temporarily deployed to integration June 15, 2023 05:48 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 15, 2023 05:48 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 15, 2023 05:48 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 15, 2023 05:59 — with GitHub Actions Inactive
@calvwang9 calvwang9 temporarily deployed to integration June 15, 2023 05:59 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants