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 tests for transaction-planner #690

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

Valentine1898
Copy link
Contributor

@Valentine1898 Valentine1898 commented Mar 6, 2024

The simplification of wasm transaction planner #609 is already finished, so it no longer makes sense for us to hold off on these tests

@Valentine1898 Valentine1898 linked an issue Mar 6, 2024 that may be closed by this pull request
Comment on lines +14 to +17
const mockPlanTransaction = vi.hoisted(() => vi.fn());
vi.mock('@penumbra-zone/wasm', () => ({
planTransaction: mockPlanTransaction,
}));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We didn't get rid of the indexed-db global in wasm and we don't have that goal anymore, so we have no choice but to use mock here

@Valentine1898
Copy link
Contributor Author

Valentine1898 commented Mar 6, 2024

let transaction_plan: JsValue = plan_transaction(
js_constants_params_value,
serde_wasm_bindgen::to_value(&planner_request).unwrap(),
full_viewing_key,
)
.await
.unwrap();

Actually wasm planner is tested with one case in rust tests, I think in future we need to write more rust tests for wasm planner

@grod220
Copy link
Collaborator

grod220 commented Mar 6, 2024

Agree, tests in the crate will be far more meaningful. Could you create a tracking issue with a proposal of tests we can write for the crate to increase coverage on that side?

@Valentine1898
Copy link
Contributor Author

Agree, tests in the crate will be far more meaningful. Could you create a tracking issue with a proposal of tests we can write for the crate to increase coverage on that side?

Yep #691

@Valentine1898 Valentine1898 merged commit 283817a into main Mar 6, 2024
6 checks passed
@Valentine1898 Valentine1898 deleted the 410-add-tests-for-transactionplannerrequest branch March 6, 2024 15:20
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.

Add tests for TransactionPlannerRequest
2 participants