-
Notifications
You must be signed in to change notification settings - Fork 20
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
update contracts and tests for cairo 2.5.x #363
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits, great work otherwise!
contracts/src/account.cairo
Outdated
@@ -1,57 +1,233 @@ | |||
// copied from https://github.com/OpenZeppelin/cairo-contracts/blob/v0.8.1/src/presets/account.cairo | |||
// copied from https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.9.0/src/access/ownable/ownable.cairo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use a sha since tags can change
@@ -107,6 +107,9 @@ trait Billing<TContractState> { | |||
fn link_available_for_payment( | |||
self: @TContractState | |||
) -> (bool, u128); // (is negative, absolute difference) | |||
fn set_link_token( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch 👍🏻
set_contract_address(s1); | ||
multisig.confirm_transaction(0); | ||
|
||
// Signer 2 confirms the transaction | ||
set_caller_address(s2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm was this API removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah, it wasn't removed. we weren't using it the correct way. set_contract_address should only be used if the test contract is deployed in the testing suite. Otherwise we should use set_caller_address.
I noticed when testing that there is some undefined behavior if you do both
@@ -102,7 +103,7 @@ mod LinkToken { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a TODO to expose the minter method a couple lines above, can we take care of that here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lints and tests still fail. I'll quickly resolve
contracts/src/account.cairo
Outdated
|
||
/// # Account Preset | ||
/// # Ownable Component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You seem to have replaced the account contract with the ownable contract?
Used cairo 2.5.4, the last version of 2.5.x
Changes include
pending_owner
is used instead ofproposed_owner
and there is no 0 address check during a pending_owner proposal. This is fine because there will be never anyone who can confirm the ownership (no one will be 0 address) so the original owner will still be the owner and can try again.