Skip to content

map mycelium to twin identity #1037

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

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

Omarabdul3ziz
Copy link

@Omarabdul3ziz Omarabdul3ziz commented May 26, 2025

  • add storage map from myc->twin
  • add setter method to update the storage which emit TwinMyceliumPkSet event
  • update rs/ts/go clients with setter/getter methods

@Omarabdul3ziz Omarabdul3ziz force-pushed the development_TwinMycPK branch 3 times, most recently from b557493 to 3fd0ab0 Compare May 29, 2025 14:30
- add storage map from myc->twin
- add setter method to update the storage which emit TwinMyceliumPkSet event
- update rs/ts/go clients with setter/getter methods
@Omarabdul3ziz Omarabdul3ziz force-pushed the development_TwinMycPK branch from 3fd0ab0 to e325c9f Compare June 2, 2025 15:33
@Omarabdul3ziz Omarabdul3ziz changed the title update twin with myc pk map mycelium to twin identity Jun 2, 2025
@Omarabdul3ziz Omarabdul3ziz marked this pull request as ready for review June 2, 2025 16:34
@Omarabdul3ziz Omarabdul3ziz requested a review from Copilot June 3, 2025 09:35
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a mapping between a mycelium public key and a twin identity by adding new storage, extrinsics, events, and updating client libraries.

  • Adds a new storage map (MyceliumTwin) and setter extrinsic (set_mycelium_twin) that emits the MyceliumTwinUpdated event.
  • Updates weights, benchmarking, and clients in Rust, JavaScript, and Go to support the new mapping functionality.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
substrate-node/pallets/pallet-tfgrid/src/weights.rs Added weight calculation for the new extrinsic.
substrate-node/pallets/pallet-tfgrid/src/twin.rs Introduced the internal setter _set_mycelium_twin with event emission.
substrate-node/pallets/pallet-tfgrid/src/lib.rs Added storage definition and new extrinsic for mapping.
substrate-node/pallets/pallet-tfgrid/src/benchmarking.rs Added benchmarks for the new extrinsic.
scripts/activate/man.go Updated activation script (no direct mapping changes).
scripts/activate/go.mod Added dependency changes for the activation module.
clients/tfchain-client-rs/* Updated runtime client functions for setting/getting the mapping.
clients/tfchain-client-js/* Updated twin module and client to support the new extrinsic.
clients/tfchain-client-go/* Added new functions to map the mycelium public key to a twin.
clients/tfchain-client-go/events.go Introduced the event struct MyceliumTwinUpdated.
Comments suppressed due to low confidence (1)

substrate-node/pallets/pallet-tfgrid/src/twin.rs:412

  • [nitpick] Consider renaming '_set_mycelium_twin' to a name without a leading underscore (e.g. 'set_mycelium_twin_inner') since it is a public function. This helps clarify its intended internal usage and avoids confusion with private functions.
pub fn _set_mycelium_twin(

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.

1 participant