Skip to content
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 26 commits into from
Oct 2, 2024
Merged

Conversation

EdSDR
Copy link
Member

@EdSDR EdSDR commented Sep 25, 2024

No description provided.

EdSDR and others added 22 commits September 17, 2024 17:07
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 EdSDR force-pushed the feat/subnet-data-and-module-calc branch from 2f61427 to b7e6324 Compare October 1, 2024 13:00
@EdSDR EdSDR merged commit 09c7189 into main Oct 2, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants