Skip to content

Commit 0e21764

Browse files
committed
5. Field Type Optimization and Consistency
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent d14017f commit 0e21764

19 files changed

Lines changed: 41 additions & 41 deletions

File tree

cmd/tokengen/cobra/pp/fabtokenv1/gen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var (
3333
// Auditors is the list of auditor MSP directories containing the corresponding auditor certificate.
3434
Auditors []string
3535
// Version allows the caller of tokengen to override the version number put in the public parameters.
36-
Version uint
36+
Version uint32
3737
// Extras allows the caller to add extra parameters to the public parameters.
3838
Extras []string
3939
)
@@ -46,7 +46,7 @@ func Cmd() *cobra.Command {
4646
flags.BoolVarP(&GenerateCCPackage, "cc", "", false, "generate chaincode package")
4747
flags.StringSliceVarP(&Auditors, "auditors", "a", nil, "list of auditor MSP directories containing the corresponding auditor certificate")
4848
flags.StringSliceVarP(&Issuers, "issuers", "s", nil, "list of issuer MSP directories containing the corresponding issuer certificate")
49-
flags.UintVarP(&Version, "version", "v", 0, "allows the caller of tokengen to override the version number put in the public params")
49+
flags.Uint32VarP(&Version, "version", "v", 0, "allows the caller of tokengen to override the version number put in the public params")
5050
flags.StringArrayVarP(&Extras, "extra", "x", []string{}, "extra data in key=value format, where value is the path to a file containing the data to load and store in the key")
5151

5252
return cobraCommand

cmd/tokengen/cobra/pp/zkatdlognoghv1/gen.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type GeneratorArgs struct {
3939
// Aries is a flag to indicate that aries should be used as backend for idemix
4040
Aries bool
4141
// Version allows the caller of tokengen to override the version number put in the public params
42-
Version uint
42+
Version uint32
4343
}
4444

4545
var (
@@ -59,7 +59,7 @@ var (
5959
// Aries is a flag to indicate that aries should be used as backend for idemix
6060
Aries bool
6161
// Version allows the caller of tokengen to override the version number put in the public params
62-
Version uint
62+
Version uint32
6363
// Extras allows the caller to add extra parameters to the public parameters
6464
Extras []string
6565
)
@@ -75,7 +75,7 @@ func Cmd() *cobra.Command {
7575
flags.StringVarP(&IdemixMSPDir, "idemix", "i", "", "idemix msp dir")
7676
flags.Uint64VarP(&BitLength, "bits", "b", 64, "bits is used to define the maximum quantity a token can contain")
7777
flags.BoolVarP(&Aries, "aries", "r", false, "flag to indicate that aries should be used as backend for idemix")
78-
flags.UintVarP(&Version, "version", "v", 0, "allows the caller of tokengen to override the version number put in the public params")
78+
flags.Uint32VarP(&Version, "version", "v", 0, "allows the caller of tokengen to override the version number put in the public params")
7979
flags.StringArrayVarP(&Extras, "extra", "x", []string{}, "extra data in key=value format, where value is the path to a file containing the data to load and store in the key")
8080

8181
return cobraCommand

cmd/tokengen/cobra/pp/zkatdlognoghv1/update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type UpdateArgs struct {
3333
// Auditors is the list of auditor MSP directories containing the corresponding auditor certificate
3434
Auditors []string
3535
// Version allows the caller of tokengen to override the version number put in the public params
36-
Version uint
36+
Version uint32
3737
}
3838

3939
// UpdateCmd returns the Cobra Command for updating public parameters.
@@ -44,7 +44,7 @@ func UpdateCmd() *cobra.Command {
4444
flags.StringVarP(&OutputDir, "output", "o", ".", "output folder")
4545
flags.StringSliceVarP(&Auditors, "auditors", "a", nil, "list of auditor MSP directories containing the corresponding auditor certificate")
4646
flags.StringSliceVarP(&Issuers, "issuers", "s", nil, "list of issuer MSP directories containing the corresponding issuer certificate")
47-
flags.UintVarP(&Version, "version", "v", 0, "allows the caller of tokengen to override the version number put in the public params")
47+
flags.Uint32VarP(&Version, "version", "v", 0, "allows the caller of tokengen to override the version number put in the public params")
4848
flags.StringArrayVarP(&Extras, "extra", "x", []string{}, "extra data in key=value format, where is the path to a file containing the data to load and store in the key")
4949

5050
return cmd

token/core/fabtoken/protos-go/v1/actions/ftactions.pb.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

token/core/fabtoken/protos-go/v1/pp/ftpp.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

token/core/fabtoken/protos/v1/ftactions.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ message TransferActionOutput {
2828
}
2929

3030
message TransferAction {
31-
uint64 version = 1;
31+
uint32 version = 1;
3232
repeated TransferActionInput inputs = 2; // inputs
3333
repeated TransferActionOutput outputs = 3; // outputs
3434
map<string, bytes> metadata = 4; // Metadata contains the transfer action's metadata
@@ -45,7 +45,7 @@ message IssueActionOutput {
4545
}
4646

4747
message IssueAction {
48-
uint64 version = 1;
48+
uint32 version = 1;
4949
fabric_token_sdk.token.driver.v1.Identity issuer = 2; // is the identity of issuer
5050
repeated IssueActionInput inputs = 3; // are the tokens to be redeemed by this issue action
5151
repeated IssueActionOutput outputs = 4; // are the newly issued tokens

token/core/fabtoken/protos/v1/ftpp.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ option go_package = "github.com/hyperledger-labs/fabric-token-sdk/token/core/fab
1515
// PublicParameters describes typed public parameters
1616
message PublicParameters {
1717
string token_driver_name = 1; // the name of the token driver
18-
uint64 token_driver_version = 2; // the version of token driver
18+
uint32 token_driver_version = 2; // the version of token driver
1919
fabric_token_sdk.token.driver.v1.Identity auditor = 3; // is the public key of the auditor.
2020
repeated fabric_token_sdk.token.driver.v1.Identity issuers = 4; // is a list of public keys of the entities that can issue tokens.
2121
uint64 max_token = 5; // is the maximum quantity a token can hold

token/core/fabtoken/v1/setup/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (p *PublicParams) Bytes() ([]byte, error) {
131131

132132
params := &fabpp.PublicParameters{
133133
TokenDriverName: string(p.DriverName),
134-
TokenDriverVersion: uint64(p.DriverVersion),
134+
TokenDriverVersion: uint32(p.DriverVersion),
135135
Auditor: &driverv1.Identity{
136136
Raw: p.Auditor,
137137
},

token/core/zkatdlog/nogh/protos-go/v1/actions/noghactions.pb.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

token/core/zkatdlog/nogh/protos-go/v1/pp/noghpp.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)