Skip to content

Commit 8f3cb2d

Browse files
Soumya Mohapatraadecaro
authored andcommitted
Add issuer identity filter to IssuedBalance, ListRedeemedTokens, RedeemedBalance
Signed-off-by: Soumya Mohapatra <mohapatras@microsoft.com>
1 parent cc617fc commit 8f3cb2d

11 files changed

Lines changed: 192 additions & 144 deletions

File tree

token/driver/mock/qe.go

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

token/driver/vault.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,16 @@ type QueryEngine interface {
8686
ListHistoryIssuedTokens(ctx context.Context) (*token.IssuedTokens, error)
8787
// IssuedBalance returns the sum of amounts of non-deleted tokens flagged as issued.
8888
// If tokenType is non-empty, only tokens of that type are included.
89-
IssuedBalance(ctx context.Context, tokenType token.Type) (uint64, error)
89+
// If issuerRaw is non-empty, only tokens issued by that identity are included.
90+
IssuedBalance(ctx context.Context, tokenType token.Type, issuerRaw Identity) (uint64, error)
9091
// ListRedeemedTokens returns issued tokens that were spent by a Redeem action.
9192
// If tokenType is non-empty, only tokens of that type are included.
92-
ListRedeemedTokens(ctx context.Context, tokenType token.Type) (*token.IssuedTokens, error)
93+
// If issuerRaw is non-empty, only tokens issued by that identity are included.
94+
ListRedeemedTokens(ctx context.Context, tokenType token.Type, issuerRaw Identity) (*token.IssuedTokens, error)
9395
// RedeemedBalance returns the sum of amounts of issued tokens spent by a Redeem action.
9496
// If tokenType is non-empty, only tokens of that type are included.
95-
RedeemedBalance(ctx context.Context, tokenType token.Type) (uint64, error)
97+
// If issuerRaw is non-empty, only tokens issued by that identity are included.
98+
RedeemedBalance(ctx context.Context, tokenType token.Type, issuerRaw Identity) (uint64, error)
9699
// PublicParams returns the serialized public parameters used by the driver.
97100
PublicParams(ctx context.Context) ([]byte, error)
98101
// GetTokenMetadata retrieves the private information (metadata) for the given token IDs.

token/services/identity/role/mock/itv.go

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

0 commit comments

Comments
 (0)