Skip to content

Commit 30132d8

Browse files
committed
Merge remote-tracking branch 'origin/feature/payment-renaming' into feature/payment-renaming
2 parents 49d9330 + 5141728 commit 30132d8

File tree

5 files changed

+151
-128
lines changed

5 files changed

+151
-128
lines changed

wrappers/ios/libindy-pod/Indy-demoTests/Case Tests/Payment/PaymentHighCases.mm

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ - (void)tearDown {
3434
NSString *paymentMethod = @"null";
3535
NSString *paymentAddress = @"pay:null:test";
3636
NSString *inputs = @"[\"pay:null:1\", \"pay:null:2\"]";
37-
NSString *outputs = @"[{\"paymentAddress\": \"pay:null:1\", \"amount\":1, \"extra\":\"1\"}, {\"paymentAddress\": \"pay:null:2\", \"amount\":2, \"extra\":\"2\"}]";
37+
NSString *outputs = @"[{\"recipient\": \"pay:null:1\", \"amount\":1, \"extra\":\"1\"}, {\"recipient\": \"pay:null:2\", \"amount\":2, \"extra\":\"2\"}]";
3838
NSString *fees = @"{\"txnType1\":1, \"txnType2\":2}";
3939
NSString *incompatibleInputs = @"[\"pay:PAYMENT_METHOD_1:1\", \"pay:PAYMENT_METHOD_2:1\"]";
4040

@@ -89,27 +89,27 @@ - (void)testAddRequestFeesWorksForSeveralMethods {
8989
- (void)testParseResponseWithFeesWorks {
9090
ret = [[PaymentUtils sharedInstance] parseResponseWithFees:@"{}"
9191
paymentMethod:paymentMethod
92-
utxoJson:nil];
92+
receiptsJson:nil];
9393
XCTAssertEqual(ret.code, PaymentUnknownMethodError);
9494
}
9595

96-
// MARK: - Build Get UTXO Request
96+
// MARK: - Build Get Sources Request
9797

98-
- (void)testBuildGetUtxoRequestWorks {
99-
ret = [[PaymentUtils sharedInstance] buildGetUtxoRequest:walletHandle
100-
submitterDid:[TestUtils trusteeDid]
101-
paymentAddress:paymentAddress
102-
getUtxoTxnJson:nil
103-
paymentMethod:nil];
98+
- (void)testBuildGetSourcesRequestWorks {
99+
ret = [[PaymentUtils sharedInstance] buildGetSourcesRequest:walletHandle
100+
submitterDid:[TestUtils trusteeDid]
101+
paymentAddress:paymentAddress
102+
getSourcesTxnJson:nil
103+
paymentMethod:nil];
104104
XCTAssertEqual(ret.code, PaymentUnknownMethodError);
105105
}
106106

107-
// MARK: - Parse Get UTXO Response
107+
// MARK: - Parse Get Sources Response
108108

109-
- (void)testParseGetUtxoResponseWorks {
110-
ret = [[PaymentUtils sharedInstance] parseGetUtxoResponse:@"{}"
111-
paymentMethod:paymentMethod
112-
utxoJson:nil];
109+
- (void)testParseGetSourcesResponseWorks {
110+
ret = [[PaymentUtils sharedInstance] parseGetSourcesResponse:@"{}"
111+
paymentMethod:paymentMethod
112+
sourcesJson:nil];
113113
XCTAssertEqual(ret.code, PaymentUnknownMethodError);
114114
}
115115

@@ -130,7 +130,7 @@ - (void)testBuildPaymentRequestWorks {
130130
- (void)testParsePaymentResponseWorks {
131131
ret = [[PaymentUtils sharedInstance] parsePaymentResponse:@"{}"
132132
paymentMethod:paymentMethod
133-
utxoJson:nil];
133+
receiptsJson:nil];
134134
XCTAssertEqual(ret.code, PaymentUnknownMethodError);
135135
}
136136

wrappers/ios/libindy-pod/Indy-demoTests/Test Utils/PaymentUtils.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727

2828
- (NSError *)parseResponseWithFees:(NSString *)responseJson
2929
paymentMethod:(NSString *)paymentMethod
30-
utxoJson:(NSString **)utxoJson;
30+
receiptsJson:(NSString **)receiptsJson;
3131

32-
// MARK: - Get UTXO request
33-
- (NSError *)buildGetUtxoRequest:(IndyHandle)walletHandle
34-
submitterDid:(NSString *)submitterDid
35-
paymentAddress:(NSString *)paymentAddress
36-
getUtxoTxnJson:(NSString **)getUtxoTxnJson
37-
paymentMethod:(NSString **)paymentMethod;
32+
// MARK: - Get sources request
33+
- (NSError *)buildGetSourcesRequest:(IndyHandle)walletHandle
34+
submitterDid:(NSString *)submitterDid
35+
paymentAddress:(NSString *)paymentAddress
36+
getSourcesTxnJson:(NSString **)getSourcesTxnJson
37+
paymentMethod:(NSString **)paymentMethod;
3838

39-
- (NSError *)parseGetUtxoResponse:(NSString *)responseJson
40-
paymentMethod:(NSString *)paymentMethod
41-
utxoJson:(NSString **)utxoJson;
39+
- (NSError *)parseGetSourcesResponse:(NSString *)responseJson
40+
paymentMethod:(NSString *)paymentMethod
41+
sourcesJson:(NSString **)sourcesJson;
4242

4343
// MARK: - Payment request
4444
- (NSError *)buildPaymentRequest:(IndyHandle)walletHandle
@@ -50,7 +50,7 @@
5050

5151
- (NSError *)parsePaymentResponse:(NSString *)responseJson
5252
paymentMethod:(NSString *)paymentMethod
53-
utxoJson:(NSString **)utxoJson;
53+
receiptsJson:(NSString **)receiptsJson;
5454

5555
// MARK: - Mint request
5656
- (NSError *)buildMintRequest:(IndyHandle)walletHandle

wrappers/ios/libindy-pod/Indy-demoTests/Test Utils/PaymentUtils.m

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -94,71 +94,71 @@ - (NSError *)addFeesToRequest:(NSString *)requestJson
9494

9595
- (NSError *)parseResponseWithFees:(NSString *)responseJson
9696
paymentMethod:(NSString *)paymentMethod
97-
utxoJson:(NSString **)utxoJson {
97+
receiptsJson:(NSString **)receiptsJson {
9898
XCTestExpectation *completionExpectation = [[XCTestExpectation alloc] initWithDescription:@"completion finished"];
9999
__block NSError *err = nil;
100-
__block NSString *outUtxo = nil;
100+
__block NSString *outReceipts = nil;
101101

102102
[IndyPayment parseResponseWithFees:responseJson
103103
paymentMethod:paymentMethod
104-
completion:^(NSError *error, NSString *utxo) {
104+
completion:^(NSError *error, NSString *receipts) {
105105
err = error;
106-
outUtxo = utxo;
106+
outReceipts = receipts;
107107
[completionExpectation fulfill];
108108
}];
109109

110110
[self waitForExpectations:@[completionExpectation] timeout:[TestUtils longTimeout]];
111111

112-
if (utxoJson) {*utxoJson = outUtxo;}
112+
if (receiptsJson) {*receiptsJson = outReceipts;}
113113

114114
return err;
115115
}
116116

117-
- (NSError *)buildGetUtxoRequest:(IndyHandle)walletHandle
118-
submitterDid:(NSString *)submitterDid
119-
paymentAddress:(NSString *)paymentAddress
120-
getUtxoTxnJson:(NSString **)getUtxoTxnJson
121-
paymentMethod:(NSString **)paymentMethod {
117+
- (NSError *)buildGetSourcesRequest:(IndyHandle)walletHandle
118+
submitterDid:(NSString *)submitterDid
119+
paymentAddress:(NSString *)paymentAddress
120+
getSourcesTxnJson:(NSString **)getSourcesTxnJson
121+
paymentMethod:(NSString **)paymentMethod {
122122
XCTestExpectation *completionExpectation = [[XCTestExpectation alloc] initWithDescription:@"completion finished"];
123123
__block NSError *err = nil;
124124
__block NSString *outReq = nil;
125125
__block NSString *outPayMethod = nil;
126126

127-
[IndyPayment buildGetUtxoRequest:walletHandle
128-
submitterDid:submitterDid
129-
paymentAddress:paymentAddress
130-
completion:^(NSError *error, NSString *req, NSString *method) {
131-
err = error;
132-
outReq = req;
133-
outPayMethod = method;
134-
[completionExpectation fulfill];
135-
}];
127+
[IndyPayment buildGetSourcesRequest:walletHandle
128+
submitterDid:submitterDid
129+
paymentAddress:paymentAddress
130+
completion:^(NSError *error, NSString *req, NSString *method) {
131+
err = error;
132+
outReq = req;
133+
outPayMethod = method;
134+
[completionExpectation fulfill];
135+
}];
136136

137137
[self waitForExpectations:@[completionExpectation] timeout:[TestUtils longTimeout]];
138138

139-
if (getUtxoTxnJson) {*getUtxoTxnJson = outReq;}
139+
if (getSourcesTxnJson) {*getSourcesTxnJson = outReq;}
140140
if (paymentMethod) {*paymentMethod = outPayMethod;}
141141
return err;
142142
}
143143

144-
- (NSError *)parseGetUtxoResponse:(NSString *)responseJson
145-
paymentMethod:(NSString *)paymentMethod
146-
utxoJson:(NSString **)utxoJson {
144+
- (NSError *)parseGetSourcesResponse:(NSString *)responseJson
145+
paymentMethod:(NSString *)paymentMethod
146+
sourcesJson:(NSString **)sourcesJson {
147147
XCTestExpectation *completionExpectation = [[XCTestExpectation alloc] initWithDescription:@"completion finished"];
148148
__block NSError *err = nil;
149-
__block NSString *outUtxo = nil;
149+
__block NSString *outSources = nil;
150150

151-
[IndyPayment parseGetUtxoResponse:responseJson
152-
paymentMethod:paymentMethod
153-
completion:^(NSError *error, NSString *utxo) {
154-
err = error;
155-
outUtxo = utxo;
156-
[completionExpectation fulfill];
157-
}];
151+
[IndyPayment parseGetSourcesResponse:responseJson
152+
paymentMethod:paymentMethod
153+
completion:^(NSError *error, NSString *sources) {
154+
err = error;
155+
outSources = sources;
156+
[completionExpectation fulfill];
157+
}];
158158

159159
[self waitForExpectations:@[completionExpectation] timeout:[TestUtils longTimeout]];
160160

161-
if (utxoJson) {*utxoJson = outUtxo;}
161+
if (sourcesJson) {*sourcesJson = outSources;}
162162

163163
return err;
164164
}
@@ -194,22 +194,22 @@ - (NSError *)buildPaymentRequest:(IndyHandle)walletHandle
194194

195195
- (NSError *)parsePaymentResponse:(NSString *)responseJson
196196
paymentMethod:(NSString *)paymentMethod
197-
utxoJson:(NSString **)utxoJson {
197+
receiptsJson:(NSString **)receiptsJson {
198198
XCTestExpectation *completionExpectation = [[XCTestExpectation alloc] initWithDescription:@"completion finished"];
199199
__block NSError *err = nil;
200-
__block NSString *outUtxo = nil;
200+
__block NSString *outReceipts = nil;
201201

202202
[IndyPayment parsePaymentResponse:responseJson
203203
paymentMethod:paymentMethod
204-
completion:^(NSError *error, NSString *utxo) {
204+
completion:^(NSError *error, NSString *receipts) {
205205
err = error;
206-
outUtxo = utxo;
206+
outReceipts = receipts;
207207
[completionExpectation fulfill];
208208
}];
209209

210210
[self waitForExpectations:@[completionExpectation] timeout:[TestUtils longTimeout]];
211211

212-
if (utxoJson) {*utxoJson = outUtxo;}
212+
if (receiptsJson) {*receiptsJson = outReceipts;}
213213

214214
return err;
215215
}
@@ -249,21 +249,21 @@ - (NSError *)buildSetTxnFeesRequest:(IndyHandle)walletHandle
249249
setTxnFeesReqJson:(NSString **)setTxnFeesReqJson {
250250
XCTestExpectation *completionExpectation = [[XCTestExpectation alloc] initWithDescription:@"completion finished"];
251251
__block NSError *err = nil;
252-
__block NSString *outUtxo = nil;
252+
__block NSString *outSources = nil;
253253

254254
[IndyPayment buildSetTxnFeesRequest:walletHandle
255255
submitterDid:submitterDid
256256
paymentMethod:paymentMethod
257257
feesJson:feesJson
258-
completion:^(NSError *error, NSString *utxo) {
258+
completion:^(NSError *error, NSString *sources) {
259259
err = error;
260-
outUtxo = utxo;
260+
outSources = sources;
261261
[completionExpectation fulfill];
262262
}];
263263

264264
[self waitForExpectations:@[completionExpectation] timeout:[TestUtils longTimeout]];
265265

266-
if (setTxnFeesReqJson) {*setTxnFeesReqJson = outUtxo;}
266+
if (setTxnFeesReqJson) {*setTxnFeesReqJson = outSources;}
267267

268268
return err;
269269
}
@@ -274,20 +274,20 @@ - (NSError *)buildGetTxnFeesRequest:(IndyHandle)walletHandle
274274
getTxnFeesReqJson:(NSString **)getTxnFeesReqJson {
275275
XCTestExpectation *completionExpectation = [[XCTestExpectation alloc] initWithDescription:@"completion finished"];
276276
__block NSError *err = nil;
277-
__block NSString *outUtxo = nil;
277+
__block NSString *outU = nil;
278278

279279
[IndyPayment buildGetTxnFeesRequest:walletHandle
280280
submitterDid:submitterDid
281281
paymentMethod:paymentMethod
282-
completion:^(NSError *error, NSString *utxo) {
282+
completion:^(NSError *error, NSString *temp) {
283283
err = error;
284-
outUtxo = utxo;
284+
outU = temp;
285285
[completionExpectation fulfill];
286286
}];
287287

288288
[self waitForExpectations:@[completionExpectation] timeout:[TestUtils longTimeout]];
289289

290-
if (getTxnFeesReqJson) {*getTxnFeesReqJson = outUtxo;}
290+
if (getTxnFeesReqJson) {*getTxnFeesReqJson = outU;}
291291

292292
return err;
293293
}

0 commit comments

Comments
 (0)