-
Notifications
You must be signed in to change notification settings - Fork 99
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
[Build Operations] Include Soroban's extend-ttl #1235
base: main
Are you sure you want to change the base?
Conversation
}} | ||
placement="right" | ||
// if we can't build a txn to simulate, we can't fetch the min resource fee | ||
disabled={!(isValid.params && isOperationValidForSimulateTx)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quietbits disabling the button until all operation params (except the resource fee) is filled
Preview is available here: |
1 similar comment
Preview is available here: |
// Used only for a Soroban operation | ||
// Includes a simulate transaction button to fetch | ||
// the minimum resource fee | ||
export const ResourceFeePickerWithQuery = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the component's name to include Query
|
||
// Soroban Operation only allows one operation | ||
// Add Operation button should be disabled | ||
await expect(page.getByText("Add Operation")).toBeDisabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using disabled
instead of not visible
Preview is available here: |
Preview is available here: |
@@ -932,6 +1089,204 @@ export const Operations = () => { | |||
); | |||
}; | |||
|
|||
/* Soroban Operations */ | |||
// Unlike classic transactions, Soroban tx can only have one operation | |||
if (soroban.operation.operation_type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could move Soroban and Classic operation blocks to their own components. This file is getting very long, and that might clean it up a bit. What do you think?
const sorobanData = getSorobanTxDataResult(); | ||
|
||
useEffect(() => { | ||
if (sorobanData.xdr) { | ||
updateSorobanBuildXdr(sorobanData.xdr); | ||
} | ||
}, [sorobanData.xdr, updateSorobanBuildXdr]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be safer to create a variable for sorobanData.xdr
because sorobanData
could be undefined.
const sorobanData = getSorobanTxDataResult(); | |
useEffect(() => { | |
if (sorobanData.xdr) { | |
updateSorobanBuildXdr(sorobanData.xdr); | |
} | |
}, [sorobanData.xdr, updateSorobanBuildXdr]); | |
const sorobanData = getSorobanTxDataResult(); | |
const sorobanDataXdr = sorobanData?.xdr || ""; | |
useEffect(() => { | |
if (sorobanDataXdr) { | |
updateSorobanBuildXdr(sorobanDataXdr); | |
} | |
}, [sorobanDataXdr, updateSorobanBuildXdr]); |
<ValidationResponseCard | ||
variant="success" | ||
title="Success! Soroban Transaction Envelope XDR:" | ||
response={ | ||
<Box gap="xs" data-testid="build-soroban-transaction-envelope-xdr"> | ||
<div> | ||
<div>Network Passphrase:</div> | ||
<div>{network.passphrase}</div> | ||
</div> | ||
<div> | ||
<div>Hash:</div> | ||
<div>{txnHash}</div> | ||
</div> | ||
<div> | ||
<div>XDR:</div> | ||
<div>{sorobanData.xdr}</div> | ||
</div> | ||
</Box> | ||
} | ||
note={ | ||
<> | ||
In order for the transaction to make it into the ledger, a | ||
transaction must be successfully signed and submitted to the | ||
network. The Lab provides the{" "} | ||
<SdsLink href={Routes.SIGN_TRANSACTION}> | ||
Transaction Signer | ||
</SdsLink>{" "} | ||
for signing a transaction, and the{" "} | ||
<SdsLink href={Routes.SUBMIT_TRANSACTION}> | ||
Post Transaction endpoint | ||
</SdsLink>{" "} | ||
for submitting one to the network. | ||
</> | ||
} | ||
footerLeftEl={ | ||
<> | ||
<Button | ||
size="md" | ||
variant="secondary" | ||
onClick={() => { | ||
updateSignImportXdr(sorobanData.xdr); | ||
updateSignActiveView("overview"); | ||
|
||
router.push(Routes.SIGN_TRANSACTION); | ||
}} | ||
> | ||
Sign in Transaction Signer | ||
</Button> | ||
|
||
<ViewInXdrButton xdrBlob={sorobanData.xdr} /> | ||
</> | ||
} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this component is almost the same as the Classic one, we should create a component to use in both places to make it easier to update them in the future.
} | ||
return builtXdr; | ||
} catch (e) { | ||
setErrorMessage(`${e}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the final message note that this is for the fee? I'm not sure if it would be clear to the user that these error messages relate to that.
Summary: