Skip to content

upgradability: add multiplexing driver #1091 #1100

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

Merged
merged 5 commits into from
Jun 10, 2025

Conversation

adecaro
Copy link
Contributor

@adecaro adecaro commented May 30, 2025

This PR does the following: It introduces a new naming convention for the token drivers.
Before, a driver was identifier just by a label. Now, a driver is identified as .v. Both information can be retrieved from the interface driver.PublicParameters. This way, we can re-use the actual code that selects a driver to implicit select by version as well.

@adecaro adecaro added this to the Q2 milestone May 30, 2025
@adecaro adecaro requested a review from alexandrosfilios May 30, 2025 11:54
@adecaro adecaro changed the title introduce token driver naming convention. upgradability: add multiplexing driver #1091 May 30, 2025
@adecaro adecaro linked an issue May 30, 2025 that may be closed by this pull request
adecaro added 3 commits May 30, 2025 16:11
A driver is identified as <id>.v<version>

Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
@adecaro adecaro force-pushed the 1091-upgradability-add-multiplexing-driver branch from 3afbfbf to 79b7fc7 Compare May 30, 2025 14:11
@@ -45,6 +45,7 @@ func UpdatePublicParams(network *integration.Infrastructure, selector *token2.Re
issuerId := fungible.GetIssuerIdentity(tms, "newIssuer")
publicParam := fabtokenv1.PublicParams{
Label: "fabtoken",
Ver: 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

We could have a constant under fabtokenv1 called Version

Copy link
Contributor

Choose a reason for hiding this comment

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

In case this 1 is used also elsewhere in the production code.

@@ -167,8 +169,13 @@ func (p *PublicParams) Deserialize(raw []byte) error {
if err != nil {
return errors.Wrapf(err, "failed to deserialize public parameters")
}
if container.Identifier != p.Label {
return errors.Errorf("invalid identifier, expecting 'fabtoken', got [%s]", container.Identifier)
expectedID := string(core.TokenDriverName(FabtokenIdentifier, ProtocolV1))
Copy link
Contributor

Choose a reason for hiding this comment

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

for disambiguation I would call them TokenDriverIdentifier (instead of name), TokenDriveryType (instead of identifier), and TokenDriverVersion

Copy link
Contributor

@alexandrosfilios alexandrosfilios left a comment

Choose a reason for hiding this comment

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

LGTM

@adecaro adecaro merged commit db94197 into main Jun 10, 2025
101 of 103 checks passed
@adecaro adecaro deleted the 1091-upgradability-add-multiplexing-driver branch June 10, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upgradability: add multiplexing driver
2 participants