-
Notifications
You must be signed in to change notification settings - Fork 1
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: subnet data and module calc #175
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com> Co-authored-by: Kelvin Steiner <me@steinerkelvin.dev>
Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
Add a new type definition for the Subnet type in the utils/types.ts file. This type is used to represent the output of the `byId` procedure in the AppRouter. It is a non-nullable type inferred from the `inferProcedureOutput` utility from the @trpc/server package. This commit adds the necessary import statements and defines the Subnet type using the inferred procedure output. Refactor: Update module import in type-transformations.ts Update the import statement for the Module type in the type-transformations.ts file of the commune-worker app. The import statement now uses the .js extension instead of .ts. Refactor: Update getSubspaceStorageMapping function Update the getSubspaceStorageMapping function in the types.ts file of the types package. This function returns an object mapping for the storage types VecMapping and DoubleMap. The mapping includes the keys "emission", "incentive", "dividends", "metadata", "lastUpdate", "registrationBlock", "name", and "address". Fix: Update foreign key reference in userSubnetDataSchema Update the foreign key reference in the userSubnetDataSchema of the db/schema.ts file. The reference now points to the netuid column instead of the id column in the subnetDataSchema. Refactor: Update component name in layout.tsx Update the component name in the layout.tsx file of the commune-validator app. The component name DelegatedModulesList is changed to DelegatedList. Refactor: Update module-fetcher.ts Comment out unnecessary fields in the queryRegisteredModulesInfo function call in the module-fetcher.ts file of the commune-worker app. The commented fields are "name", "address", "registrationBlock", "metadata", "lastUpdate", "incentive", "dividends", "delegationFee", and "stakeFrom". Refactor: Update DelegateSubnetWeight component Update the DelegateSubnetWeight component in the delegate-subnet-weight.tsx file of the commune-validator app. The component now accepts a Subnet object as a prop instead of individual id, founder, and name props. The component also uses the useDelegateSubnetStore hook to add or remove the subnet from the delegatedSubnets state. Refactor: Update SubnetAccordion component Update the SubnetAccordion component in the subnet-accordion.tsx file of the commune-validator app. The component now uses the Subnet type from the utils/types.ts file. It also uses the useDelegateSubnetStore hook to check if the subnet is delegated and to add or remove it from the delegatedSubnets state. This commit also updates the styling of the SubnetAccordion component to highlight delegated subnets with a cyan border and background color. Refactor: Update import statement in subnet-accordion.tsx Update the import statement in the subnet-accordion.tsx file of the commune-validator app. The import statement now imports the Subnet type from the utils/types.ts file. Refactor: Update import statement in delegate-subnet-store.ts Update the import statement in the delegate-subnet-store.ts file of the commune-validator app. The import statement now imports the Subnet type from the utils/types.ts file. Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
- Update delegateModuleStore.ts to set the percentage to 1 when adding a module. - Update delegateSubnetStore.ts to set the percentage to 1 when adding a subnet. - Update subnet-accordion.tsx to add fade-in animation when rendering the subnet accordion. - Update delegate-subnet-weight.tsx to display an error message if the user is not connected to a wallet. - Update delegate-module-weight.tsx to display an error message if the user is not connected to a wallet. - Update tutorial/page.tsx to add a link to go back to the subnets page. Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com> Co-authored-by: Kelvin Steiner <me@steinerkelvin.dev>
Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
Add a new type definition for the Subnet type in the utils/types.ts file. This type is used to represent the output of the `byId` procedure in the AppRouter. It is a non-nullable type inferred from the `inferProcedureOutput` utility from the @trpc/server package. This commit adds the necessary import statements and defines the Subnet type using the inferred procedure output. Refactor: Update module import in type-transformations.ts Update the import statement for the Module type in the type-transformations.ts file of the commune-worker app. The import statement now uses the .js extension instead of .ts. Refactor: Update getSubspaceStorageMapping function Update the getSubspaceStorageMapping function in the types.ts file of the types package. This function returns an object mapping for the storage types VecMapping and DoubleMap. The mapping includes the keys "emission", "incentive", "dividends", "metadata", "lastUpdate", "registrationBlock", "name", and "address". Fix: Update foreign key reference in userSubnetDataSchema Update the foreign key reference in the userSubnetDataSchema of the db/schema.ts file. The reference now points to the netuid column instead of the id column in the subnetDataSchema. Refactor: Update component name in layout.tsx Update the component name in the layout.tsx file of the commune-validator app. The component name DelegatedModulesList is changed to DelegatedList. Refactor: Update module-fetcher.ts Comment out unnecessary fields in the queryRegisteredModulesInfo function call in the module-fetcher.ts file of the commune-worker app. The commented fields are "name", "address", "registrationBlock", "metadata", "lastUpdate", "incentive", "dividends", "delegationFee", and "stakeFrom". Refactor: Update DelegateSubnetWeight component Update the DelegateSubnetWeight component in the delegate-subnet-weight.tsx file of the commune-validator app. The component now accepts a Subnet object as a prop instead of individual id, founder, and name props. The component also uses the useDelegateSubnetStore hook to add or remove the subnet from the delegatedSubnets state. Refactor: Update SubnetAccordion component Update the SubnetAccordion component in the subnet-accordion.tsx file of the commune-validator app. The component now uses the Subnet type from the utils/types.ts file. It also uses the useDelegateSubnetStore hook to check if the subnet is delegated and to add or remove it from the delegatedSubnets state. This commit also updates the styling of the SubnetAccordion component to highlight delegated subnets with a cyan border and background color. Refactor: Update import statement in subnet-accordion.tsx Update the import statement in the subnet-accordion.tsx file of the commune-validator app. The import statement now imports the Subnet type from the utils/types.ts file. Refactor: Update import statement in delegate-subnet-store.ts Update the import statement in the delegate-subnet-store.ts file of the commune-validator app. The import statement now imports the Subnet type from the utils/types.ts file. Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
- Update delegateModuleStore.ts to set the percentage to 1 when adding a module. - Update delegateSubnetStore.ts to set the percentage to 1 when adding a subnet. - Update subnet-accordion.tsx to add fade-in animation when rendering the subnet accordion. - Update delegate-subnet-weight.tsx to display an error message if the user is not connected to a wallet. - Update delegate-module-weight.tsx to display an error message if the user is not connected to a wallet. - Update tutorial/page.tsx to add a link to go back to the subnets page. Co-authored-by: PsicoThePato <PsicoThePato@users.noreply.github.com>
EdSDR
force-pushed
the
feat/subnet-data-and-module-calc
branch
from
October 1, 2024 13:00
2f61427
to
b7e6324
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.