-
Notifications
You must be signed in to change notification settings - Fork 116
[New TX Flow] Address copilot's suggestions #2014
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
Changes from 4 commits
ad493dd
9cfff97
a6b5eff
4376b10
a5f10ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,6 +72,10 @@ export const ValidateStepContent = () => { | |
| const onValidate = async () => { | ||
| if (!network.rpcUrl || !signedXdr) return; | ||
|
|
||
| // Clear previous validated result so a failed re-validation can't leave | ||
| // stale validatedXdr enabling the next step. | ||
| setValidatedXdr(undefined); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| try { | ||
| const response = await simulateTx({ | ||
| rpcUrl: network.rpcUrl, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,10 +73,11 @@ export default function BuildTransaction() { | |
| return !currentXdr || !(build.isValid.params && build.isValid.operations); | ||
| } | ||
| if (activeStep === "simulate") { | ||
| // Simulation must be complete. If auth entries exist, they must be signed | ||
| // (assembledXdr is set after auth signing + assembly, or after auto-assembly | ||
| // when no auth entries are present). | ||
| return !simulate.simulationResultJson; | ||
| // Simulation must be complete and assembledXdr must exist (set after auth | ||
| // signing + assembly, or after auto-assembly when no auth entries are | ||
| // present) so the sign step receives a transaction with | ||
| // simulation-derived resources/fees. | ||
| return !simulate.simulationResultJson || !simulate.assembledXdr; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| if (activeStep === "sign") { | ||
| return !sign.signedXdr; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ export const NewValidationResponseCard = ({ | |
| {/* @TODO to update the SDS design system */} | ||
| <Alert | ||
| placement="inline" | ||
| variant="success" | ||
| variant={variant} | ||
| title="Your transaction envelope XDR is ready." | ||
| icon={<Icon.CheckCircle />} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the variant is dynamic, should the icon be dynamic as well? |
||
| > | ||
|
|
@@ -83,7 +83,13 @@ export const NewValidationResponseCard = ({ | |
| gap="sm" | ||
| direction="row" | ||
| align="center" | ||
| justify={footerLeftEl && footerRightEl ? "space-between" : footerRightEl ? "end" : "left"} | ||
| justify={ | ||
| footerLeftEl && footerRightEl | ||
| ? "space-between" | ||
| : footerRightEl | ||
| ? "end" | ||
| : "left" | ||
| } | ||
| addlClassName="ValidationResponseCard__footer" | ||
| wrap="wrap" | ||
| > | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,9 +102,11 @@ export const SorobanAuthSigningCard = ({ | |
| const signedCount = signedAuthEntriesXdr.filter(Boolean).length; | ||
| const allSigned = signedCount === entryCount && entryCount > 0; | ||
|
|
||
| // Trigger onAllEntriesSigned when individual signing completes all entries | ||
| // Trigger onAllEntriesSigned when individual signing completes all entries. | ||
| // Only needed in individual mode — "Sign all" calls onAllEntriesSigned | ||
| // directly in handleCustomSignAll. | ||
| useEffect(() => { | ||
| if (allSigned) { | ||
| if (allSigned && signMode === "individual") { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| onAllEntriesSigned(signedAuthEntriesXdr); | ||
| } | ||
| // Only trigger when allSigned changes to true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,15 +29,14 @@ export const Tabs = ({ | |
| const isActive = t.href ? pathname === t.href : t.id === activeTabId; | ||
| const className = `Tab ${addlClassName ?? ""}`; | ||
|
|
||
| if (t.href) { | ||
| if (t.href && !t.isDisabled) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| return ( | ||
| <Link | ||
| key={t.id} | ||
| href={t.href} | ||
| className={`external-link ${className}`} | ||
| data-testid={t.id} | ||
| data-is-active={isActive} | ||
| data-is-disabled={t.isDisabled ?? undefined} | ||
| > | ||
| {t.label} | ||
| </Link> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,7 @@ export const TransactionStepper = ({ | |
|
|
||
| return ( | ||
| <div | ||
| role="button" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| key={step} | ||
| className="TransactionStepper__step" | ||
| data-is-active={isActive || undefined} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -705,7 +705,7 @@ export const hasTypeAndValue = (v: any) => v?.type && v.value !== undefined; | |
|
|
||
| /** | ||
| * Determines if the simulation result indicates a read-only transaction | ||
| * (no auth entries and no write footprint). | ||
| * (no write footprint). | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| */ | ||
| export const checkIsReadOnly = (responseData: Record<string, any>): boolean => { | ||
| try { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.