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

Add testing and instruction utils for combined deposit function #12

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

DaSichuan
Copy link

Creates two functions. One to create an instruction for the combined deposit function, and
another to create the instruction for testing purposes. Next I'll write a test that uses these.

Had to refactor some stuff around to make things a little nicer.

@DaSichuan DaSichuan requested a review from nope-finance July 1, 2021 01:15
@@ -943,7 +1003,7 @@ impl TestObligation {
&[
create_account(
&payer.pubkey(),
&obligation_keypair.pubkey(),
&obligation.keypair.pubkey(),
Copy link
Author

Choose a reason for hiding this comment

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

Had to change this because of lifetime stuff.
obligation_keypair is dead, but obligation.keypair is still alive, so we loan it to the create_account function.

Or something like that.

Copy link
Member

Choose a reason for hiding this comment

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

isn't this like you are reusing stuff between tests rather than having it sandboxed?

Copy link
Author

Choose a reason for hiding this comment

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

Hm, no I don't think this will cause it to be reused between tests. What do you mean?

@@ -205,7 +206,8 @@ pub fn add_obligation(
);

TestObligation {
pubkey: obligation_pubkey,
pubkey: obligation_pubkey, // TODO: remove this and just use keypair.
Copy link
Author

Choose a reason for hiding this comment

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

I'll do this TODO in a different PR

@nope-finance nope-finance merged commit 3b70835 into master Jul 3, 2021
@nope-finance nope-finance deleted the WM_add_a_test branch January 11, 2022 07:55
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