Skip to content

Commit 1b3269b

Browse files
committed
rebase
Signed-off-by: Angelo De Caro <angelo.decaro@gmail.com>
1 parent 5d2c3b4 commit 1b3269b

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

token/core/zkatdlog/nogh/v1/crypto/upgrade/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
1515
v1 "github.com/hyperledger-labs/fabric-token-sdk/token/core/fabtoken/v1"
16-
token2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/crypto/token"
16+
token2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/token"
1717
"github.com/hyperledger-labs/fabric-token-sdk/token/driver"
1818
"github.com/hyperledger-labs/fabric-token-sdk/token/services/logging"
1919
"github.com/hyperledger-labs/fabric-token-sdk/token/token"

token/core/zkatdlog/nogh/v1/driver/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414
"github.com/hyperledger-labs/fabric-token-sdk/token/core/common"
1515
"github.com/hyperledger-labs/fabric-token-sdk/token/core/common/metrics"
1616
v1 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1"
17+
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/crypto/upgrade"
1718
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/setup"
1819
token3 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/token"
19-
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/crypto/upgrade"
2020
"github.com/hyperledger-labs/fabric-token-sdk/token/driver"
2121
"github.com/hyperledger-labs/fabric-token-sdk/token/sdk/vault"
2222
"github.com/hyperledger-labs/fabric-token-sdk/token/services/config"

token/core/zkatdlog/nogh/v1/issue.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import (
1212

1313
common2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/common"
1414
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/crypto/common"
15+
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/crypto/upgrade"
1516
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/issue"
1617
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/setup"
17-
token2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/crypto/token"
18-
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/crypto/upgrade"
18+
token2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/token"
1919
"github.com/hyperledger-labs/fabric-token-sdk/token/driver"
2020
"github.com/hyperledger-labs/fabric-token-sdk/token/services/logging"
2121
"github.com/hyperledger-labs/fabric-token-sdk/token/token"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
Copyright IBM Corp. All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
package token
8+
9+
import (
10+
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
11+
"github.com/hyperledger-labs/fabric-token-sdk/token/core/fabtoken/v1/core"
12+
"github.com/hyperledger-labs/fabric-token-sdk/token/token"
13+
)
14+
15+
func ParseFabtokenToken(tok []byte, precision uint64, maxPrecision uint64) (*core.Output, uint64, error) {
16+
if precision < maxPrecision {
17+
return nil, 0, errors.Errorf("unsupported precision [%d], max [%d]", precision, maxPrecision)
18+
}
19+
20+
output := &core.Output{}
21+
err := output.Deserialize(tok)
22+
if err != nil {
23+
return nil, 0, errors.Wrap(err, "failed to unmarshal fabtoken")
24+
}
25+
q, err := token.NewUBigQuantity(output.Quantity, precision)
26+
if err != nil {
27+
return nil, 0, errors.Wrap(err, "failed to create quantity")
28+
}
29+
30+
return output, q.Uint64(), nil
31+
}

token/core/zkatdlog/nogh/v1/token/service.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/hyperledger-labs/fabric-token-sdk/token/core/fabtoken/v1/core"
1818
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/crypto/math"
1919
"github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/setup"
20-
token2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/nogh/v1/token"
2120
"github.com/hyperledger-labs/fabric-token-sdk/token/driver"
2221
"github.com/hyperledger-labs/fabric-token-sdk/token/services/logging"
2322
"github.com/hyperledger-labs/fabric-token-sdk/token/services/tokens/core/comm"

0 commit comments

Comments
 (0)