Skip to content

Commit d5242aa

Browse files
author
Soumya Mohapatra
committed
Merge upstream/main into extend-issuer-wallet
Signed-off-by: Soumya Mohapatra <mohapatras@microsoft.com>
2 parents fd324b4 + 1bc4386 commit d5242aa

36 files changed

Lines changed: 321 additions & 306 deletions

docs/services/ttx.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,21 @@ sequenceDiagram
100100
end
101101
102102
rect rgba(255, 245, 238, 0.5)
103-
Note over R: Phase 2 - Responder decision
103+
Note over R: Phase 2 - Responder decision and reply
104104
alt RecipientRequest.RecipientData != nil
105105
R->>R: Verify wallet contains RecipientData.Identity
106-
R-->>I: RecipientData (echo path)
107106
else RecipientRequest.RecipientData == nil
108107
R->>R: Generate RecipientData from wallet
109-
R-->>I: RecipientData (fresh data path)
110108
end
109+
R->>R: endpoint.Bind(context.Me, RecipientData.Identity)
110+
Note over R,I: Bind before send so local resolver wiring fails before the peer receives RecipientData
111+
R-->>I: RecipientData (echo or fresh data path)
111112
end
112113
113114
rect rgba(240, 255, 240, 0.45)
114-
Note over I,R: Phase 3 - Local registration and bindings
115+
Note over I,R: Phase 3 - Initiator registration and bindings
115116
I->>I: RegisterRecipientIdentity(RecipientData)
116117
I->>I: endpoint.Bind(requested FSC identity, RecipientData.Identity)
117-
R->>R: endpoint.Bind(context.Me, RecipientData.Identity)
118118
end
119119
120120
rect rgba(245, 245, 245, 0.55)
@@ -146,14 +146,16 @@ sequenceDiagram
146146
Note over R: Phase 2 - Responder processing
147147
R->>R: RegisterRecipientIdentity(request.RecipientData)
148148
R->>R: GetRecipientData(responder wallet)
149+
R->>R: endpoint.Bind(context.Me, responder RecipientData.Identity)
150+
R->>R: endpoint.Bind(session caller, request.RecipientData.Identity)
151+
Note over R,I: Binds before send so resolver wiring fails before the initiator receives our RecipientData
149152
R-->>I: RecipientData(responder)
150153
end
151154
152155
rect rgba(240, 255, 240, 0.45)
153-
Note over I,R: Phase 3 - Local registration and bindings
156+
Note over I,R: Phase 3 - Initiator registration and bindings
154157
I->>I: RegisterRecipientIdentity(remote RecipientData)
155158
I->>I: endpoint.Bind(other FSC identity, remote RecipientData.Identity)
156-
R->>R: endpoint.Bind(session caller, request.RecipientData.Identity)
157159
end
158160
159161
Note over I,R: Full RecipientData on wire today (responder sends local wallet RecipientData)

integration/token/dvp/views/cash/list.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111

1212
"github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/assert"
1313
"github.com/hyperledger-labs/fabric-smart-client/platform/view/view"
14-
"github.com/hyperledger-labs/fabric-token-sdk/token"
1514
token2 "github.com/hyperledger-labs/fabric-token-sdk/token/token"
1615

1716
"github.com/hyperledger-labs/fabric-token-sdk/token/services/ttx"
@@ -35,7 +34,7 @@ func (p *ListUnspentTokensView) Call(context view.Context) (interface{}, error)
3534
assert.NotNil(wallet, "wallet [%s] not found", p.Wallet)
3635

3736
// Return the list of unspent tokens by type
38-
return wallet.ListUnspentTokens(ttx.WithType(p.TokenType), token.WithContext(context.Context()))
37+
return wallet.ListUnspentTokens(context.Context(), ttx.WithType(p.TokenType))
3938
}
4039

4140
type ListUnspentTokensViewFactory struct{}

integration/token/fungible/views/balance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (b *BalanceView) Call(context view.Context) (interface{}, error) {
4545
return nil, fmt.Errorf("wallet %s not found: %w", b.Wallet, err)
4646
}
4747

48-
unspentTokens, err := wallet.ListUnspentTokensIterator(token.WithType(b.Type), token.WithContext(context.Context()))
48+
unspentTokens, err := wallet.ListUnspentTokensIterator(context.Context(), token.WithType(b.Type))
4949
if err != nil {
5050
return nil, errors.Wrapf(err, "failed listing unspent tokens")
5151
}

integration/token/fungible/views/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (p *ListUnspentTokensView) Call(context view.Context) (interface{}, error)
3737
assert.NotNil(wallet, "wallet [%s] not found", p.Wallet)
3838

3939
// Return the list of unspent tokens by type
40-
return wallet.ListUnspentTokens(ttx.WithType(p.TokenType), token.WithContext(context.Context()))
40+
return wallet.ListUnspentTokens(context.Context(), ttx.WithType(p.TokenType))
4141
}
4242

4343
type ListUnspentTokensViewFactory struct{}

token/core/common/driver/mock/network_driver.go

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

token/driver/mock/ow.go

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

token/driver/mock/ppm_factory.go

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

token/driver/wallet.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ const (
9393
type ListTokensOptions struct {
9494
// TokenType is the type of token to list
9595
TokenType token.Type
96-
// Context is used to track the operation
97-
Context context.Context
9896
// SortBy specifies which field to use for ordering the results.
9997
SortBy SortField
10098
// SortDirection specifies ascending or descending order.
@@ -162,10 +160,10 @@ type OwnerWallet interface {
162160
GetTokenMetadataAuditInfo(id Identity) ([]byte, error)
163161

164162
// ListTokens returns the list of unspent tokens owned by this wallet filtered using the passed options.
165-
ListTokens(opts *ListTokensOptions) (*token.UnspentTokens, error)
163+
ListTokens(ctx context.Context, opts *ListTokensOptions) (*token.UnspentTokens, error)
166164

167165
// ListTokensIterator returns an iterator of unspent tokens owned by this wallet filtered using the passed options.
168-
ListTokensIterator(opts *ListTokensOptions) (UnspentTokensIterator, error)
166+
ListTokensIterator(ctx context.Context, opts *ListTokensOptions) (UnspentTokensIterator, error)
169167

170168
// Balance returns the sun of the amounts, with 64 bits of precision, of the tokens with type and EID equal to those passed as arguments.
171169
Balance(ctx context.Context, opts *BalanceOpts) (uint64, error)

0 commit comments

Comments
 (0)