@@ -19,8 +19,8 @@ pub const MintMemoryDatabase = struct {
19
19
20
20
active_keysets : std .AutoHashMap (nuts.CurrencyUnit , nuts .Id ),
21
21
keysets : std .AutoHashMap (nuts.Id , MintKeySetInfo ),
22
- mint_quotes : std .AutoHashMap ([ 16 ] u8 , MintQuote ),
23
- melt_quotes : std .AutoHashMap ([ 16 ] u8 , MeltQuote ),
22
+ mint_quotes : std .AutoHashMap (zul.UUID , MintQuote ),
23
+ melt_quotes : std .AutoHashMap (zul.UUID , MeltQuote ),
24
24
proofs : std .AutoHashMap ([33 ]u8 , nuts .Proof ),
25
25
proof_states : std .AutoHashMap ([33 ]u8 , nuts .nut07 .State ),
26
26
blinded_signatures : std .AutoHashMap ([33 ]u8 , nuts .BlindSignature ),
@@ -107,13 +107,13 @@ pub const MintMemoryDatabase = struct {
107
107
try _keysets .put (ks .id , ks );
108
108
}
109
109
110
- var _mint_quotes = std .AutoHashMap ([ 16 ] u8 , MintQuote ).init (allocator );
110
+ var _mint_quotes = std .AutoHashMap (zul . UUID , MintQuote ).init (allocator );
111
111
errdefer _mint_quotes .deinit ();
112
112
113
113
for (mint_quotes ) | q | {
114
114
try _mint_quotes .put (q .id , q );
115
115
}
116
- var _melt_quotes = std .AutoHashMap ([ 16 ] u8 , MeltQuote ).init (allocator );
116
+ var _melt_quotes = std .AutoHashMap (zul . UUID , MeltQuote ).init (allocator );
117
117
errdefer _melt_quotes .deinit ();
118
118
119
119
for (melt_quotes ) | q | {
@@ -146,9 +146,9 @@ pub const MintMemoryDatabase = struct {
146
146
147
147
const keysets = std .AutoHashMap (nuts .Id , MintKeySetInfo ).init (arena .allocator ());
148
148
149
- const mint_quotes = std .AutoHashMap ([ 16 ] u8 , MintQuote ).init (arena .allocator ());
149
+ const mint_quotes = std .AutoHashMap (zul . UUID , MintQuote ).init (arena .allocator ());
150
150
151
- const melt_quotes = std .AutoHashMap ([ 16 ] u8 , MeltQuote ).init (arena .allocator ());
151
+ const melt_quotes = std .AutoHashMap (zul . UUID , MeltQuote ).init (arena .allocator ());
152
152
153
153
const proofs = std .AutoHashMap ([33 ]u8 , nuts .Proof ).init (arena .allocator ());
154
154
@@ -236,7 +236,7 @@ pub const MintMemoryDatabase = struct {
236
236
}
237
237
238
238
// caller must free MintQuote
239
- pub fn getMintQuote (self : * Self , allocator : std.mem.Allocator , quote_id : [ 16 ] u8 ) ! ? MintQuote {
239
+ pub fn getMintQuote (self : * Self , allocator : std.mem.Allocator , quote_id : zul.UUID ) ! ? MintQuote {
240
240
self .lock .lockShared ();
241
241
defer self .lock .unlockShared ();
242
242
@@ -247,7 +247,7 @@ pub const MintMemoryDatabase = struct {
247
247
248
248
pub fn updateMintQuoteState (
249
249
self : * Self ,
250
- quote_id : [ 16 ] u8 ,
250
+ quote_id : zul.UUID ,
251
251
state : nuts.nut04.QuoteState ,
252
252
) ! nuts.nut04.QuoteState {
253
253
self .lock .lockShared ();
@@ -320,7 +320,7 @@ pub const MintMemoryDatabase = struct {
320
320
321
321
pub fn removeMintQuoteState (
322
322
self : * Self ,
323
- quote_id : [ 16 ] u8 ,
323
+ quote_id : zul.UUID ,
324
324
) ! void {
325
325
self .lock .lock ();
326
326
defer self .lock .unlock ();
@@ -337,7 +337,7 @@ pub const MintMemoryDatabase = struct {
337
337
}
338
338
339
339
// caller must free MeltQuote
340
- pub fn getMeltQuote (self : * Self , allocator : std.mem.Allocator , quote_id : [ 16 ] u8 ) ! ? MeltQuote {
340
+ pub fn getMeltQuote (self : * Self , allocator : std.mem.Allocator , quote_id : zul.UUID ) ! ? MeltQuote {
341
341
self .lock .lockShared ();
342
342
defer self .lock .unlockShared ();
343
343
@@ -348,7 +348,7 @@ pub const MintMemoryDatabase = struct {
348
348
349
349
pub fn updateMeltQuoteState (
350
350
self : * Self ,
351
- quote_id : [ 16 ] u8 ,
351
+ quote_id : zul.UUID ,
352
352
state : nuts.nut05.QuoteState ,
353
353
) ! nuts.nut05.QuoteState {
354
354
self .lock .lockShared ();
@@ -421,7 +421,7 @@ pub const MintMemoryDatabase = struct {
421
421
422
422
pub fn removeMeltQuoteState (
423
423
self : * Self ,
424
- quote_id : [ 16 ] u8 ,
424
+ quote_id : zul.UUID ,
425
425
) void {
426
426
self .lock .lock ();
427
427
defer self .lock .unlock ();
0 commit comments