-
Notifications
You must be signed in to change notification settings - Fork 20
feat(tangle-cloud): blueprint deployment request args configuration & finalization #2957
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
feat(tangle-cloud): blueprint deployment request args configuration & finalization #2957
Conversation
✅ Deploy Preview for tangle-leaderboard ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
context.securityRequirements[index].minExposurePercent, | ||
maxExposurePercent: | ||
context.securityRequirements[index].maxExposurePercent, |
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 have a check or assertion to ensure context.securityRequirements
has the same length as context.assets
.
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.
added to zod schema apps/tangle-cloud/src/utils/validations/deployBlueprint.ts:191:199
Context | ||
> = useCallback( | ||
async (context) => { | ||
const api = await getApiPromise(wsRpcEndpoint); |
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.
To keep a single source of truth, we could pass the API to the factory instead of using getApiPromise
(which caches it).
Another option is to investigate how TypeScript encodes these types, but that could take more time.
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.
Another option is to investigate how TypeScript encodes these types, but that could take more time
Dont think so 😂, cuz we generated types for easier usage, why dont we leverage it instead of try to re-write existing logic in PAPI
apps/tangle-cloud/src/pages/blueprints/[id]/deploy/DeploySteps/AssetConfigurationStep.tsx
Outdated
Show resolved
Hide resolved
apps/tangle-cloud/src/pages/blueprints/[id]/deploy/DeploySteps/BasicInformationStep.tsx
Outdated
Show resolved
Hide resolved
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.
Left some change suggestions.
apps/tangle-cloud/src/pages/blueprints/[id]/deploy/DeploySteps/BasicInformationStep.tsx
Outdated
Show resolved
Hide resolved
libs/tangle-shared-ui/src/data/blueprints/useServicePalletConfig.ts
Outdated
Show resolved
Hide resolved
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.
The logic in useRestakeAssets
is highly similar to existing logic. Refactor into a reusable hook and use it within useRestakeAssets
.
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.
This hook is used to get all asets not only restake assets
apps/tangle-cloud/src/pages/blueprints/[id]/deploy/DeploySteps/BasicInformationStep.tsx
Outdated
Show resolved
Hide resolved
apps/tangle-cloud/src/pages/blueprints/[id]/deploy/DeploySteps/OperatorSelectionStep.tsx
Outdated
Show resolved
Hide resolved
apps/tangle-cloud/src/pages/blueprints/[id]/deploy/DeploySteps/OperatorSelectionStep.tsx
Outdated
Show resolved
Hide resolved
...e-cloud/src/pages/blueprints/[id]/deploy/DeploySteps/components/AssetRequirementFormItem.tsx
Outdated
Show resolved
Hide resolved
…eployment-request-args-configuration
const useServicesRegisterTx = () => { | ||
const substrateTxFactory: SubstrateTxFactory<Context> = useCallback( | ||
async (api, _activeSubstrateAddress, context) => { | ||
const { blueprintIds, preferences, registrationArgs, amounts } = context; | ||
|
||
// TODO: Find a better way to get the chain decimals | ||
const decimals = | ||
api.registry.chainDecimals.length > 0 | ||
? api.registry.chainDecimals[0] | ||
: TANGLE_TOKEN_DECIMALS; |
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.
You can import the network and get the decimals from it: useNetworkStore
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.
but it results in a recursive hook within a hook. @AtelyPham do you have any idea?
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.
@danielbui12 using custom hooks within custom hooks is totally normal & common practice, if that's what you meant. Think about it like functions within functions -- it makes sense, it's simply building blocks reusing each other
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.
any update here? @danielbui12
libs/tangle-shared-ui/src/data/blueprints/useBlueprintRegisteredOperator.ts
Show resolved
Hide resolved
libs/tangle-shared-ui/src/data/blueprints/useServicePalletConfig.ts
Outdated
Show resolved
Hide resolved
conflicts @danielbui12 |
@yuri-xyz resolved. please take a time to verify my pr 🙏 |
merging, if anything's left over, feel free to solve in your next pr |
Summary of changes
Provide a detailed description of proposed changes.
Proposed area of change
Put an
x
in the boxes that apply.apps/tangle-dapp
apps/tangle-cloud
apps/leaderboard
libs/tangle-shared-ui
libs/ui-components
Associated issue(s)
Specify any issues that can be closed from these changes (e.g.
Closes #233
).Screen Recording
If possible provide screenshots and/or a screen recording of proposed change.
Screen.Recording.2025-04-12.at.09.39.12.mov