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 more contract api tests #794

Merged
merged 4 commits into from
Aug 6, 2024
Merged

add more contract api tests #794

merged 4 commits into from
Aug 6, 2024

Conversation

ailisp
Copy link
Member

@ailisp ailisp commented Aug 2, 2024

@ailisp ailisp marked this pull request as draft August 2, 2024 09:42
@ailisp ailisp marked this pull request as ready for review August 2, 2024 11:28
ailisp added 2 commits August 2, 2024 21:44
fix
@volovyks volovyks linked an issue Aug 2, 2024 that may be closed by this pull request
Copy link
Collaborator

@volovyks volovyks left a comment

Choose a reason for hiding this comment

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

Great work!

/// The fee is volatile and depends on the number of pending requests.
/// If used on a client side, it can give outdate results.
pub fn experimantal_signature_deposit(&self) -> u128 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you! I think I've made that mistake in docs as well.

}

#[tokio::test]
async fn test_derived_public_key() -> anyhow::Result<()> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will need to execute actual derivation logic in such a test. Not a blocker now.

Copy link
Contributor

Choose a reason for hiding this comment

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

agree. Probably good to be able to fix the pk in init_env() so we can test the value of the derived pk is correct.


let key: String = contract.view("public_key").await.unwrap().json().unwrap();

let execution = accounts[2]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should check that random acc can not vote for pk

}

#[tokio::test]
async fn test_derived_public_key() -> anyhow::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

agree. Probably good to be able to fix the pk in init_env() so we can test the value of the derived pk is correct.

@volovyks
Copy link
Collaborator

volovyks commented Aug 6, 2024

@ailisp merging, lets address all the comments if a follow up PR

@volovyks volovyks merged commit d37cd5f into develop Aug 6, 2024
4 checks passed
@volovyks volovyks deleted the test-contract-apis branch August 6, 2024 12:02
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.

Test all contract APIs (Unit tests)
3 participants