Repository navigation
Conversation
|
This PR targeted I retargeted it to |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Legatus audit: Changes requested (commit 97493fb) I'd hold this PR: the code is fine, but the PR title fails a CI check, so it can't merge as it is. What the PR fixes. A constructor like What I ran on head 97493fb:
Findings, most serious first:
The worktree has been removed. |
|
This PR targeted I retargeted it to |
danieljrc888
left a comment
There was a problem hiding this comment.
Reviewed at 0d37807. The approach (a type selector for $or schemas) fixes the real cause. Two things to change before merging:
1. The selector can show one type while a different value is sent (frontend/src/components/global/fields/UnionField.vue)
selected is initialised once and only recomputed by the watch on props.schema. ContractParams.setInputParams resets every argument to its default whenever methodBase changes, but when the union schema object keeps its identity (TanStack Query structural sharing keeps the unchanged {$or:[...]} object after the schema query is refetched) that watch does not fire.
Scenario: param a: str | None. Pick "string", type hello, then edit the contract code (for example add a second constructor parameter). The selector still shows "string", the model was reset to the default, and the deploy sends None.
Fix: either remount the fields on every reset (a generation counter bumped in setInputParams and used in the v-for :key in ContractParams.vue), or make UnionField derive selected from the model when the parent replaces it. Add a regression test that passes a new methodBase reusing the same schema object.
2. Raw JSON as option labels (UnionField.vue, options and placeholder)
Complex alternatives are rendered with JSON.stringify, so list[int] | None shows an option labelled [{"$rep":"int"}]. Map $rep to list, $dict to dict and object schemas to struct (with the inner type where it is simple).
Also
- The branch is based on
mainat c940729, 48 commits behindv0.124-dev. Rebase ontov0.124-dev. - It conflicts with #1833: both add
frontend/test/unit/components/ContractParams.test.ts, and #1833'sencodingErrors.integration.test.tsmocksuseInputMapwith onlygetComponent, so its 6 tests fail once this PR'sgetComponentPropscall is in the tree. Whichever lands second must merge the test files and addgetComponentPropsto that mock. - Not introduced here but now reachable from more places: the int alternative reuses the number input, so
12345678901234567890loses precision and a cleared field sends"".
0d37807 to
11f172b
Compare
|
Legatus audit: Approved (commit 11f172b) I'd merge this PR as it is at What changed since
What I ran on
Findings:
The worktree has been removed. |
|
/run-e2e all |
|
Re-reviewed at 11f172b. All four requested changes are resolved: fields are remounted on every reset through the generation key ( |
|
Checked 21edfa8 (readable placeholders through |
|
Legatus audit: Approved (commit 21edfa8) I'd merge this PR as it is at What changed since What I ran on
Findings:
I found nothing left to fix. The worktree has been removed. |
|
/run-e2e all |
|
Legatus audit: Approved (commit 21edfa8) I'd merge this PR as it is at The base moved.
Earlier results on the commit itself still hold. 243 unit tests passed, and type check, lint and formatting were clean. CI (
Findings:
I found no secrets and nothing outside the ticket. The worktree has been removed. LEGATUS-TICKET |
|
/run-e2e all |
|
Legatus audit: Approved (commit 21edfa8) I'd still merge this PR as it is at State now:
What I ran again on
Findings:
I've filed a ticket for the E2E problem below; it extends the one from my last review. The worktree has been removed. LEGATUS-TICKET
On #1834 the frontend build ( |
|
/run-e2e all |
|
Legatus audit: Approved (commit 21edfa8) I'd still merge this PR as it is at State now:
Tests re-run on
Findings:
I found no secrets and nothing outside the ticket. The worktree has been removed. |
|
/run-e2e all |
1 similar comment
|
/run-e2e all |
|
/run-e2e all v0.6 |
Fixes https://linear.app/genlayer-labs/issue/DXP-546/frontend-type-error-in-send-transaction
What and why
A constructor such as
def __init__(self, a: str | None = None)previously fell back to an empty raw-calldata field and failed during deployment argument parsing. Union parameters now have an explicit type selector and reuse existing typed inputs. None encodes as null; string accepts ordinary text, including empty strings.The shared form covers constructors and method calls, positional and keyword-only arguments. Resetting method parameters now remounts their inputs, keeping selectors synchronized even when schema refetching preserves a union object's identity. Complex alternatives use readable labels such as list[int], dict[string], and struct, while retaining raw-calldata entry. Only union fields receive schema props. Standalone None fields start with valid textual calldata.
Review follow-up
Testing done
cd frontend && npm ci --no-audit --no-fundafter rebase.npm run test -- --run: 35 files / 243 tests passed; TypeScript checking also passed after the final placeholder cleanup.npm run build: passed on final retry, including TypeScript checking. Earlier local attempts failed in Monaco import analysis; an unmodified v0.124-dev build also exited 139. Reporting this intermittent build failure separately.git diff --check: passed.Assumptions
Checks
User facing release notes
Contract union parameters now let you choose the input type, including None. Selections reset correctly after contract schema changes, and complex types have readable labels.