-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
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]>
3afbfbf
to
79b7fc7
Compare
@@ -45,6 +45,7 @@ func UpdatePublicParams(network *integration.Infrastructure, selector *token2.Re | |||
issuerId := fungible.GetIssuerIdentity(tms, "newIssuer") | |||
publicParam := fabtokenv1.PublicParams{ | |||
Label: "fabtoken", | |||
Ver: 1, |
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.
We could have a constant under fabtokenv1
called Version
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.
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)) |
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.
for disambiguation I would call them TokenDriverIdentifier
(instead of name), TokenDriveryType
(instead of identifier), and TokenDriverVersion
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.
LGTM
Signed-off-by: Angelo De Caro <[email protected]>
Signed-off-by: Angelo De Caro <[email protected]>
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.