From 3a0e2fc9b5652ffdb0f07342923025f908625488 Mon Sep 17 00:00:00 2001 From: Andrei Marin Date: Mon, 9 Sep 2019 10:57:49 +0300 Subject: [PATCH] style fixes Signed-off-by: Russel --- .../IrohaContainer/IRIrohaContainer.h | 6 +- .../IrohaContainer/IRIrohaContainer.m | 20 +-- .../IRAccountRestoreWithBatchTest.m | 22 ++-- .../Scenarious/IRCreateAccountTest.m | 2 +- .../Scenarious/IRCreateDomainTest.m | 2 +- .../Scenarious/IRCreateRoleTest.m | 2 +- .../Scenarious/IRGetAccountDetailTest.m | 2 +- .../Private/Commands/IRAddAssetQuantity.m | 2 +- .../Private/Commands/IRSetAccountDetail.h | 4 +- .../Private/Commands/IRSetAccountDetail.m | 4 +- .../Private/Commands/IRTransferAsset.h | 2 +- .../Private/Commands/IRTransferAsset.m | 2 +- .../Classes/Private/IRBlockQueryRequestImpl.h | 2 +- .../Classes/Private/IRBlockQueryRequestImpl.m | 12 +- .../Classes/Private/IRProtobufTransformable.h | 2 +- .../Classes/Private/IRQueryRequestImpl.h | 2 +- .../Classes/Private/IRQueryRequestImpl.m | 12 +- .../Classes/Private/IRQueryResponse+Proto.h | 2 +- .../Classes/Private/IRQueryResponse+Proto.m | 48 ++++---- .../Classes/Private/IRTransactionImpl+Proto.h | 2 +- .../Classes/Private/IRTransactionImpl+Proto.m | 4 +- .../Classes/Private/IRTransactionImpl.h | 4 +- .../Classes/Private/IRTransactionImpl.m | 28 ++--- .../Private/IRTransactionStatusResponseImpl.h | 4 +- .../Private/IRTransactionStatusResponseImpl.m | 4 +- .../Classes/Private/Models/IRBlock+Proto.h | 2 +- .../Classes/Private/Models/IRBlock+Proto.m | 6 +- .../Classes/Private/Models/IRBlockImpl.h | 6 +- .../Classes/Private/Models/IRBlockImpl.m | 6 +- .../Classes/Private/Models/IRCommand+Proto.h | 2 +- .../Classes/Private/Models/IRCommand+Proto.m | 36 +++--- .../Private/Models/IRPeerSignature+Proto.h | 2 +- .../Private/Models/IRPeerSignature+Proto.m | 2 +- .../Classes/Private/Queries/IRGetAccount.m | 2 +- .../Queries/IRGetAccountAssetTransactions.m | 2 +- .../Private/Queries/IRGetAccountAssets.m | 2 +- .../Private/Queries/IRGetAccountDetail.h | 2 +- .../Private/Queries/IRGetAccountDetail.m | 2 +- .../Queries/IRGetAccountTransactions.m | 2 +- .../Classes/Private/Queries/IRGetAssetInfo.m | 2 +- .../Classes/Private/Queries/IRGetPeers.m | 2 +- .../Queries/IRGetPendingTransactions.m | 2 +- .../Private/Queries/IRGetRolePermissions.m | 2 +- .../Classes/Private/Queries/IRGetRoles.m | 2 +- .../Private/Queries/IRGetSignatories.m | 2 +- .../Private/Queries/IRGetTransactions.h | 2 +- .../Private/Queries/IRGetTransactions.m | 6 +- .../Responses/IRAccountAssetsResponse.h | 2 +- .../Responses/IRAccountAssetsResponse.m | 2 +- .../Responses/IRAccountDetailResponse.h | 4 +- .../Responses/IRAccountDetailResponse.m | 4 +- .../Private/Responses/IRAccountResponse.h | 4 +- .../Private/Responses/IRAccountResponse.m | 4 +- .../Private/Responses/IRAssetResponse.h | 2 +- .../Private/Responses/IRAssetResponse.m | 2 +- .../Responses/IRBlockQueryResponse+Proto.h | 2 +- .../Responses/IRBlockQueryResponse+Proto.m | 4 +- .../Responses/IRBlockQueryResponseImpl.h | 2 +- .../Responses/IRBlockQueryResponseImpl.m | 2 +- .../Private/Responses/IRErrorResponse.h | 4 +- .../Private/Responses/IRErrorResponse.m | 4 +- .../Private/Responses/IRPeersResponse.h | 2 +- .../Responses/IRRolePermissionsResponse.h | 2 +- .../Responses/IRRolePermissionsResponse.m | 2 +- .../Private/Responses/IRRolesResponse.h | 2 +- .../Private/Responses/IRRolesResponse.m | 2 +- .../Private/Responses/IRSignatoriesResponse.h | 2 +- .../Private/Responses/IRSignatoriesResponse.m | 2 +- .../Responses/IRTransactionsPageResponse.h | 4 +- .../Responses/IRTransactionsPageResponse.m | 4 +- .../Responses/IRTransactionsResponse.h | 2 +- .../Responses/IRTransactionsResponse.m | 2 +- .../Public/Builder/IRBlockQueryBuilder.h | 4 +- .../Public/Builder/IRBlockQueryBuilder.m | 10 +- .../Classes/Public/Builder/IRQueryBuilder.h | 8 +- .../Classes/Public/Builder/IRQueryBuilder.m | 16 +-- .../Public/Builder/IRTransactionBuilder.h | 10 +- .../Public/Builder/IRTransactionBuilder.m | 22 ++-- .../Public/Model/Common/IRAccountAsset.h | 6 +- .../Model/Common/IRAccountDetailPagination.h | 4 +- .../Model/Common/IRAccountDetailRecordId.h | 4 +- .../Classes/Public/Model/Common/IRAccountId.h | 14 +-- .../Classes/Public/Model/Common/IRAccountId.m | 2 +- .../Classes/Public/Model/Common/IRAddress.h | 8 +- .../Classes/Public/Model/Common/IRAddress.m | 20 +-- .../Classes/Public/Model/Common/IRAmount.h | 6 +- .../Classes/Public/Model/Common/IRAssetId.h | 14 +-- .../Classes/Public/Model/Common/IRAssetId.m | 16 +-- .../Public/Model/Common/IRAssetPagination.h | 4 +- .../Classes/Public/Model/Common/IRDomain.h | 6 +- .../Classes/Public/Model/Common/IRDomain.m | 8 +- .../Model/Common/IRGrantablePermission.h | 4 +- .../Model/Common/IRGrantablePermission.m | 2 +- .../Public/Model/Common/IRPagination.h | 20 +-- .../Public/Model/Common/IRPagination.m | 4 +- .../Public/Model/Common/IRPeerSignature.h | 6 +- .../Public/Model/Common/IRPeerSignature.m | 2 +- .../Classes/Public/Model/Common/IRRoleName.h | 4 +- .../Classes/Public/Model/Common/IRRoleName.m | 6 +- .../Public/Model/Common/IRRolePermission.h | 116 ++++++++++-------- .../Public/Model/Common/IRRolePermission.m | 2 +- .../Public/Model/IRBlockQueryRequest.h | 10 +- .../Public/Model/IRBlockQueryResponse.h | 16 +-- .../Classes/Public/Model/IRCommand.h | 82 ++++++------- .../Classes/Public/Model/IRQuery.h | 32 ++--- .../Classes/Public/Model/IRQueryRequest.h | 12 +- .../Classes/Public/Model/IRQueryResponse.h | 48 ++++---- .../Classes/Public/Model/IRSignable.h | 2 +- .../Classes/Public/Model/IRTransaction.h | 26 ++-- .../Model/IRTransactionStatusResponse.h | 6 +- .../Classes/Public/Promise/IRPromise.h | 20 +-- .../Classes/Public/Promise/IRPromise.m | 8 +- .../Serializers/IRSerializationFactory.h | 8 +- .../Serializers/IRSerializationFactory.m | 8 +- .../Classes/Public/Service/IRNetworkService.h | 4 +- .../Classes/Public/Service/IRNetworkService.m | 12 +- .../Public/Service/IRRepeatableStatusStream.h | 4 +- .../Public/Service/IRRepeatableStatusStream.m | 29 ++--- .../Service/IRTransactionStatusStreamable.h | 2 +- ProtoGen/Block.pbobjc.h | 2 +- ProtoGen/QryResponses.pbobjc.h | 6 +- ProtoGen/Queries.pbobjc.h | 2 +- ProtoGen/Transaction.pbobjc.h | 2 +- Tests/Model/IRAccountIdTests.m | 6 +- Tests/Model/IRAddressTests.m | 8 +- Tests/Model/IRAssetIdTests.m | 6 +- Tests/Model/IRAssetPaginationTests.m | 2 +- Tests/Model/IRRoleNameTests.m | 4 +- Tests/Promise/IRPromiseTests.m | 2 +- Tests/Query/IRQueryBuilderTests.m | 6 +- Tests/Transaction/IRTransactionTests.m | 4 +- 131 files changed, 547 insertions(+), 538 deletions(-) diff --git a/IntegrationTests/IrohaContainer/IRIrohaContainer.h b/IntegrationTests/IrohaContainer/IRIrohaContainer.h index 95ffb5caa..c519c6601 100755 --- a/IntegrationTests/IrohaContainer/IRIrohaContainer.h +++ b/IntegrationTests/IrohaContainer/IRIrohaContainer.h @@ -9,10 +9,10 @@ @interface IRIrohaContainer : NSObject -@property(nonatomic, readonly)IRNetworkService * _Nonnull iroha; +@property (nonatomic, readonly) IRNetworkService * _Nonnull iroha; + (nonnull instancetype)shared; -- (nullable NSError*)start; -- (nullable NSError*)stop; +- (nullable NSError *)start; +- (nullable NSError *)stop; @end diff --git a/IntegrationTests/IrohaContainer/IRIrohaContainer.m b/IntegrationTests/IrohaContainer/IRIrohaContainer.m index 3212217d0..35a5358b5 100755 --- a/IntegrationTests/IrohaContainer/IRIrohaContainer.m +++ b/IntegrationTests/IrohaContainer/IRIrohaContainer.m @@ -17,8 +17,8 @@ @interface IRIrohaContainer() -@property(strong, nonatomic)NSURLSession *session; -@property(strong, nonatomic)IRNetworkService *irohaService; +@property (nonatomic, strong) NSURLSession *session; +@property (nonatomic, strong) IRNetworkService *irohaService; @end @@ -101,7 +101,7 @@ - (nullable NSError *)start { return resultError; } -- (nullable NSError*)stop { +- (nullable NSError *)stop { dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); __block NSError *resultError; @@ -180,7 +180,7 @@ - (nonnull NSURLRequest*)createContainerStopRequest { #pragma mark - Response -- (nullable NSError*)handleRestartResponse:(nonnull NSURLResponse *)response +- (nullable NSError *)handleRestartResponse:(nonnull NSURLResponse *)response data:(nullable NSData *)data receivedError:(nullable NSError *)receivedError { if ([response isKindOfClass:[NSHTTPURLResponse class]]) { @@ -209,10 +209,10 @@ - (nullable NSError*)handleRestartResponse:(nonnull NSURLResponse *)response return [IRIrohaContainer errorForMessage:@"Unexpected response received during restart"]; } -- (nullable NSString*)handleTaskPreparationResponse:(nonnull NSURLResponse *)response +- (nullable NSString *)handleTaskPreparationResponse:(nonnull NSURLResponse *)response data:(nullable NSData *)data receivedError:(nullable NSError *)receivedError - resultError:(NSError*_Nullable*_Nullable)resultError { + resultError:(NSError *_Nullable*_Nullable)resultError { if (data) { NSDictionary *result = [NSJSONSerialization JSONObjectWithData:data options:0 @@ -239,7 +239,7 @@ - (nullable NSString*)handleTaskPreparationResponse:(nonnull NSURLResponse *)res } } -- (nullable NSError*)handleTaskExecutionResponse:(nonnull NSURLResponse *)response +- (nullable NSError *)handleTaskExecutionResponse:(nonnull NSURLResponse *)response data:(nullable NSData *)data receivedError:(nullable NSError *)receivedError { if ([response isKindOfClass:[NSHTTPURLResponse class]]) { @@ -268,7 +268,7 @@ - (nullable NSError*)handleTaskExecutionResponse:(nonnull NSURLResponse *)respon return [IRIrohaContainer errorForMessage:@"Unexpected response received on try to run iroha daemon"]; } -- (nullable NSError*)handleStopResponse:(nonnull NSURLResponse *)response +- (nullable NSError *)handleStopResponse:(nonnull NSURLResponse *)response data:(nullable NSData *)data receivedError:(nullable NSError *)receivedError { if ([response isKindOfClass:[NSHTTPURLResponse class]]) { @@ -312,7 +312,7 @@ - (BOOL)checkConnectivity { dispatch_semaphore_signal(semaphore); return nil; - }).onError(^IRPromise * _Nullable(NSError* error) { + }).onError(^IRPromise * _Nullable(NSError * error) { dispatch_semaphore_signal(semaphore); return nil; @@ -325,7 +325,7 @@ - (BOOL)checkConnectivity { #pragma mark - Helper -+ (nonnull NSError *)errorForMessage:(nonnull NSString*)message { ++ (nonnull NSError *)errorForMessage:(nonnull NSString *)message { NSString *domain = [NSString stringWithFormat:@"co.jp.soramitsu.iroha.%@", NSStringFromClass([IRIrohaContainer class])]; return [NSError errorWithDomain:domain code:0 diff --git a/IntegrationTests/Scenarious/IRAccountRestoreWithBatchTest.m b/IntegrationTests/Scenarious/IRAccountRestoreWithBatchTest.m index b5fa6f5dd..1bb4035d3 100644 --- a/IntegrationTests/Scenarious/IRAccountRestoreWithBatchTest.m +++ b/IntegrationTests/Scenarious/IRAccountRestoreWithBatchTest.m @@ -8,15 +8,15 @@ @interface IRAccountRestoreWithBatchTest : IRBaseIrohaContainerTests -@property(strong, nonatomic)id userRole; -@property(strong, nonatomic)id bankDomain; -@property(strong, nonatomic)id recoveryDomain; -@property(strong, nonatomic)id recoveryAccount; -@property(strong, nonatomic)id recoveryKeypair; -@property(strong, nonatomic)id recoverySigner; -@property(strong, nonatomic)id clientAccount; -@property(strong, nonatomic)id clientKeypair; -@property(strong, nonatomic)id clientSigner; +@property (strong, nonatomic) id userRole; +@property (strong, nonatomic) id bankDomain; +@property (strong, nonatomic) id recoveryDomain; +@property (strong, nonatomic) id recoveryAccount; +@property (strong, nonatomic) id recoveryKeypair; +@property (strong, nonatomic) id recoverySigner; +@property (strong, nonatomic) id clientAccount; +@property (strong, nonatomic) id clientKeypair; +@property (strong, nonatomic) id clientSigner; @end @@ -71,7 +71,7 @@ - (void)testAccountRestoreScenarioWithoutBatch { [expectation fulfill]; return nil; - }).onError(^IRPromise* _Nullable (NSError* error) { + }).onError(^IRPromise* _Nullable (NSError * error) { XCTFail(@"%@", error); [expectation fulfill]; @@ -105,7 +105,7 @@ - (void)testAccountRestoreScenarioWithBatch { [expectation fulfill]; return nil; - }).onError(^IRPromise* _Nullable (NSError* error) { + }).onError(^IRPromise* _Nullable (NSError * error) { XCTFail(@"%@", error); [expectation fulfill]; diff --git a/IntegrationTests/Scenarious/IRCreateAccountTest.m b/IntegrationTests/Scenarious/IRCreateAccountTest.m index ecdd49d27..3245e04c3 100755 --- a/IntegrationTests/Scenarious/IRCreateAccountTest.m +++ b/IntegrationTests/Scenarious/IRCreateAccountTest.m @@ -78,7 +78,7 @@ - (void)testCreateAccount { [expectation fulfill]; return nil; - }).onError(^IRPromise * _Nullable(NSError* error) { + }).onError(^IRPromise * _Nullable(NSError * error) { XCTFail(); NSLog(@"%@",error); diff --git a/IntegrationTests/Scenarious/IRCreateDomainTest.m b/IntegrationTests/Scenarious/IRCreateDomainTest.m index ea75ce59d..1e8b05924 100755 --- a/IntegrationTests/Scenarious/IRCreateDomainTest.m +++ b/IntegrationTests/Scenarious/IRCreateDomainTest.m @@ -46,7 +46,7 @@ - (void)testCreateDomain { }).onThen(^IRPromise * _Nullable(id result) { [expectation fulfill]; return nil; - }).onError(^IRPromise * _Nullable(NSError* error) { + }).onError(^IRPromise * _Nullable(NSError * error) { NSLog(@"%@", error); XCTFail(); diff --git a/IntegrationTests/Scenarious/IRCreateRoleTest.m b/IntegrationTests/Scenarious/IRCreateRoleTest.m index 4cc867778..f929673a7 100755 --- a/IntegrationTests/Scenarious/IRCreateRoleTest.m +++ b/IntegrationTests/Scenarious/IRCreateRoleTest.m @@ -63,7 +63,7 @@ - (void)testCreateRoleRejected { [expectation fulfill]; return nil; - }).onError(^IRPromise* _Nullable (NSError* error) { + }).onError(^IRPromise* _Nullable (NSError * error) { XCTFail(); NSLog(@"%@",error); diff --git a/IntegrationTests/Scenarious/IRGetAccountDetailTest.m b/IntegrationTests/Scenarious/IRGetAccountDetailTest.m index 9503d6bfc..93383b04d 100644 --- a/IntegrationTests/Scenarious/IRGetAccountDetailTest.m +++ b/IntegrationTests/Scenarious/IRGetAccountDetailTest.m @@ -105,7 +105,7 @@ - (void)testGetAccountDetailInSeveralPages { [expectation fulfill]; return nil; - }).onError(^IRPromise * _Nullable(NSError* error) { + }).onError(^IRPromise * _Nullable(NSError * error) { XCTFail(); NSLog(@"%@",error); diff --git a/IrohaCommunication/Classes/Private/Commands/IRAddAssetQuantity.m b/IrohaCommunication/Classes/Private/Commands/IRAddAssetQuantity.m index edd5e9395..c8230b417 100755 --- a/IrohaCommunication/Classes/Private/Commands/IRAddAssetQuantity.m +++ b/IrohaCommunication/Classes/Private/Commands/IRAddAssetQuantity.m @@ -22,7 +22,7 @@ - (nonnull instancetype)initWithAssetId:(nonnull id)assetId #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { AddAssetQuantity *assetQuantity = [[AddAssetQuantity alloc] init]; assetQuantity.assetId = [_assetId identifier]; assetQuantity.amount = [_amount value]; diff --git a/IrohaCommunication/Classes/Private/Commands/IRSetAccountDetail.h b/IrohaCommunication/Classes/Private/Commands/IRSetAccountDetail.h index 35d65ed38..6d8ee3308 100755 --- a/IrohaCommunication/Classes/Private/Commands/IRSetAccountDetail.h +++ b/IrohaCommunication/Classes/Private/Commands/IRSetAccountDetail.h @@ -10,7 +10,7 @@ @interface IRSetAccountDetail : NSObject - (nonnull instancetype)initWithAccountId:(nonnull id)accountId - key:(nonnull NSString*)key - value:(nonnull NSString*)value; + key:(nonnull NSString *)key + value:(nonnull NSString *)value; @end diff --git a/IrohaCommunication/Classes/Private/Commands/IRSetAccountDetail.m b/IrohaCommunication/Classes/Private/Commands/IRSetAccountDetail.m index cc605c578..6d78af59b 100755 --- a/IrohaCommunication/Classes/Private/Commands/IRSetAccountDetail.m +++ b/IrohaCommunication/Classes/Private/Commands/IRSetAccountDetail.m @@ -12,8 +12,8 @@ @implementation IRSetAccountDetail @synthesize value = _value; - (nonnull instancetype)initWithAccountId:(nonnull id)accountId - key:(nonnull NSString*)key - value:(nonnull NSString*)value { + key:(nonnull NSString *)key + value:(nonnull NSString *)value { if (self = [super init]) { _accountId = accountId; diff --git a/IrohaCommunication/Classes/Private/Commands/IRTransferAsset.h b/IrohaCommunication/Classes/Private/Commands/IRTransferAsset.h index abcdcd7fd..f3ddb0ded 100755 --- a/IrohaCommunication/Classes/Private/Commands/IRTransferAsset.h +++ b/IrohaCommunication/Classes/Private/Commands/IRTransferAsset.h @@ -12,7 +12,7 @@ - (nonnull instancetype)initWithSourceAccountId:(nonnull id)sourceAccountId destinationAccountId:(nonnull id)destinationAccountId assetId:(nonnull id)assetId - transferDescription:(nonnull NSString*)transferDescription + transferDescription:(nonnull NSString *)transferDescription amount:(nonnull id)amount; @end diff --git a/IrohaCommunication/Classes/Private/Commands/IRTransferAsset.m b/IrohaCommunication/Classes/Private/Commands/IRTransferAsset.m index 6a0150294..d7acaeb87 100755 --- a/IrohaCommunication/Classes/Private/Commands/IRTransferAsset.m +++ b/IrohaCommunication/Classes/Private/Commands/IRTransferAsset.m @@ -16,7 +16,7 @@ @implementation IRTransferAsset - (nonnull instancetype)initWithSourceAccountId:(nonnull id)sourceAccountId destinationAccountId:(nonnull id)destinationAccountId assetId:(nonnull id)assetId - transferDescription:(nonnull NSString*)transferDescription + transferDescription:(nonnull NSString *)transferDescription amount:(nonnull id)amount { if (self = [super init]) { diff --git a/IrohaCommunication/Classes/Private/IRBlockQueryRequestImpl.h b/IrohaCommunication/Classes/Private/IRBlockQueryRequestImpl.h index ecce1cfc0..3c3ee2002 100755 --- a/IrohaCommunication/Classes/Private/IRBlockQueryRequestImpl.h +++ b/IrohaCommunication/Classes/Private/IRBlockQueryRequestImpl.h @@ -15,7 +15,7 @@ typedef NS_ENUM(NSUInteger, IRQueryRequestError) { @interface IRBlockQueryRequest : NSObject - (nonnull instancetype)initWithCreator:(nonnull id)creator - createdAt:(nonnull NSDate*)createdAt + createdAt:(nonnull NSDate *)createdAt queryCounter:(UInt64)queryCounter peerSignature:(nullable id)peerSignature; diff --git a/IrohaCommunication/Classes/Private/IRBlockQueryRequestImpl.m b/IrohaCommunication/Classes/Private/IRBlockQueryRequestImpl.m index 240e510cb..c8ebadc63 100755 --- a/IrohaCommunication/Classes/Private/IRBlockQueryRequestImpl.m +++ b/IrohaCommunication/Classes/Private/IRBlockQueryRequestImpl.m @@ -17,7 +17,7 @@ @implementation IRBlockQueryRequest @synthesize peerSignature = _peerSignature; - (nonnull instancetype)initWithCreator:(nonnull id)creator - createdAt:(nonnull NSDate*)createdAt + createdAt:(nonnull NSDate *)createdAt queryCounter:(UInt64)queryCounter peerSignature:(nullable id)peerSignature { @@ -35,7 +35,7 @@ - (nonnull instancetype)initWithCreator:(nonnull id)creator - (nullable instancetype)signedWithSignatory:(nonnull id)signatory signatoryPublicKey:(nonnull id)signatoryPublicKey - error:(NSError**)error { + error:(NSError **)error { id peerSignature = [self signWithSignatory:signatory signatoryPublicKey:signatoryPublicKey @@ -78,7 +78,7 @@ - (nullable instancetype)signedWithSignatory:(nonnull id)signPayload:(nonnull QueryPayloadMeta*)payload signatory:(nonnull id)signatory - error:(NSError**)error { + error:(NSError **)error { NSData *payloadData = [payload data]; if (!payloadData) { @@ -151,7 +151,7 @@ - (nullable QueryPayloadMeta*)createPayload:(NSError**)error { #pragma mark - Helpers -+ (nonnull NSError*)errorWithType:(IRQueryRequestError)errorType message:(nonnull NSString*)message { ++ (nonnull NSError *)errorWithType:(IRQueryRequestError)errorType message:(nonnull NSString *)message { return [NSError errorWithDomain:NSStringFromClass([IRBlockQueryRequest class]) code:errorType userInfo:@{NSLocalizedDescriptionKey: message}]; diff --git a/IrohaCommunication/Classes/Private/IRProtobufTransformable.h b/IrohaCommunication/Classes/Private/IRProtobufTransformable.h index b6005b41a..0209bb7d7 100755 --- a/IrohaCommunication/Classes/Private/IRProtobufTransformable.h +++ b/IrohaCommunication/Classes/Private/IRProtobufTransformable.h @@ -8,7 +8,7 @@ @protocol IRProtobufTransformable -- (nullable id)transform:(NSError*_Nullable*_Nullable)error; +- (nullable id)transform:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Private/IRQueryRequestImpl.h b/IrohaCommunication/Classes/Private/IRQueryRequestImpl.h index 660906962..f8e9a3315 100755 --- a/IrohaCommunication/Classes/Private/IRQueryRequestImpl.h +++ b/IrohaCommunication/Classes/Private/IRQueryRequestImpl.h @@ -15,7 +15,7 @@ typedef NS_ENUM(NSUInteger, IRQueryRequestError) { @interface IRQueryRequest : NSObject - (nonnull instancetype)initWithCreator:(nonnull id)creator - createdAt:(nonnull NSDate*)createdAt + createdAt:(nonnull NSDate *)createdAt query:(nonnull id)query queryCounter:(UInt64)queryCounter peerSignature:(nullable id)peerSignature; diff --git a/IrohaCommunication/Classes/Private/IRQueryRequestImpl.m b/IrohaCommunication/Classes/Private/IRQueryRequestImpl.m index b99ddf970..248c905a7 100755 --- a/IrohaCommunication/Classes/Private/IRQueryRequestImpl.m +++ b/IrohaCommunication/Classes/Private/IRQueryRequestImpl.m @@ -18,7 +18,7 @@ @implementation IRQueryRequest @synthesize peerSignature = _peerSignature; - (nonnull instancetype)initWithCreator:(nonnull id)creator - createdAt:(nonnull NSDate*)createdAt + createdAt:(nonnull NSDate *)createdAt query:(nonnull id)query queryCounter:(UInt64)queryCounter peerSignature:(nullable id)peerSignature { @@ -38,7 +38,7 @@ - (nonnull instancetype)initWithCreator:(nonnull id)creator - (nullable instancetype)signedWithSignatory:(nonnull id)signatory signatoryPublicKey:(nonnull id)signatoryPublicKey - error:(NSError**)error { + error:(NSError **)error { id peerSignature = [self signWithSignatory:signatory signatoryPublicKey:signatoryPublicKey @@ -82,7 +82,7 @@ - (nullable instancetype)signedWithSignatory:(nonnull id)signPayload:(nonnull Query_Payload*)payload signatory:(nonnull id)signatory - error:(NSError**)error { + error:(NSError **)error { NSData *payloadData = [payload data]; if (!payloadData) { @@ -175,7 +175,7 @@ - (nullable Query_Payload*)createPayload:(NSError**)error { #pragma mark - Helpers -+ (nonnull NSError*)errorWithType:(IRQueryRequestError)errorType message:(nonnull NSString*)message { ++ (nonnull NSError *)errorWithType:(IRQueryRequestError)errorType message:(nonnull NSString *)message { return [NSError errorWithDomain:NSStringFromClass([IRQueryRequest class]) code:errorType userInfo:@{NSLocalizedDescriptionKey: message}]; diff --git a/IrohaCommunication/Classes/Private/IRQueryResponse+Proto.h b/IrohaCommunication/Classes/Private/IRQueryResponse+Proto.h index 0ef7b68e2..c5b157e47 100755 --- a/IrohaCommunication/Classes/Private/IRQueryResponse+Proto.h +++ b/IrohaCommunication/Classes/Private/IRQueryResponse+Proto.h @@ -18,6 +18,6 @@ typedef NS_ENUM(NSUInteger, IRQueryResponseFactoryError) { @interface IRQueryResponseProtoFactory : NSObject + (nullable id)responseFromProtobuf:(nonnull QueryResponse*)pbResponse - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Private/IRQueryResponse+Proto.m b/IrohaCommunication/Classes/Private/IRQueryResponse+Proto.m index 97c225d14..a44fbb098 100755 --- a/IrohaCommunication/Classes/Private/IRQueryResponse+Proto.m +++ b/IrohaCommunication/Classes/Private/IRQueryResponse+Proto.m @@ -13,7 +13,7 @@ @implementation IRQueryResponseProtoFactory + (nullable id)responseFromProtobuf:(nonnull QueryResponse*)pbResponse - error:(NSError*_Nullable*_Nullable)error { + error:(NSError *_Nullable*_Nullable)error { if (!pbResponse.queryHash) { if (error) { @@ -108,7 +108,7 @@ @implementation IRQueryResponseProtoFactory #pragma mark - Responses + (nullable id)assetResponseFromProtobuf:(nonnull AssetResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash + queryHash:(nonnull NSData *)queryHash error:(NSError **)error { id assetId = [IRAssetIdFactory assetWithIdentifier:pbResponse.asset.assetId error:error]; @@ -123,8 +123,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)accountResponseFromProtobuf:(nonnull AccountResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { id accountId = [IRAccountIdFactory accountWithIdentifier:pbResponse.account.accountId error:error]; @@ -153,8 +153,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)errorResponseFromProtobuf:(nonnull ErrorResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { IRErrorResponseReason reason; @@ -206,8 +206,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)rolesResponseFromPbResponse:(nonnull RolesResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { NSMutableArray> *roles = [NSMutableArray array]; @@ -227,8 +227,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)signatoriesResponseFromPbResponse:(nonnull SignatoriesResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { NSMutableArray> *publicKeys = [NSMutableArray array]; @@ -265,8 +265,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)transactionsResponseFromPbResponse:(nonnull TransactionsResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { NSArray> *transactions = [self transactionsFromPbTransactions:pbResponse.transactionsArray error:error]; @@ -280,8 +280,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)accountAssetsResponseFromPbResponse:(nonnull AccountAssetResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { NSMutableArray> *accountAssets = [NSMutableArray array]; @@ -322,7 +322,7 @@ @implementation IRQueryResponseProtoFactory id nextAssetId = nil; if (pbResponse.nextAssetId && pbResponse.nextAssetId.length > 0) { - NSError* error = nil; + NSError * error = nil; nextAssetId = [IRAssetIdFactory assetWithIdentifier: pbResponse.nextAssetId error:&error]; if (error) { @@ -337,8 +337,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)accountDetailResponseFromPbResponse:(nonnull AccountDetailResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { NSString *detail = pbResponse.detail ? pbResponse.detail : @""; @@ -356,8 +356,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)rolePermissionsResponseFromPbResponse:(nonnull RolePermissionsResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { NSMutableArray>* permissions = [NSMutableArray array]; for (NSUInteger i = 0; i < pbResponse.permissionsArray.count; i++) { id permission = [IRRolePermissionFactory permissionWithValue:[pbResponse.permissionsArray valueAtIndex:i] @@ -375,8 +375,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)transactionPageResponseFromPbResponse:(nonnull TransactionsPageResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { NSArray> *transactions = [self transactionsFromPbTransactions:pbResponse.transactionsArray error:error]; @@ -409,7 +409,7 @@ @implementation IRQueryResponseProtoFactory } + (nullable NSArray>*)transactionsFromPbTransactions:(nonnull NSArray*)pbTransactions - error:(NSError**)error { + error:(NSError **)error { NSMutableArray> *transactions = [NSMutableArray array]; @@ -428,8 +428,8 @@ @implementation IRQueryResponseProtoFactory } + (nullable id)peersResponseFromPbResponse:(nonnull PeersResponse*)pbResponse - queryHash:(nonnull NSData*)queryHash - error:(NSError**)error { + queryHash:(nonnull NSData *)queryHash + error:(NSError **)error { NSMutableArray> *peers = [NSMutableArray array]; for (Peer *pbPeer in pbResponse.peersArray) { diff --git a/IrohaCommunication/Classes/Private/IRTransactionImpl+Proto.h b/IrohaCommunication/Classes/Private/IRTransactionImpl+Proto.h index 18ecf182b..a8abc9040 100755 --- a/IrohaCommunication/Classes/Private/IRTransactionImpl+Proto.h +++ b/IrohaCommunication/Classes/Private/IRTransactionImpl+Proto.h @@ -14,6 +14,6 @@ typedef NS_ENUM(NSUInteger, IRTransactionProtoError) { @interface IRTransaction(Proto) + (nullable IRTransaction*)transactionFromPbTransaction:(nonnull Transaction*)pbTransaction - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Private/IRTransactionImpl+Proto.m b/IrohaCommunication/Classes/Private/IRTransactionImpl+Proto.m index f37fce2f4..15e5bd7d3 100755 --- a/IrohaCommunication/Classes/Private/IRTransactionImpl+Proto.m +++ b/IrohaCommunication/Classes/Private/IRTransactionImpl+Proto.m @@ -13,7 +13,7 @@ @implementation IRTransaction(Proto) + (nullable IRTransaction*)transactionFromPbTransaction:(nonnull Transaction*)pbTransaction - error:(NSError*_Nullable*_Nullable)error { + error:(NSError *_Nullable*_Nullable)error { NSMutableArray> *signatures = [NSMutableArray array]; for (Signature *pbSignature in pbTransaction.signaturesArray) { @@ -67,7 +67,7 @@ + (nullable IRTransaction*)transactionFromPbTransaction:(nonnull Transaction*)pb [commands addObject:command]; } - NSMutableArray *batchHashes = [NSMutableArray array]; + NSMutableArray *batchHashes = [NSMutableArray array]; IRTransactionBatchType batchType = IRTransactionBatchTypeNone; if (pbTransaction.payload.optionalBatchMetaOneOfCase == Transaction_Payload_OptionalBatchMeta_OneOfCase_Batch) { diff --git a/IrohaCommunication/Classes/Private/IRTransactionImpl.h b/IrohaCommunication/Classes/Private/IRTransactionImpl.h index 07d972872..ca54d12dc 100755 --- a/IrohaCommunication/Classes/Private/IRTransactionImpl.h +++ b/IrohaCommunication/Classes/Private/IRTransactionImpl.h @@ -17,11 +17,11 @@ typedef NS_ENUM(NSUInteger, IRTransactionError) { @interface IRTransaction : NSObject - (nonnull instancetype)initWithCreatorAccountId:(nonnull id)creatorAccountId - createdAt:(nonnull NSDate*)createdAt + createdAt:(nonnull NSDate *)createdAt commands:(nonnull NSArray>*)commands quorum:(NSUInteger)quorum signatures:(nullable NSArray>*)signatures - batchHashes:(nullable NSArray*)batchHashes + batchHashes:(nullable NSArray*)batchHashes batchType:(IRTransactionBatchType)batchType; @end diff --git a/IrohaCommunication/Classes/Private/IRTransactionImpl.m b/IrohaCommunication/Classes/Private/IRTransactionImpl.m index 2465a8f18..72265bd8e 100755 --- a/IrohaCommunication/Classes/Private/IRTransactionImpl.m +++ b/IrohaCommunication/Classes/Private/IRTransactionImpl.m @@ -22,11 +22,11 @@ @implementation IRTransaction @synthesize batchType = _batchType; - (nonnull instancetype)initWithCreatorAccountId:(nonnull id)creatorAccountId - createdAt:(nonnull NSDate*)createdAt + createdAt:(nonnull NSDate *)createdAt commands:(nonnull NSArray>*)commands quorum:(NSUInteger)quorum signatures:(nullable NSArray>*)signatures - batchHashes:(nullable NSArray*)batchHashes + batchHashes:(nullable NSArray*)batchHashes batchType:(IRTransactionBatchType)batchType { if (self = [super init]) { @@ -44,7 +44,7 @@ - (nonnull instancetype)initWithCreatorAccountId:(nonnull id)creato #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError*_Nullable*_Nullable)error { +- (nullable id)transform:(NSError *_Nullable*_Nullable)error { Transaction_Payload *payload = [self createPayload:error]; if (!payload) { @@ -70,7 +70,7 @@ - (nullable id)transform:(NSError*_Nullable*_Nullable)error { #pragma mark - Signable -- (nullable NSData*)transactionHashWithError:(NSError **)error { +- (nullable NSData *)transactionHashWithError:(NSError **)error { Transaction_Payload *payload = [self createPayload:error]; if (!payload) { @@ -104,7 +104,7 @@ - (nullable NSData*)transactionHashWithError:(NSError **)error { - (nullable id)signWithSignatory:(nonnull id)signatory signatoryPublicKey:(nonnull id)signatoryPublicKey - error:(NSError**)error { + error:(NSError **)error { Transaction_Payload *payload = [self createPayload:error]; @@ -125,7 +125,7 @@ - (nullable NSData*)transactionHashWithError:(NSError **)error { - (nullable instancetype)signedWithSignatories:(nonnull NSArray>*)signatories signatoryPublicKeys:(nonnull NSArray> *)signatoryPublicKeys - error:(NSError**)error { + error:(NSError **)error { if ([signatories count] == 0) { if (error) { @@ -189,9 +189,9 @@ - (nullable instancetype)signedWithSignatories:(nonnull NSArray*)transactionBatchHashes +- (nullable instancetype)batched:(nullable NSArray*)transactionBatchHashes batchType:(IRTransactionBatchType)batchType - error:(NSError**)error { + error:(NSError **)error { if (batchType == IRTransactionBatchTypeNone) { return [[IRTransaction alloc] initWithCreatorAccountId:_creator @@ -221,7 +221,7 @@ - (nullable instancetype)batched:(nullable NSArray*)transactionBatchHas batchType:batchType]; } -- (nullable NSData*)batchHashWithError:(NSError **)error { +- (nullable NSData *)batchHashWithError:(NSError **)error { Transaction_Payload_ReducedPayload *reducedPayload = [self createReducedPayload:error]; if (!reducedPayload) { @@ -255,7 +255,7 @@ - (nullable NSData*)batchHashWithError:(NSError **)error { #pragma mark - Private -- (nullable Transaction_Payload_ReducedPayload*)createReducedPayload:(NSError**)error { +- (nullable Transaction_Payload_ReducedPayload*)createReducedPayload:(NSError **)error { NSMutableArray *protobufCommands = [NSMutableArray array]; for (id command in _commands) { @@ -297,7 +297,7 @@ - (nullable Transaction_Payload_ReducedPayload*)createReducedPayload:(NSError**) return reducedPayload; } -- (nullable Transaction_Payload*)createPayload:(NSError**)error { +- (nullable Transaction_Payload*)createPayload:(NSError **)error { Transaction_Payload_ReducedPayload *reducedPayload = [self createReducedPayload:error]; if (!reducedPayload) { @@ -324,7 +324,7 @@ - (nullable Transaction_Payload*)createPayload:(NSError**)error { Transaction_Payload_BatchMeta *pbBatchMeta = [[Transaction_Payload_BatchMeta alloc] init]; pbBatchMeta.type = pbBatchType; - NSMutableArray *pbReducedHashes = [NSMutableArray array]; + NSMutableArray *pbReducedHashes = [NSMutableArray array]; for (NSData *batchHash in _batchHashes) { [pbReducedHashes addObject:[batchHash toHexString]]; @@ -340,7 +340,7 @@ - (nullable Transaction_Payload*)createPayload:(NSError**)error { - (nullable id)signPayload:(nonnull Transaction_Payload*)payload signatory:(nonnull id)signatory - error:(NSError**)error { + error:(NSError **)error { NSData *payloadData = [payload data]; if (!payloadData) { @@ -379,7 +379,7 @@ - (nullable Transaction_Payload*)createPayload:(NSError**)error { #pragma mark - Helpers -+ (nonnull NSError*)errorWithType:(IRTransactionError)errorType message:(nonnull NSString*)message { ++ (nonnull NSError *)errorWithType:(IRTransactionError)errorType message:(nonnull NSString *)message { return [NSError errorWithDomain:NSStringFromClass([IRTransaction class]) code:errorType userInfo:@{NSLocalizedDescriptionKey: message}]; diff --git a/IrohaCommunication/Classes/Private/IRTransactionStatusResponseImpl.h b/IrohaCommunication/Classes/Private/IRTransactionStatusResponseImpl.h index f1f125379..2cf6f6e35 100755 --- a/IrohaCommunication/Classes/Private/IRTransactionStatusResponseImpl.h +++ b/IrohaCommunication/Classes/Private/IRTransactionStatusResponseImpl.h @@ -9,7 +9,7 @@ @interface IRTransactionStatusResponse : NSObject - (nonnull instancetype)initWithStatus:(IRTransactionStatus)status - transactionHash:(nonnull NSData*)transactionHash - description:(nullable NSString*)statusDescription; + transactionHash:(nonnull NSData *)transactionHash + description:(nullable NSString *)statusDescription; @end diff --git a/IrohaCommunication/Classes/Private/IRTransactionStatusResponseImpl.m b/IrohaCommunication/Classes/Private/IRTransactionStatusResponseImpl.m index 0d66e32f0..ec1dd743f 100755 --- a/IrohaCommunication/Classes/Private/IRTransactionStatusResponseImpl.m +++ b/IrohaCommunication/Classes/Private/IRTransactionStatusResponseImpl.m @@ -11,8 +11,8 @@ @implementation IRTransactionStatusResponse @synthesize statusDescription = _statusDescription; - (nonnull instancetype)initWithStatus:(IRTransactionStatus)status - transactionHash:(nonnull NSData*)transactionHash - description:(nullable NSString*)statusDescription { + transactionHash:(nonnull NSData *)transactionHash + description:(nullable NSString *)statusDescription { if (self = [super init]) { _status = status; diff --git a/IrohaCommunication/Classes/Private/Models/IRBlock+Proto.h b/IrohaCommunication/Classes/Private/Models/IRBlock+Proto.h index 7bc06f144..de7bc6fd8 100755 --- a/IrohaCommunication/Classes/Private/Models/IRBlock+Proto.h +++ b/IrohaCommunication/Classes/Private/Models/IRBlock+Proto.h @@ -13,6 +13,6 @@ typedef NS_ENUM(NSUInteger, IRBlockProtoError) { @interface IRBlock (Proto) -+ (nullable id)blockFromPbBlock:(nonnull Block*)block error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)blockFromPbBlock:(nonnull Block*)block error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Private/Models/IRBlock+Proto.m b/IrohaCommunication/Classes/Private/Models/IRBlock+Proto.m index 74769da18..9405c8c04 100755 --- a/IrohaCommunication/Classes/Private/Models/IRBlock+Proto.m +++ b/IrohaCommunication/Classes/Private/Models/IRBlock+Proto.m @@ -13,7 +13,7 @@ @implementation IRBlock (Proto) -+ (nullable id)blockFromPbBlock:(nonnull Block*)block error:(NSError*_Nullable*_Nullable)error { ++ (nullable id)blockFromPbBlock:(nonnull Block*)block error:(NSError *_Nullable*_Nullable)error { if (!block.blockV1) { if (error) { *error = [IRBlock errorWithMessage:@"Versioned block expected but nil found."]; @@ -58,7 +58,7 @@ @implementation IRBlock (Proto) NSDate *createdAt = [NSDate dateWithTimestampInMilliseconds:block.blockV1.payload.createdTime]; - NSMutableArray *rejectedHashes = [NSMutableArray array]; + NSMutableArray *rejectedHashes = [NSMutableArray array]; if (!block.blockV1.payload.rejectedTransactionsHashesArray) { if (error) { @@ -101,7 +101,7 @@ @implementation IRBlock (Proto) #pragma mark - Helper -+ (nonnull NSError*)errorWithMessage:(NSString*)message { ++ (nonnull NSError *)errorWithMessage:(NSString *)message { return [NSError errorWithDomain:NSStringFromClass([IRBlock class]) code:IRBlockProtoErrorInvalidField userInfo:@{NSLocalizedDescriptionKey: message}]; diff --git a/IrohaCommunication/Classes/Private/Models/IRBlockImpl.h b/IrohaCommunication/Classes/Private/Models/IRBlockImpl.h index c06f563f6..1ee1834fb 100755 --- a/IrohaCommunication/Classes/Private/Models/IRBlockImpl.h +++ b/IrohaCommunication/Classes/Private/Models/IRBlockImpl.h @@ -9,10 +9,10 @@ @interface IRBlock : NSObject - (nonnull instancetype)initWithHeight:(UInt64)height - previousBlockHash:(nullable NSData*)previousBlockHash - createdAt:(nonnull NSDate*)createdAt + previousBlockHash:(nullable NSData *)previousBlockHash + createdAt:(nonnull NSDate *)createdAt transactions:(nonnull NSArray*)transactions - rejectedTransactionHashes:(nonnull NSArray*)rejectedTransactionHashes + rejectedTransactionHashes:(nonnull NSArray*)rejectedTransactionHashes peerSignatures:(nonnull NSArray>*)peerSignatures; @end diff --git a/IrohaCommunication/Classes/Private/Models/IRBlockImpl.m b/IrohaCommunication/Classes/Private/Models/IRBlockImpl.m index 3f5f16e98..763725642 100755 --- a/IrohaCommunication/Classes/Private/Models/IRBlockImpl.m +++ b/IrohaCommunication/Classes/Private/Models/IRBlockImpl.m @@ -14,10 +14,10 @@ @implementation IRBlock @synthesize peerSignatures = _peerSignatures; - (nonnull instancetype)initWithHeight:(UInt64)height - previousBlockHash:(nullable NSData*)previousBlockHash - createdAt:(nonnull NSDate*)createdAt + previousBlockHash:(nullable NSData *)previousBlockHash + createdAt:(nonnull NSDate *)createdAt transactions:(nonnull NSArray*)transactions - rejectedTransactionHashes:(nonnull NSArray*)rejectedTransactionHashes + rejectedTransactionHashes:(nonnull NSArray*)rejectedTransactionHashes peerSignatures:(nonnull NSArray>*)peerSignatures { if (self = [super init]) { _height = height; diff --git a/IrohaCommunication/Classes/Private/Models/IRCommand+Proto.h b/IrohaCommunication/Classes/Private/Models/IRCommand+Proto.h index 565e93a0e..060507149 100755 --- a/IrohaCommunication/Classes/Private/Models/IRCommand+Proto.h +++ b/IrohaCommunication/Classes/Private/Models/IRCommand+Proto.h @@ -15,6 +15,6 @@ typedef NS_ENUM(NSUInteger, IRCommandProtoFactoryError){ @interface IRCommandProtoFactory : NSObject + (nullable id)commandFromPbCommand:(nonnull Command*)command - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Private/Models/IRCommand+Proto.m b/IrohaCommunication/Classes/Private/Models/IRCommand+Proto.m index f55f065c3..f28c94516 100755 --- a/IrohaCommunication/Classes/Private/Models/IRCommand+Proto.m +++ b/IrohaCommunication/Classes/Private/Models/IRCommand+Proto.m @@ -11,7 +11,7 @@ @implementation IRCommandProtoFactory + (nullable id)commandFromPbCommand:(nonnull Command*)command - error:(NSError*_Nullable*_Nullable)error { + error:(NSError *_Nullable*_Nullable)error { switch (command.commandOneOfCase) { case Command_Command_OneOfCase_AddPeer: return [self addPeerCommandFromPbCommand:command.addPeer @@ -96,7 +96,7 @@ @implementation IRCommandProtoFactory } + (nullable id)addPeerCommandFromPbCommand:(nonnull AddPeer*)pbCommand - error:(NSError*_Nullable*_Nullable)error { + error:(NSError *_Nullable*_Nullable)error { id address = [IRAddressFactory addressWithValue:pbCommand.peer.address error:error]; @@ -129,7 +129,7 @@ @implementation IRCommandProtoFactory } + (nullable id)appendRoleCommandFromPbCommand:(nonnull AppendRole*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id accountId = [IRAccountIdFactory accountWithIdentifier:pbCommand.accountId error:error]; if (!accountId) { @@ -147,7 +147,7 @@ @implementation IRCommandProtoFactory roleName:roleName]; } -+ (nullable id)createRoleCommandFromPbCommand:(nonnull CreateRole*)pbCommand error:(NSError**)error { ++ (nullable id)createRoleCommandFromPbCommand:(nonnull CreateRole*)pbCommand error:(NSError **)error { id roleName = [IRRoleNameFactory roleWithName:pbCommand.roleName error:error]; @@ -172,7 +172,7 @@ @implementation IRCommandProtoFactory permissions:permissions]; } -+ (nullable id)detachRoleCommandFromPbCommand:(nonnull DetachRole*)pbCommand error:(NSError**)error { ++ (nullable id)detachRoleCommandFromPbCommand:(nonnull DetachRole*)pbCommand error:(NSError **)error { id accountId = [IRAccountIdFactory accountWithIdentifier:pbCommand.accountId error:error]; @@ -192,7 +192,7 @@ @implementation IRCommandProtoFactory } + (nullable id)createAssetCommandFromPbCommand:(nonnull CreateAsset*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id domain = [IRDomainFactory domainWithIdentitifer:pbCommand.domainId error:error]; @@ -214,7 +214,7 @@ @implementation IRCommandProtoFactory } + (nullable id)addSignatoryCommandFromPbCommand:(nonnull AddSignatory*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id accountId = [IRAccountIdFactory accountWithIdentifier:pbCommand.accountId error:error]; @@ -246,7 +246,7 @@ @implementation IRCommandProtoFactory publicKey:publicKey]; } -+ (nullable id)createDomainCommandFromPbCommand:(nonnull CreateDomain*)pbCommand error:(NSError**)error { ++ (nullable id)createDomainCommandFromPbCommand:(nonnull CreateDomain*)pbCommand error:(NSError **)error { id domain = [IRDomainFactory domainWithIdentitifer:pbCommand.domainId error:error]; @@ -269,7 +269,7 @@ @implementation IRCommandProtoFactory } + (nullable id)createAccountCommandFromPbCommand:(nonnull CreateAccount*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id domain = [IRDomainFactory domainWithIdentitifer:pbCommand.domainId error:error]; @@ -306,7 +306,7 @@ @implementation IRCommandProtoFactory } + (nullable id)transferAssetCommandWithPbCommand:(nonnull TransferAsset*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id sourceAccountId = [IRAccountIdFactory accountWithIdentifier:pbCommand.srcAccountId error:error]; @@ -345,7 +345,7 @@ @implementation IRCommandProtoFactory } + (nullable id)grantPermissionCommandFromPbCommand:(nonnull GrantPermission*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id accountId = [IRAccountIdFactory accountWithIdentifier:pbCommand.accountId error:error]; @@ -365,7 +365,7 @@ @implementation IRCommandProtoFactory } + (nullable id)removeSignatoryCommandFromPbCommand:(nonnull RemoveSignatory*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id accountId = [IRAccountIdFactory accountWithIdentifier:pbCommand.accountId error:error]; @@ -398,7 +398,7 @@ @implementation IRCommandProtoFactory } + (nullable id)addAssetQuantityCommandFromPbCommand:(nonnull AddAssetQuantity*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id assetId = [IRAssetIdFactory assetWithIdentifier:pbCommand.assetId error:error]; @@ -418,7 +418,7 @@ @implementation IRCommandProtoFactory amount:amount]; } -+ (nullable id)revokePermissionCommandFromPbCommand:(nonnull RevokePermission*)pbCommand error:(NSError**)error { ++ (nullable id)revokePermissionCommandFromPbCommand:(nonnull RevokePermission*)pbCommand error:(NSError **)error { id accountId = [IRAccountIdFactory accountWithIdentifier:pbCommand.accountId error:error]; @@ -438,7 +438,7 @@ @implementation IRCommandProtoFactory } + (nullable id)setAccountDetailCommandFromPbCommand:(nonnull SetAccountDetail*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id accountId = [IRAccountIdFactory accountWithIdentifier:pbCommand.accountId error:error]; @@ -453,7 +453,7 @@ @implementation IRCommandProtoFactory } + (nullable id)setAccountQuorumCommandPbCommand:(nonnull SetAccountQuorum*)pbCommand - error:(NSError**)error { + error:(NSError **)error { id accountId = [IRAccountIdFactory accountWithIdentifier:pbCommand.accountId error:error]; @@ -466,7 +466,7 @@ @implementation IRCommandProtoFactory quorum:pbCommand.quorum]; } -+ (nullable id)subtractAssetQuantityCommandFromPbCommand:(nonnull SubtractAssetQuantity*)pbCommand error:(NSError**)error { ++ (nullable id)subtractAssetQuantityCommandFromPbCommand:(nonnull SubtractAssetQuantity*)pbCommand error:(NSError **)error { id assetId = [IRAssetIdFactory assetWithIdentifier:pbCommand.assetId error:error]; @@ -524,7 +524,7 @@ @implementation IRCommandProtoFactory oldValue:pbCommand.oldValue]; } -+ (nullable id)createPublicKeyFromRawData:(nonnull NSData*)rawData error:(NSError**)error { ++ (nullable id)createPublicKeyFromRawData:(nonnull NSData *)rawData error:(NSError **)error { id publicKey = [[IREd25519PublicKey alloc] initWithRawData:rawData]; if (!publicKey) { diff --git a/IrohaCommunication/Classes/Private/Models/IRPeerSignature+Proto.h b/IrohaCommunication/Classes/Private/Models/IRPeerSignature+Proto.h index 4171f9a64..46d50c3e7 100755 --- a/IrohaCommunication/Classes/Private/Models/IRPeerSignature+Proto.h +++ b/IrohaCommunication/Classes/Private/Models/IRPeerSignature+Proto.h @@ -14,6 +14,6 @@ typedef NS_ENUM(NSUInteger, IRPeerSignatureFactoryProtoError) { @interface IRPeerSignatureFactory (Proto) + (nullable id)peerSignatureFromPbSignature:(nonnull Signature *)pbSignature - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Private/Models/IRPeerSignature+Proto.m b/IrohaCommunication/Classes/Private/Models/IRPeerSignature+Proto.m index 3870e541c..4e6a2af6a 100755 --- a/IrohaCommunication/Classes/Private/Models/IRPeerSignature+Proto.m +++ b/IrohaCommunication/Classes/Private/Models/IRPeerSignature+Proto.m @@ -10,7 +10,7 @@ @implementation IRPeerSignatureFactory (Proto) + (nullable id)peerSignatureFromPbSignature:(nonnull Signature *)pbSignature - error:(NSError*_Nullable*_Nullable)error { + error:(NSError *_Nullable*_Nullable)error { NSData *rawSignature = [[NSData alloc] initWithHexString:pbSignature.signature]; if (!rawSignature) { diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetAccount.m b/IrohaCommunication/Classes/Private/Queries/IRGetAccount.m index e69035713..bbd9fe5f1 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetAccount.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetAccount.m @@ -19,7 +19,7 @@ - (nonnull instancetype)initWithAccountId:(nonnull id)accountId { #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetAccount *query = [[GetAccount alloc] init]; query.accountId = [_accountId identifier]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetAccountAssetTransactions.m b/IrohaCommunication/Classes/Private/Queries/IRGetAccountAssetTransactions.m index 2211abd17..0067413be 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetAccountAssetTransactions.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetAccountAssetTransactions.m @@ -26,7 +26,7 @@ - (nonnull instancetype)initWithAccountId:(nonnull id)accountId #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetAccountAssetTransactions *query = [[GetAccountAssetTransactions alloc] init]; query.accountId = [_accountId identifier]; query.assetId = [_assetId identifier]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetAccountAssets.m b/IrohaCommunication/Classes/Private/Queries/IRGetAccountAssets.m index 355090d06..cc35f74b5 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetAccountAssets.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetAccountAssets.m @@ -22,7 +22,7 @@ - (nonnull instancetype)initWithAccountId:(nonnull id)accountId #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetAccountAssets *query = [[GetAccountAssets alloc] init]; query.accountId = [_accountId identifier]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetAccountDetail.h b/IrohaCommunication/Classes/Private/Queries/IRGetAccountDetail.h index ae8f8d973..98bac944a 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetAccountDetail.h +++ b/IrohaCommunication/Classes/Private/Queries/IRGetAccountDetail.h @@ -11,7 +11,7 @@ - (nonnull instancetype)initWithAccountId:(nullable id)accountId writer:(nullable id)writer - key:(nullable NSString*)key; + key:(nullable NSString *)key; - (nonnull instancetype)initWithPagination:(nonnull id)pagination; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetAccountDetail.m b/IrohaCommunication/Classes/Private/Queries/IRGetAccountDetail.m index 109f836f6..cc2a1ad70 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetAccountDetail.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetAccountDetail.m @@ -16,7 +16,7 @@ @implementation IRGetAccountDetail - (nonnull instancetype)initWithAccountId:(nullable id)accountId writer:(nullable id)writer - key:(nullable NSString*)key { + key:(nullable NSString *)key { if (self = [super init]) { _accountId = accountId; _writer = writer; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetAccountTransactions.m b/IrohaCommunication/Classes/Private/Queries/IRGetAccountTransactions.m index 0dc40d661..0e86d354e 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetAccountTransactions.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetAccountTransactions.m @@ -23,7 +23,7 @@ - (nonnull instancetype)initWithAccountId:(nonnull id)accountId #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetAccountTransactions *query = [[GetAccountTransactions alloc] init]; query.accountId = [_accountId identifier]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetAssetInfo.m b/IrohaCommunication/Classes/Private/Queries/IRGetAssetInfo.m index bfe487448..ad8677ade 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetAssetInfo.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetAssetInfo.m @@ -19,7 +19,7 @@ - (nonnull instancetype)initWithAssetId:(nonnull id)assetId { #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetAssetInfo *query = [[GetAssetInfo alloc] init]; query.assetId = [_assetId identifier]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetPeers.m b/IrohaCommunication/Classes/Private/Queries/IRGetPeers.m index 63db0279a..76b8405d7 100644 --- a/IrohaCommunication/Classes/Private/Queries/IRGetPeers.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetPeers.m @@ -11,7 +11,7 @@ @implementation IRGetPeers #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetPeers *query = [GetPeers new]; Query_Payload *payload = [[Query_Payload alloc] init]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetPendingTransactions.m b/IrohaCommunication/Classes/Private/Queries/IRGetPendingTransactions.m index 17a2b4309..3636bc364 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetPendingTransactions.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetPendingTransactions.m @@ -10,7 +10,7 @@ @implementation IRGetPendingTransactions #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetPendingTransactions *query = [[GetPendingTransactions alloc] init]; Query_Payload *payload = [[Query_Payload alloc] init]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetRolePermissions.m b/IrohaCommunication/Classes/Private/Queries/IRGetRolePermissions.m index 6d12521ab..9fd8304d8 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetRolePermissions.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetRolePermissions.m @@ -19,7 +19,7 @@ - (nonnull instancetype)initWithRoleName:(nonnull id)roleName { #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetRolePermissions *query = [[GetRolePermissions alloc] init]; query.roleId = [_roleName value]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetRoles.m b/IrohaCommunication/Classes/Private/Queries/IRGetRoles.m index d6547098c..7fab0df48 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetRoles.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetRoles.m @@ -10,7 +10,7 @@ @implementation IRGetRoles #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetRoles *query = [[GetRoles alloc] init]; Query_Payload *payload = [[Query_Payload alloc] init]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetSignatories.m b/IrohaCommunication/Classes/Private/Queries/IRGetSignatories.m index bb82416a9..8c0160d3b 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetSignatories.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetSignatories.m @@ -19,7 +19,7 @@ - (nonnull instancetype)initWithAccountId:(nonnull id)accountId { #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetSignatories *query = [[GetSignatories alloc] init]; query.accountId = [_accountId identifier]; diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetTransactions.h b/IrohaCommunication/Classes/Private/Queries/IRGetTransactions.h index e1e76dff8..b1620b6dd 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetTransactions.h +++ b/IrohaCommunication/Classes/Private/Queries/IRGetTransactions.h @@ -9,6 +9,6 @@ @interface IRGetTransactions : NSObject -- (nonnull instancetype)initWithTransactionHashes:(nonnull NSArray *)hashes; +- (nonnull instancetype)initWithTransactionHashes:(nonnull NSArray *)hashes; @end diff --git a/IrohaCommunication/Classes/Private/Queries/IRGetTransactions.m b/IrohaCommunication/Classes/Private/Queries/IRGetTransactions.m index 2c936bf6e..0ac6622e1 100755 --- a/IrohaCommunication/Classes/Private/Queries/IRGetTransactions.m +++ b/IrohaCommunication/Classes/Private/Queries/IRGetTransactions.m @@ -10,7 +10,7 @@ @implementation IRGetTransactions @synthesize transactionHashes = _transactionHashes; -- (nonnull instancetype)initWithTransactionHashes:(nonnull NSArray *)hashes { +- (nonnull instancetype)initWithTransactionHashes:(nonnull NSArray *)hashes { if (self = [super init]) { _transactionHashes = hashes; } @@ -20,10 +20,10 @@ - (nonnull instancetype)initWithTransactionHashes:(nonnull NSArray *)ha #pragma mark - Protobuf Transformable -- (nullable id)transform:(NSError**)error { +- (nullable id)transform:(NSError **)error { GetTransactions *query = [[GetTransactions alloc] init]; - NSMutableArray *pbHashes = [NSMutableArray array]; + NSMutableArray *pbHashes = [NSMutableArray array]; for (NSData *transactionHash in _transactionHashes) { [pbHashes addObject:[transactionHash toHexString]]; diff --git a/IrohaCommunication/Classes/Private/Responses/IRAccountAssetsResponse.h b/IrohaCommunication/Classes/Private/Responses/IRAccountAssetsResponse.h index a44687423..b5cbe3b22 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRAccountAssetsResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRAccountAssetsResponse.h @@ -11,6 +11,6 @@ - (nonnull instancetype)initWithAccountAssets:(nonnull NSArray>*)accountAssets totalCount:(UInt32)totalCount nextAssetId:(nullable id)assetId - queryHash:(nonnull NSData*)queryHash; + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRAccountAssetsResponse.m b/IrohaCommunication/Classes/Private/Responses/IRAccountAssetsResponse.m index 7b4bf10f7..99f456ea7 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRAccountAssetsResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRAccountAssetsResponse.m @@ -15,7 +15,7 @@ @implementation IRAccountAssetsResponse - (nonnull instancetype)initWithAccountAssets:(nonnull NSArray>*)accountAssets totalCount:(UInt32)totalCount nextAssetId:(nullable id)assetId - queryHash:(nonnull NSData*)queryHash { + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _accountAssets = accountAssets; _totalCount = totalCount; diff --git a/IrohaCommunication/Classes/Private/Responses/IRAccountDetailResponse.h b/IrohaCommunication/Classes/Private/Responses/IRAccountDetailResponse.h index c3bfea1df..f04095f66 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRAccountDetailResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRAccountDetailResponse.h @@ -9,9 +9,9 @@ @interface IRAccountDetailResponse : NSObject -- (nonnull instancetype)initWithDetail:(nonnull NSString*)detail +- (nonnull instancetype)initWithDetail:(nonnull NSString *)detail totalCount:(UInt64)totalCount nextRecordId:(nullable id)nextRecordId - queryHash:(nonnull NSData*)queryHash; + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRAccountDetailResponse.m b/IrohaCommunication/Classes/Private/Responses/IRAccountDetailResponse.m index 3b54d7977..440459b38 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRAccountDetailResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRAccountDetailResponse.m @@ -12,10 +12,10 @@ @implementation IRAccountDetailResponse @synthesize totalCount = _totalCount; @synthesize nextRecordId = _nextRecordId; -- (nonnull instancetype)initWithDetail:(nonnull NSString*)detail +- (nonnull instancetype)initWithDetail:(nonnull NSString *)detail totalCount:(UInt64)totalCount nextRecordId:(nullable id)nextRecordId - queryHash:(nonnull NSData*)queryHash { + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _detail = detail; _totalCount = totalCount; diff --git a/IrohaCommunication/Classes/Private/Responses/IRAccountResponse.h b/IrohaCommunication/Classes/Private/Responses/IRAccountResponse.h index 0e1f35bc7..effbae4b1 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRAccountResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRAccountResponse.h @@ -10,8 +10,8 @@ - (nonnull instancetype)initWithAccountId:(nonnull id)accountId quorum:(UInt32)quorum - details:(nullable NSString*)details + details:(nullable NSString *)details roles:(nonnull NSArray>*)roles - queryHash:(nonnull NSData*)queryHash; + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRAccountResponse.m b/IrohaCommunication/Classes/Private/Responses/IRAccountResponse.m index 0d70d1280..1ecb67b67 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRAccountResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRAccountResponse.m @@ -14,9 +14,9 @@ @implementation IRAccountResponse - (nonnull instancetype)initWithAccountId:(nonnull id)accountId quorum:(UInt32)quorum - details:(nullable NSString*)details + details:(nullable NSString *)details roles:(nonnull NSArray>*)roles - queryHash:(nonnull NSData*)queryHash { + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _accountId = accountId; diff --git a/IrohaCommunication/Classes/Private/Responses/IRAssetResponse.h b/IrohaCommunication/Classes/Private/Responses/IRAssetResponse.h index ee44b3aa6..775f7cd8d 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRAssetResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRAssetResponse.h @@ -10,6 +10,6 @@ - (nonnull instancetype)initWithAssetId:(nonnull id)assetId precision:(UInt32)precision - queryHash:(nonnull NSData*)queryHash; + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRAssetResponse.m b/IrohaCommunication/Classes/Private/Responses/IRAssetResponse.m index 68cd8527b..76ff1917d 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRAssetResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRAssetResponse.m @@ -12,7 +12,7 @@ @implementation IRAssetResponse - (nonnull instancetype)initWithAssetId:(nonnull id)assetId precision:(UInt32)precision - queryHash:(nonnull NSData*)queryHash { + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _assetId = assetId; diff --git a/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponse+Proto.h b/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponse+Proto.h index 57c669494..d20467a63 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponse+Proto.h +++ b/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponse+Proto.h @@ -14,6 +14,6 @@ typedef NS_ENUM(NSUInteger, IRBlockQueryResponseProtoError) { @interface IRBlockQueryResponse (Proto) + (nullable IRBlockQueryResponse*)responseFromPbResponse:(nonnull BlockQueryResponse*)queryResponse - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponse+Proto.m b/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponse+Proto.m index 764e04364..9e9b18430 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponse+Proto.m +++ b/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponse+Proto.m @@ -10,7 +10,7 @@ @implementation IRBlockQueryResponse (Proto) + (nullable IRBlockQueryResponse*)responseFromPbResponse:(nonnull BlockQueryResponse*)queryResponse - error:(NSError*_Nullable*_Nullable)error { + error:(NSError *_Nullable*_Nullable)error { if (queryResponse.responseOneOfCase == BlockQueryResponse_Response_OneOfCase_BlockResponse) { Block *pbBlock = queryResponse.blockResponse.block; if (!pbBlock) { @@ -42,7 +42,7 @@ + (nullable IRBlockQueryResponse*)responseFromPbResponse:(nonnull BlockQueryResp #pragma mark - Helper -+ (nonnull NSError*)errorWithMessage:(NSString*)message { ++ (nonnull NSError *)errorWithMessage:(NSString *)message { return [NSError errorWithDomain:NSStringFromClass([IRBlockQueryResponse class]) code:IRBlockQueryResponseProtoErrorInvalidField userInfo:@{NSLocalizedDescriptionKey: message}]; diff --git a/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponseImpl.h b/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponseImpl.h index d7e0277e6..5ae67438f 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponseImpl.h +++ b/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponseImpl.h @@ -9,6 +9,6 @@ @interface IRBlockQueryResponse : NSObject - (nonnull instancetype)initWithBlock:(nonnull id)block; -- (nonnull instancetype)initWithError:(nonnull NSError*)error; +- (nonnull instancetype)initWithError:(nonnull NSError *)error; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponseImpl.m b/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponseImpl.m index b75ad77e9..44bf6741f 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponseImpl.m +++ b/IrohaCommunication/Classes/Private/Responses/IRBlockQueryResponseImpl.m @@ -17,7 +17,7 @@ - (nonnull instancetype)initWithBlock:(nonnull id)block { return self; } -- (nonnull instancetype)initWithError:(nonnull NSError*)error { +- (nonnull instancetype)initWithError:(nonnull NSError *)error { if (self = [super init]) { _error = error; } diff --git a/IrohaCommunication/Classes/Private/Responses/IRErrorResponse.h b/IrohaCommunication/Classes/Private/Responses/IRErrorResponse.h index 322d77608..10f13d965 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRErrorResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRErrorResponse.h @@ -9,8 +9,8 @@ @interface IRErrorResponse : NSObject - (nonnull instancetype)initWithReason:(IRErrorResponseReason)reason - message:(nonnull NSString*)message + message:(nonnull NSString *)message code:(UInt32)code - queryHash:(nonnull NSData*)queryHash; + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRErrorResponse.m b/IrohaCommunication/Classes/Private/Responses/IRErrorResponse.m index b8f77e04e..0ab0feb49 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRErrorResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRErrorResponse.m @@ -12,9 +12,9 @@ @implementation IRErrorResponse @synthesize queryHash = _queryHash; - (nonnull instancetype)initWithReason:(IRErrorResponseReason)reason - message:(nonnull NSString*)message + message:(nonnull NSString *)message code:(UInt32)code - queryHash:(nonnull NSData*)queryHash { + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _reason = reason; diff --git a/IrohaCommunication/Classes/Private/Responses/IRPeersResponse.h b/IrohaCommunication/Classes/Private/Responses/IRPeersResponse.h index 66cd8df7c..d3368cd0f 100644 --- a/IrohaCommunication/Classes/Private/Responses/IRPeersResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRPeersResponse.h @@ -10,6 +10,6 @@ @interface IRPeersResponse : NSObject -- (nonnull instancetype)initWithPeers:(nonnull NSArray>*)peers queryHash:(nonnull NSData*)queryHash; +- (nonnull instancetype)initWithPeers:(nonnull NSArray>*)peers queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRRolePermissionsResponse.h b/IrohaCommunication/Classes/Private/Responses/IRRolePermissionsResponse.h index ab60794ee..1345620a1 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRRolePermissionsResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRRolePermissionsResponse.h @@ -9,6 +9,6 @@ @interface IRRolePermissionsResponse : NSObject - (nonnull instancetype)initWithPermissions:(nonnull NSArray>*)permissions - queryHash:(nonnull NSData*)queryHash; + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRRolePermissionsResponse.m b/IrohaCommunication/Classes/Private/Responses/IRRolePermissionsResponse.m index c287fbcb8..5f893b827 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRRolePermissionsResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRRolePermissionsResponse.m @@ -10,7 +10,7 @@ @implementation IRRolePermissionsResponse @synthesize queryHash = _queryHash; - (nonnull instancetype)initWithPermissions:(nonnull NSArray>*)permissions - queryHash:(nonnull NSData*)queryHash { + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _permissions = permissions; _queryHash = queryHash; diff --git a/IrohaCommunication/Classes/Private/Responses/IRRolesResponse.h b/IrohaCommunication/Classes/Private/Responses/IRRolesResponse.h index c01844da3..06a996ceb 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRRolesResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRRolesResponse.h @@ -9,6 +9,6 @@ @interface IRRolesResponse : NSObject - (nonnull instancetype)initWithRoles:(nonnull NSArray>*)roles - queryHash:(nonnull NSData*)queryHash; + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRRolesResponse.m b/IrohaCommunication/Classes/Private/Responses/IRRolesResponse.m index f3d832710..b85659b52 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRRolesResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRRolesResponse.m @@ -10,7 +10,7 @@ @implementation IRRolesResponse @synthesize queryHash = _queryHash; - (nonnull instancetype)initWithRoles:(nonnull NSArray>*)roles - queryHash:(nonnull NSData*)queryHash { + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _roles = roles; _queryHash = queryHash; diff --git a/IrohaCommunication/Classes/Private/Responses/IRSignatoriesResponse.h b/IrohaCommunication/Classes/Private/Responses/IRSignatoriesResponse.h index e92eb6a29..d71011b45 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRSignatoriesResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRSignatoriesResponse.h @@ -9,6 +9,6 @@ @interface IRSignatoriesResponse : NSObject - (nonnull instancetype)initWithPublicKeys:(nonnull NSArray>*)publicKeys - queryHash:(nonnull NSData*)queryHash; + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRSignatoriesResponse.m b/IrohaCommunication/Classes/Private/Responses/IRSignatoriesResponse.m index 1f46d0aaa..c119913cb 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRSignatoriesResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRSignatoriesResponse.m @@ -10,7 +10,7 @@ @implementation IRSignatoriesResponse @synthesize queryHash = _queryHash; - (nonnull instancetype)initWithPublicKeys:(nonnull NSArray>*)publicKeys - queryHash:(nonnull NSData*)queryHash { + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _publicKeys = publicKeys; _queryHash = queryHash; diff --git a/IrohaCommunication/Classes/Private/Responses/IRTransactionsPageResponse.h b/IrohaCommunication/Classes/Private/Responses/IRTransactionsPageResponse.h index c5ca222b2..c87f65097 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRTransactionsPageResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRTransactionsPageResponse.h @@ -10,7 +10,7 @@ - (nonnull instancetype)initWithTransactions:(nonnull NSArray>*)transactions totalCount:(UInt32)totalCount - nextTransactionHash:(nullable NSData*)nextTransactionHash - queryHash:(nonnull NSData*)queryHash; + nextTransactionHash:(nullable NSData *)nextTransactionHash + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRTransactionsPageResponse.m b/IrohaCommunication/Classes/Private/Responses/IRTransactionsPageResponse.m index 10f5d3f01..770274867 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRTransactionsPageResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRTransactionsPageResponse.m @@ -13,8 +13,8 @@ @implementation IRTransactionsPageResponse - (nonnull instancetype)initWithTransactions:(nonnull NSArray>*)transactions totalCount:(UInt32)totalCount - nextTransactionHash:(nullable NSData*)nextTransactionHash - queryHash:(nonnull NSData*)queryHash { + nextTransactionHash:(nullable NSData *)nextTransactionHash + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _transactions = transactions; diff --git a/IrohaCommunication/Classes/Private/Responses/IRTransactionsResponse.h b/IrohaCommunication/Classes/Private/Responses/IRTransactionsResponse.h index f1518ef35..668da4dad 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRTransactionsResponse.h +++ b/IrohaCommunication/Classes/Private/Responses/IRTransactionsResponse.h @@ -9,6 +9,6 @@ @interface IRTransactionsResponse : NSObject - (nonnull instancetype)initWithTransactions:(nonnull NSArray>*)transactions - queryHash:(nonnull NSData*)queryHash; + queryHash:(nonnull NSData *)queryHash; @end diff --git a/IrohaCommunication/Classes/Private/Responses/IRTransactionsResponse.m b/IrohaCommunication/Classes/Private/Responses/IRTransactionsResponse.m index f32826282..ab6c74dea 100755 --- a/IrohaCommunication/Classes/Private/Responses/IRTransactionsResponse.m +++ b/IrohaCommunication/Classes/Private/Responses/IRTransactionsResponse.m @@ -10,7 +10,7 @@ @implementation IRTransactionsResponse @synthesize queryHash = _queryHash; - (nonnull instancetype)initWithTransactions:(nonnull NSArray>*)transactions - queryHash:(nonnull NSData*)queryHash { + queryHash:(nonnull NSData *)queryHash { if (self = [super init]) { _transactions = transactions; diff --git a/IrohaCommunication/Classes/Public/Builder/IRBlockQueryBuilder.h b/IrohaCommunication/Classes/Public/Builder/IRBlockQueryBuilder.h index e8096af98..b656e33a0 100755 --- a/IrohaCommunication/Classes/Public/Builder/IRBlockQueryBuilder.h +++ b/IrohaCommunication/Classes/Public/Builder/IRBlockQueryBuilder.h @@ -9,9 +9,9 @@ @protocol IRBlockQueryBuilderProtocol - (nonnull instancetype)withCreatorAccountId:(nonnull id)creatorAccountId; -- (nonnull instancetype)withCreatedDate:(nonnull NSDate*)date; +- (nonnull instancetype)withCreatedDate:(nonnull NSDate *)date; - (nonnull instancetype)withQueryCounter:(UInt64)queryCounter; -- (nullable id)build:(NSError*_Nullable*_Nullable)error; +- (nullable id)build:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Builder/IRBlockQueryBuilder.m b/IrohaCommunication/Classes/Public/Builder/IRBlockQueryBuilder.m index a89460508..454bbe0b9 100755 --- a/IrohaCommunication/Classes/Public/Builder/IRBlockQueryBuilder.m +++ b/IrohaCommunication/Classes/Public/Builder/IRBlockQueryBuilder.m @@ -10,9 +10,9 @@ @interface IRBlockQueryBuilder() -@property(strong, nonatomic)id _Nullable creator; -@property(strong, nonatomic)NSDate* _Nullable createdAt; -@property(nonatomic, readwrite)UInt64 queryCounter; +@property (nonatomic, strong) id _Nullable creator; +@property (nonatomic, strong) NSDate * _Nullable createdAt; +@property (nonatomic, readwrite) UInt64 queryCounter; @end @@ -40,7 +40,7 @@ - (nonnull instancetype)withCreatorAccountId:(nonnull id)creatorAcc return self; } -- (nonnull instancetype)withCreatedDate:(nonnull NSDate*)date { +- (nonnull instancetype)withCreatedDate:(nonnull NSDate *)date { _createdAt = date; return self; @@ -52,7 +52,7 @@ - (nonnull instancetype)withQueryCounter:(UInt64)queryCounter { return self; } -- (nullable id)build:(NSError*_Nullable*_Nullable)error { +- (nullable id)build:(NSError *_Nullable*_Nullable)error { if (!_creator) { if (error) { NSString *message = @"Creator's account id is required!"; diff --git a/IrohaCommunication/Classes/Public/Builder/IRQueryBuilder.h b/IrohaCommunication/Classes/Public/Builder/IRQueryBuilder.h index 64cde0d40..4bba073d7 100755 --- a/IrohaCommunication/Classes/Public/Builder/IRQueryBuilder.h +++ b/IrohaCommunication/Classes/Public/Builder/IRQueryBuilder.h @@ -11,10 +11,10 @@ @protocol IRQueryBuilderProtocol - (nonnull instancetype)withCreatorAccountId:(nonnull id)creatorAccountId; -- (nonnull instancetype)withCreatedDate:(nonnull NSDate*)date; +- (nonnull instancetype)withCreatedDate:(nonnull NSDate *)date; - (nonnull instancetype)withQueryCounter:(UInt64)queryCounter; - (nonnull instancetype)withQuery:(nonnull id)query; -- (nullable id)build:(NSError*_Nullable*_Nullable)error; +- (nullable id)build:(NSError *_Nullable*_Nullable)error; @end @@ -38,7 +38,7 @@ typedef NS_ENUM(NSUInteger, IRQueryBuilderError) { assetId:(nonnull id)assetId pagination:(nullable id)pagination; -- (nonnull instancetype)getTransactions:(nonnull NSArray*)hashes; +- (nonnull instancetype)getTransactions:(nonnull NSArray*)hashes; - (nonnull instancetype)getAccountAssets:(nonnull id)accountId DEPRECATED_MSG_ATTRIBUTE("use getAccountAsset:pagination:"); @@ -47,7 +47,7 @@ typedef NS_ENUM(NSUInteger, IRQueryBuilderError) { - (nonnull instancetype)getAccountDetail:(nullable id)accountId writer:(nullable id)writer - key:(nullable NSString*)key; + key:(nullable NSString *)key; - (nonnull instancetype)getAccountDetailWithPagination:(nonnull id)pagination; diff --git a/IrohaCommunication/Classes/Public/Builder/IRQueryBuilder.m b/IrohaCommunication/Classes/Public/Builder/IRQueryBuilder.m index 9fd6a6c15..dce87ba0f 100755 --- a/IrohaCommunication/Classes/Public/Builder/IRQueryBuilder.m +++ b/IrohaCommunication/Classes/Public/Builder/IRQueryBuilder.m @@ -11,10 +11,10 @@ @interface IRQueryBuilder() -@property(strong, nonatomic)id _Nullable creator; -@property(strong, nonatomic)NSDate* _Nullable createdAt; -@property(strong, nonatomic)id _Nullable query; -@property(nonatomic, readwrite)UInt64 queryCounter; +@property (nonatomic, strong) id _Nullable creator; +@property (nonatomic, strong) NSDate * _Nullable createdAt; +@property (nonatomic, strong) id _Nullable query; +@property (nonatomic, readwrite) UInt64 queryCounter; @end @@ -66,7 +66,7 @@ - (nonnull instancetype)getAccountAssetTransactions:(nonnull id)acc return [self withQuery:query]; } -- (nonnull instancetype)getTransactions:(nonnull NSArray*)hashes { +- (nonnull instancetype)getTransactions:(nonnull NSArray*)hashes { id query = [[IRGetTransactions alloc] initWithTransactionHashes:hashes]; return [self withQuery:query]; @@ -86,7 +86,7 @@ - (nonnull instancetype)getAccountAssets:(nonnull id)accountId - (nonnull instancetype)getAccountDetail:(nullable id)accountId writer:(nullable id)writer - key:(nullable NSString*)key { + key:(nullable NSString *)key { id record = [IRAccountDetailRecordIdFactory accountDetailRecordIdWithWriter:writer key:key]; id pagination = [IRAccountDetailPaginationFactory accountDetailPagination:1 @@ -139,7 +139,7 @@ - (nonnull instancetype)withCreatorAccountId:(nonnull id)creatorAcc return self; } -- (nonnull instancetype)withCreatedDate:(nonnull NSDate*)date { +- (nonnull instancetype)withCreatedDate:(nonnull NSDate *)date { _createdAt = date; return self; @@ -157,7 +157,7 @@ - (nonnull instancetype)withQuery:(nonnull id)query { return self; } -- (nullable id)build:(NSError*_Nullable*_Nullable)error { +- (nullable id)build:(NSError *_Nullable*_Nullable)error { if (!_creator) { if (error) { NSString *message = @"Creator's account id is required!"; diff --git a/IrohaCommunication/Classes/Public/Builder/IRTransactionBuilder.h b/IrohaCommunication/Classes/Public/Builder/IRTransactionBuilder.h index d49b40b2e..8e0b24843 100755 --- a/IrohaCommunication/Classes/Public/Builder/IRTransactionBuilder.h +++ b/IrohaCommunication/Classes/Public/Builder/IRTransactionBuilder.h @@ -12,10 +12,10 @@ @protocol IRTransactionBuilderProtocol - (nonnull instancetype)withCreatorAccountId:(nonnull id)creatorAccountId; -- (nonnull instancetype)withCreatedDate:(nonnull NSDate*)date; +- (nonnull instancetype)withCreatedDate:(nonnull NSDate *)date; - (nonnull instancetype)withQuorum:(NSUInteger)quorum; - (nonnull instancetype)addCommand:(nonnull id)command; -- (nullable id)build:(NSError*_Nullable*_Nullable)error; +- (nullable id)build:(NSError *_Nullable*_Nullable)error; @end @@ -67,8 +67,8 @@ typedef NS_ENUM(NSUInteger, IRTransactionBuilderError) { permission:(nonnull id)grantablePermission; - (nonnull instancetype)setAccountDetail:(nonnull id)accountId - key:(nonnull NSString*)key - value:(nonnull NSString*)value; + key:(nonnull NSString *)key + value:(nonnull NSString *)value; - (nonnull instancetype)setAccountQuorum:(nonnull id)accountId quorum:(UInt32)quorum; @@ -76,7 +76,7 @@ typedef NS_ENUM(NSUInteger, IRTransactionBuilderError) { - (nonnull instancetype)transferAsset:(nonnull id)sourceAccountId destinationAccount:(nonnull id)destinationAccountId assetId:(nonnull id)assetId - description:(nonnull NSString*)transferDescription + description:(nonnull NSString *)transferDescription amount:(nonnull id)amount; - (nonnull instancetype)removePeer:(nonnull id)peerKey; diff --git a/IrohaCommunication/Classes/Public/Builder/IRTransactionBuilder.m b/IrohaCommunication/Classes/Public/Builder/IRTransactionBuilder.m index 6d7e7ca40..a02f195ab 100755 --- a/IrohaCommunication/Classes/Public/Builder/IRTransactionBuilder.m +++ b/IrohaCommunication/Classes/Public/Builder/IRTransactionBuilder.m @@ -9,15 +9,17 @@ static const NSUInteger DEFAULT_QUORUM = 1; -@interface IRTransactionBuilder() -@property(strong, nonatomic)id accountId; -@property(strong, readwrite)NSDate *date; -@property(nonatomic, readwrite)NSUInteger quorum; -@property(strong, nonatomic)NSMutableArray> *commands; +@interface IRTransactionBuilder () + +@property (nonatomic, strong) id accountId; +@property (strong, readwrite) NSDate *date; +@property (nonatomic, readwrite) NSUInteger quorum; +@property (nonatomic, strong) NSMutableArray> *commands; @end + @implementation IRTransactionBuilder #pragma mark - Initialization @@ -183,8 +185,8 @@ - (nonnull instancetype)revokePermission:(nonnull id)accountId } - (nonnull instancetype)setAccountDetail:(nonnull id)accountId - key:(nonnull NSString*)key - value:(nonnull NSString*)value { + key:(nonnull NSString *)key + value:(nonnull NSString *)value { IRSetAccountDetail *command = [[IRSetAccountDetail alloc] initWithAccountId:accountId key:key @@ -209,7 +211,7 @@ - (nonnull instancetype)setAccountQuorum:(nonnull id)accountId - (nonnull instancetype)transferAsset:(nonnull id)sourceAccountId destinationAccount:(nonnull id)destinationAccountId assetId:(nonnull id)assetId - description:(nonnull NSString*)transferDescription + description:(nonnull NSString *)transferDescription amount:(nonnull id)amount { IRTransferAsset *command = [[IRTransferAsset alloc] initWithSourceAccountId:sourceAccountId @@ -251,7 +253,7 @@ - (nonnull instancetype)withCreatorAccountId:(nonnull id)creatorAcc return self; } -- (nonnull instancetype)withCreatedDate:(nonnull NSDate*)date { +- (nonnull instancetype)withCreatedDate:(nonnull NSDate *)date { _date = date; return self; @@ -269,7 +271,7 @@ - (nonnull instancetype)addCommand:(nonnull id)command { return self; } -- (nullable id)build:(NSError*_Nullable*_Nullable)error { +- (nullable id)build:(NSError *_Nullable*_Nullable)error { if (!_accountId) { if (error) { NSString *message = @"Creator's account id is required!"; diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAccountAsset.h b/IrohaCommunication/Classes/Public/Model/Common/IRAccountAsset.h index 732366356..966970482 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAccountAsset.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAccountAsset.h @@ -10,9 +10,9 @@ @protocol IRAccountAsset -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nonnull assetId; -@property(nonatomic, readonly)id _Nonnull balance; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull assetId; +@property (nonatomic, readonly) id _Nonnull balance; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAccountDetailPagination.h b/IrohaCommunication/Classes/Public/Model/Common/IRAccountDetailPagination.h index f4c19595a..761b5a1f5 100644 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAccountDetailPagination.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAccountDetailPagination.h @@ -9,8 +9,8 @@ @protocol IRAccountDetailPagination -@property(nonatomic, readonly)UInt32 pageSize; -@property(nonatomic, readonly)id nextRecordId; +@property (nonatomic, readonly) UInt32 pageSize; +@property (nonatomic, readonly, nullable) id nextRecordId; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAccountDetailRecordId.h b/IrohaCommunication/Classes/Public/Model/Common/IRAccountDetailRecordId.h index 5c07541dc..40ff19af3 100644 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAccountDetailRecordId.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAccountDetailRecordId.h @@ -8,8 +8,8 @@ @protocol IRAccountDetailRecordId -@property(nonatomic, readonly)NSString * _Nonnull writer; -@property(nonatomic, readonly)NSString * _Nonnull key; +@property (nonatomic, readonly) NSString * _Nonnull writer; +@property (nonatomic, readonly) NSString * _Nonnull key; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAccountId.h b/IrohaCommunication/Classes/Public/Model/Common/IRAccountId.h index d28abeeeb..887005fd3 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAccountId.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAccountId.h @@ -8,10 +8,10 @@ @protocol IRAccountId -@property(nonatomic, readonly)NSString * _Nonnull name; -@property(nonatomic, readonly)id _Nonnull domain; +@property (nonatomic, readonly) NSString * _Nonnull name; +@property (nonatomic, readonly) id _Nonnull domain; -- (nonnull NSString*)identifier; +- (nonnull NSString *)identifier; @end @@ -22,12 +22,12 @@ typedef NS_ENUM(NSUInteger, IRAccountIdFactoryError) { @protocol IRAccountIdFactoryProtocol -+ (nullable id)accountIdWithName:(nonnull NSString*)name ++ (nullable id)accountIdWithName:(nonnull NSString *)name domain:(nonnull id)domain - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; -+ (nullable id)accountWithIdentifier:(nonnull NSString*)accountId - error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)accountWithIdentifier:(nonnull NSString *)accountId + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAccountId.m b/IrohaCommunication/Classes/Public/Model/Common/IRAccountId.m index 6e5d74820..5e74794f9 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAccountId.m +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAccountId.m @@ -64,7 +64,7 @@ @implementation IRAccountIdFactory + (nullable id)accountWithIdentifier:(nonnull NSString *)accountId error:(NSError *_Nullable*_Nullable)error { - NSArray *components = [accountId componentsSeparatedByString:ACCOUNT_SEPARATOR]; + NSArray *components = [accountId componentsSeparatedByString:ACCOUNT_SEPARATOR]; if ([components count] != 2) { if (error) { diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAddress.h b/IrohaCommunication/Classes/Public/Model/Common/IRAddress.h index aada79d3c..d3fff5b83 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAddress.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAddress.h @@ -7,7 +7,7 @@ @protocol IRAddress -@property(nonatomic, readonly)NSString * _Nonnull value; +@property (nonatomic, readonly) NSString * _Nonnull value; @end @@ -20,9 +20,9 @@ typedef NS_ENUM(NSUInteger, IRAddressError) { @protocol IRAddressFactoryProtocol -+ (nullable id)addressWithIp:(nonnull NSString*)ipV4 port:(nonnull NSString*)port error:(NSError*_Nullable*_Nullable)error; -+ (nullable id)addressWithDomain:(nonnull NSString*)domain port:(nonnull NSString*)port error:(NSError*_Nullable*_Nullable)error; -+ (nullable id)addressWithValue:(nonnull NSString*)value error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)addressWithIp:(nonnull NSString *)ipV4 port:(nonnull NSString *)port error:(NSError *_Nullable*_Nullable)error; ++ (nullable id)addressWithDomain:(nonnull NSString *)domain port:(nonnull NSString *)port error:(NSError *_Nullable*_Nullable)error; ++ (nullable id)addressWithValue:(nonnull NSString *)value error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAddress.m b/IrohaCommunication/Classes/Public/Model/Common/IRAddress.m index 6c6276c36..11d129371 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAddress.m +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAddress.m @@ -16,14 +16,14 @@ @interface IRAddress : NSObject -- (instancetype)initWithString:(nonnull NSString*)value; +- (instancetype)initWithString:(nonnull NSString *)value; @end @implementation IRAddress @synthesize value = _value; -- (instancetype)initWithString:(nonnull NSString*)value { +- (instancetype)initWithString:(nonnull NSString *)value { if (self = [super init]) { _value = value; } @@ -41,7 +41,7 @@ - (instancetype)copyWithZone:(NSZone *)zone { @implementation IRAddressFactory -+ (nullable id)addressWithIp:(nonnull NSString*)ipV4 port:(nonnull NSString*)port error:(NSError*_Nullable*_Nullable)error { ++ (nullable id)addressWithIp:(nonnull NSString *)ipV4 port:(nonnull NSString *)port error:(NSError *_Nullable*_Nullable)error { if (![self isValidIpV4:ipV4]) { if (error) { NSString *message = [NSString stringWithFormat:@"IP address %@ is invalid. Expected: %@", ipV4, IP_V4_FORMAT]; @@ -67,7 +67,7 @@ @implementation IRAddressFactory return [[IRAddress alloc] initWithString:value]; } -+ (nullable id)addressWithDomain:(nonnull NSString*)domain port:(nonnull NSString*)port error:(NSError*_Nullable*_Nullable)error { ++ (nullable id)addressWithDomain:(nonnull NSString *)domain port:(nonnull NSString *)port error:(NSError *_Nullable*_Nullable)error { if (![self isValidDomain:domain]) { if (error) { NSString *message = [NSString stringWithFormat:@"Domain %@ is invalid. Expected: %@", domain, DOMAIN_FORMAT]; @@ -94,8 +94,8 @@ @implementation IRAddressFactory return [[IRAddress alloc] initWithString:value]; } -+ (nullable id)addressWithValue:(nonnull NSString*)value error:(NSError*_Nullable*_Nullable)error { - NSArray *components = [value componentsSeparatedByString:ADDRESS_PORT_SEPARATOR]; ++ (nullable id)addressWithValue:(nonnull NSString *)value error:(NSError *_Nullable*_Nullable)error { + NSArray *components = [value componentsSeparatedByString:ADDRESS_PORT_SEPARATOR]; if ([components count] != 2) { if (error) { @@ -123,19 +123,19 @@ @implementation IRAddressFactory return address; } -+ (BOOL)isValidIpV4:(nonnull NSString*)ipV4 { ++ (BOOL)isValidIpV4:(nonnull NSString *)ipV4 { return [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", IP_V4_FORMAT] evaluateWithObject:ipV4]; } -+ (BOOL)isValidPort:(nonnull NSString*)port { ++ (BOOL)isValidPort:(nonnull NSString *)port { return [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", PORT_FORMAT] evaluateWithObject:port]; } -+ (BOOL)isValidDomain:(nonnull NSString*)domain { ++ (BOOL)isValidDomain:(nonnull NSString *)domain { return [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", DOMAIN_FORMAT] evaluateWithObject:domain]; } -+ (nonnull NSError*)invalidValueError:(nonnull NSString*)value { ++ (nonnull NSError *)invalidValueError:(nonnull NSString *)value { NSString *message = [NSString stringWithFormat:@"Invalid address value: %@", value]; return [NSError errorWithDomain:NSStringFromClass([IRAddressFactory class]) code:IRInvalidAddressValue diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAmount.h b/IrohaCommunication/Classes/Public/Model/Common/IRAmount.h index 5d165ccbc..d498e8d2c 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAmount.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAmount.h @@ -7,7 +7,7 @@ @protocol IRAmount -@property(nonatomic, readonly)NSString* _Nonnull value; +@property (nonatomic, readonly) NSString * _Nonnull value; @end @@ -17,8 +17,8 @@ typedef NS_ENUM(NSUInteger, IRAmountError) { @protocol IRAmountFactoryProtocol -+ (nullable id)amountFromString:(nonnull NSString*)amount error:(NSError*_Nullable*_Nullable)error; -+ (nullable id)amountFromUnsignedInteger:(NSUInteger)amount error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)amountFromString:(nonnull NSString *)amount error:(NSError *_Nullable*_Nullable)error; ++ (nullable id)amountFromUnsignedInteger:(NSUInteger)amount error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAssetId.h b/IrohaCommunication/Classes/Public/Model/Common/IRAssetId.h index db00df805..2a1051890 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAssetId.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAssetId.h @@ -8,10 +8,10 @@ @protocol IRAssetId -@property(nonatomic, readonly)NSString * _Nonnull name; -@property(nonatomic, readonly)id _Nonnull domain; +@property (nonatomic, readonly) NSString * _Nonnull name; +@property (nonatomic, readonly) id _Nonnull domain; -- (nonnull NSString*)identifier; +- (nonnull NSString *)identifier; @end @@ -22,12 +22,12 @@ typedef NS_ENUM(NSUInteger, IRAssetIdFactoryError) { @protocol IRAssetIdFactoryProtocol -+ (nullable id)assetIdWithName:(nonnull NSString*)name ++ (nullable id)assetIdWithName:(nonnull NSString *)name domain:(nonnull id)domain - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; -+ (nullable id)assetWithIdentifier:(nonnull NSString*)assetId - error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)assetWithIdentifier:(nonnull NSString *)assetId + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAssetId.m b/IrohaCommunication/Classes/Public/Model/Common/IRAssetId.m index f4414a092..87cdc0926 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAssetId.m +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAssetId.m @@ -12,7 +12,7 @@ @interface IRAssetId : NSObject -- (instancetype)initWithName:(nonnull NSString*)name inDomain:(nonnull id)domain; +- (instancetype)initWithName:(nonnull NSString *)name inDomain:(nonnull id)domain; @end @@ -22,7 +22,7 @@ @implementation IRAssetId @synthesize name = _name; @synthesize domain = _domain; -- (instancetype)initWithName:(nonnull NSString*)name inDomain:(nonnull id)domain { +- (instancetype)initWithName:(nonnull NSString *)name inDomain:(nonnull id)domain { if (self = [super init]) { _name = name; _domain = domain; @@ -31,7 +31,7 @@ - (instancetype)initWithName:(nonnull NSString*)name inDomain:(nonnull id)assetIdWithName:(nonnull NSString*)name ++ (nullable id)assetIdWithName:(nonnull NSString *)name domain:(nonnull id)domain - error:(NSError*_Nullable*_Nullable)error { + error:(NSError *_Nullable*_Nullable)error { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", ASSET_NAME_FORMAT]; if ([predicate evaluateWithObject:name]) { @@ -63,9 +63,9 @@ @implementation IRAssetIdFactory } } -+ (nullable id)assetWithIdentifier:(nonnull NSString*)assetId - error:(NSError*_Nullable*_Nullable)error { - NSArray *components = [assetId componentsSeparatedByString:ASSET_ID_SEPARATOR]; ++ (nullable id)assetWithIdentifier:(nonnull NSString *)assetId + error:(NSError *_Nullable*_Nullable)error { + NSArray *components = [assetId componentsSeparatedByString:ASSET_ID_SEPARATOR]; if ([components count] != 2) { if (error) { diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRAssetPagination.h b/IrohaCommunication/Classes/Public/Model/Common/IRAssetPagination.h index 5e25f6997..b68a1644b 100644 --- a/IrohaCommunication/Classes/Public/Model/Common/IRAssetPagination.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRAssetPagination.h @@ -8,9 +8,9 @@ @protocol IRAssetPagination -@property(nonatomic, readonly)UInt32 pageSize; +@property (nonatomic, readonly) UInt32 pageSize; -@property(nonatomic, readonly)id _Nullable startingAssetId; +@property (nonatomic, readonly) id _Nullable startingAssetId; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRDomain.h b/IrohaCommunication/Classes/Public/Model/Common/IRDomain.h index d04feaa97..97d799bf4 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRDomain.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRDomain.h @@ -7,7 +7,7 @@ @protocol IRDomain -@property(nonatomic, readonly)NSString * _Nonnull identifier; +@property (nonatomic, readonly) NSString * _Nonnull identifier; @end @@ -17,8 +17,8 @@ typedef NS_ENUM(NSUInteger, IRDomainFactoryError) { @protocol IRDomainFactoryProtocol -+ (nullable id)domainWithIdentitifer:(nonnull NSString*)identifier - error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)domainWithIdentitifer:(nonnull NSString *)identifier + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRDomain.m b/IrohaCommunication/Classes/Public/Model/Common/IRDomain.m index f0a96affb..5cf961ab6 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRDomain.m +++ b/IrohaCommunication/Classes/Public/Model/Common/IRDomain.m @@ -9,14 +9,14 @@ @interface IRDomain : NSObject -- (instancetype)initWithIdentifier:(nonnull NSString*)identifier; +- (instancetype)initWithIdentifier:(nonnull NSString *)identifier; @end @implementation IRDomain @synthesize identifier = _identifier; -- (instancetype)initWithIdentifier:(nonnull NSString*)identifier { +- (instancetype)initWithIdentifier:(nonnull NSString *)identifier { if (self = [super init]) { _identifier = identifier; } @@ -28,8 +28,8 @@ - (instancetype)initWithIdentifier:(nonnull NSString*)identifier { @implementation IRDomainFactory -+ (nullable id)domainWithIdentitifer:(nonnull NSString*)identifier - error:(NSError*_Nullable*_Nullable)error { ++ (nullable id)domainWithIdentitifer:(nonnull NSString *)identifier + error:(NSError *_Nullable*_Nullable)error { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", DOMAIN_FORMAT]; if ([predicate evaluateWithObject:identifier]) { diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRGrantablePermission.h b/IrohaCommunication/Classes/Public/Model/Common/IRGrantablePermission.h index 2b9250354..9fc4901b8 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRGrantablePermission.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRGrantablePermission.h @@ -7,7 +7,7 @@ @protocol IRGrantablePermission -@property(nonatomic, readonly)int32_t value; +@property (nonatomic, readonly) int32_t value; @end @@ -17,7 +17,7 @@ typedef NS_ENUM(NSUInteger, IRGrantablePermissionError) { @protocol IRGrantablePermissionFactoryProtocol -+ (nullable id)permissionWithValue:(int32_t)value error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)permissionWithValue:(int32_t)value error:(NSError *_Nullable *_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRGrantablePermission.m b/IrohaCommunication/Classes/Public/Model/Common/IRGrantablePermission.m index 877226183..5ccb77100 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRGrantablePermission.m +++ b/IrohaCommunication/Classes/Public/Model/Common/IRGrantablePermission.m @@ -39,7 +39,7 @@ - (BOOL)isEqual:(id)object { @implementation IRGrantablePermissionFactory -+ (nullable id)permissionWithValue:(int32_t)value error:(NSError*_Nullable*_Nullable)error { ++ (nullable id)permissionWithValue:(int32_t)value error:(NSError *_Nullable*_Nullable)error { if (!GrantablePermission_IsValidValue(value)) { if (error) { NSString *message = @"Invalid grantable permission value passed."; diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRPagination.h b/IrohaCommunication/Classes/Public/Model/Common/IRPagination.h index fab5d81b0..aa84746dd 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRPagination.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRPagination.h @@ -5,26 +5,28 @@ #import -@protocol IRPagination -@property(nonatomic, readonly)UInt32 pageSize; +typedef NS_ENUM(NSUInteger, IRPaginationFactoryError) { + IRPaginationFactoryErrorInvalidHash +}; + + +@protocol IRPagination -@property(nonatomic, readonly)NSData * _Nullable firstItemHash; +@property (nonatomic, readonly) UInt32 pageSize; +@property (nonatomic, readonly) NSData * _Nullable firstItemHash; @end -typedef NS_ENUM(NSUInteger, IRPaginationFactoryError) { - IRPaginationFactoryErrorInvalidHash -}; @protocol IRPaginationFactoryProtocol + (nullable id)pagination:(UInt32)pageSize - firstItemHash:(nullable NSData*)firstItemHash - error:(NSError*_Nullable*_Nullable)error; + firstItemHash:(nullable NSData *)firstItemHash + error:(NSError *_Nullable*_Nullable)error; @end -@interface IRPaginationFactory : NSObject +@interface IRPaginationFactory : NSObject @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRPagination.m b/IrohaCommunication/Classes/Public/Model/Common/IRPagination.m index e54462ce4..38aaa4822 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRPagination.m +++ b/IrohaCommunication/Classes/Public/Model/Common/IRPagination.m @@ -14,7 +14,7 @@ @implementation IRPagination @synthesize firstItemHash = _firstItemHash; - (nonnull instancetype)initWithPageSize:(UInt32)pageSize - firstItemHash:(nullable NSData*)firstItemHash { + firstItemHash:(nullable NSData *)firstItemHash { if (self = [super init]) { _pageSize = pageSize; _firstItemHash = firstItemHash; @@ -28,7 +28,7 @@ - (nonnull instancetype)initWithPageSize:(UInt32)pageSize @implementation IRPaginationFactory + (nullable id)pagination:(UInt32)pageSize - firstItemHash:(nullable NSData*)firstItemHash + firstItemHash:(nullable NSData *)firstItemHash error:(NSError **)error { if (firstItemHash && firstItemHash.length != 32) { if (error) { diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRPeerSignature.h b/IrohaCommunication/Classes/Public/Model/Common/IRPeerSignature.h index 5d15435c0..ca8fea2d4 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRPeerSignature.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRPeerSignature.h @@ -9,8 +9,8 @@ @protocol IRPeerSignature -@property(nonatomic, readonly)id _Nonnull signature; -@property(nonatomic, readonly)id _Nonnull publicKey; +@property (nonatomic, readonly) id _Nonnull signature; +@property (nonatomic, readonly) id _Nonnull publicKey; @end @@ -18,7 +18,7 @@ + (nullable id)peerSignature:(nonnull id)signature publicKey:(nonnull id)publicKey - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRPeerSignature.m b/IrohaCommunication/Classes/Public/Model/Common/IRPeerSignature.m index d1c98dbf7..cd5618436 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRPeerSignature.m +++ b/IrohaCommunication/Classes/Public/Model/Common/IRPeerSignature.m @@ -33,7 +33,7 @@ @implementation IRPeerSignatureFactory + (nullable id)peerSignature:(nonnull id)signature publicKey:(nonnull id)publicKey - error:(NSError*_Nullable*_Nullable)error { + error:(NSError *_Nullable*_Nullable)error { return [[IRPeerSignature alloc] initWithSignature:signature publicKey:publicKey]; diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRRoleName.h b/IrohaCommunication/Classes/Public/Model/Common/IRRoleName.h index 8c8b355ab..824487845 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRRoleName.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRRoleName.h @@ -7,7 +7,7 @@ @protocol IRRoleName -@property(nonatomic, readonly)NSString * _Nonnull value; +@property (nonatomic, readonly) NSString * _Nonnull value; @end @@ -17,7 +17,7 @@ typedef NS_ENUM(NSUInteger, IRRoleNameFactoryError) { @protocol IRRoleNameFactoryProtocol -+ (nullable id)roleWithName:(nonnull NSString*)name error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)roleWithName:(nonnull NSString *)name error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRRoleName.m b/IrohaCommunication/Classes/Public/Model/Common/IRRoleName.m index 8b0d52032..21466c652 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRRoleName.m +++ b/IrohaCommunication/Classes/Public/Model/Common/IRRoleName.m @@ -9,14 +9,14 @@ @interface IRRoleName : NSObject -- (instancetype)initWithName:(nonnull NSString*)name; +- (instancetype)initWithName:(nonnull NSString *)name; @end @implementation IRRoleName @synthesize value = _value; -- (instancetype)initWithName:(nonnull NSString*)name { +- (instancetype)initWithName:(nonnull NSString *)name { if (self = [super init]) { _value = name; } @@ -28,7 +28,7 @@ - (instancetype)initWithName:(nonnull NSString*)name { @implementation IRRoleNameFactory -+ (nullable id)roleWithName:(nonnull NSString*)name error:(NSError**)error { ++ (nullable id)roleWithName:(nonnull NSString *)name error:(NSError **)error { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", ROLE_NAME_FORMAT]; if ([predicate evaluateWithObject:name]) { diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRRolePermission.h b/IrohaCommunication/Classes/Public/Model/Common/IRRolePermission.h index 77784a8cd..5e7b29bd4 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRRolePermission.h +++ b/IrohaCommunication/Classes/Public/Model/Common/IRRolePermission.h @@ -5,78 +5,90 @@ #import -@protocol IRRolePermission - -@property(nonatomic, readonly)int32_t value; +NS_ASSUME_NONNULL_BEGIN -@end typedef NS_ENUM(NSUInteger, IRRolePermissionError) { IRInvalidRolePermissionValue }; + +@protocol IRRolePermission + +@property (nonatomic, readonly) int32_t value; + +@end + + @protocol IRRolePermissionFactoryProtocol -+ (nullable id)permissionWithValue:(int32_t)value error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)permissionWithValue:(int32_t)value error:(NSError *_Nullable*_Nullable)error; @end + @interface IRRolePermissionFactory : NSObject + #pragma mark - Command Permissions -+ (nonnull id)canAppendRole; -+ (nonnull id)canCreateRole; -+ (nonnull id)canDetachRole; -+ (nonnull id)canAddAssetQuantity; -+ (nonnull id)canSubtractAssetQuantity; -+ (nonnull id)canAddPeer; -+ (nonnull id)canRemovePeer; -+ (nonnull id)canAddSignatory; -+ (nonnull id)canRemoveSignatory; -+ (nonnull id)canSetQuorum; -+ (nonnull id)canCreateAccount; -+ (nonnull id)canSetDetail; -+ (nonnull id)canCreateAsset; -+ (nonnull id)canTransfer; -+ (nonnull id)canReceive; -+ (nonnull id)canCreateDomain; -+ (nonnull id)canAddDomainAssetQuantity; -+ (nonnull id)canSubtractDomainAssetQuantity; ++ (id)canAppendRole; ++ (id)canCreateRole; ++ (id)canDetachRole; ++ (id)canAddAssetQuantity; ++ (id)canSubtractAssetQuantity; ++ (id)canAddPeer; ++ (id)canRemovePeer; ++ (id)canAddSignatory; ++ (id)canRemoveSignatory; ++ (id)canSetQuorum; ++ (id)canCreateAccount; ++ (id)canSetDetail; ++ (id)canCreateAsset; ++ (id)canTransfer; ++ (id)canReceive; ++ (id)canCreateDomain; ++ (id)canAddDomainAssetQuantity; ++ (id)canSubtractDomainAssetQuantity; + #pragma mark - Query permissions -+ (nonnull id)canReadAssets; -+ (nonnull id)canGetRoles; -+ (nonnull id)canGetMyAccount; -+ (nonnull id)canGetAllAccounts; -+ (nonnull id)canGetDomainAccounts; -+ (nonnull id)canGetMySignatories; -+ (nonnull id)canGetAllSignatories; -+ (nonnull id)canGetDomainSignatories; -+ (nonnull id)canGetMyAccountAssets; -+ (nonnull id)canGetAllAccountAssets; -+ (nonnull id)canGetDomainAccountAssets; -+ (nonnull id)canGetMyAccountDetail; -+ (nonnull id)canGetAllAccountDetail; -+ (nonnull id)canGetDomainAccountDetail; -+ (nonnull id)canGetMyAccountTransactions; -+ (nonnull id)canGetAllAccountTransactions; -+ (nonnull id)canGetDomainAccountTransactions; -+ (nonnull id)canGetMyAccountAssetTransactions; -+ (nonnull id)canGetAllAccountAssetTransactions; -+ (nonnull id)canGetDomainAccountAsssetTransactions; -+ (nonnull id)canGetMyTransactions; -+ (nonnull id)canGetAllTransactions; -+ (nonnull id)canGetBlocks; -+ (nonnull id)canGetPeers; ++ (id)canReadAssets; ++ (id)canGetRoles; ++ (id)canGetMyAccount; ++ (id)canGetAllAccounts; ++ (id)canGetDomainAccounts; ++ (id)canGetMySignatories; ++ (id)canGetAllSignatories; ++ (id)canGetDomainSignatories; ++ (id)canGetMyAccountAssets; ++ (id)canGetAllAccountAssets; ++ (id)canGetDomainAccountAssets; ++ (id)canGetMyAccountDetail; ++ (id)canGetAllAccountDetail; ++ (id)canGetDomainAccountDetail; ++ (id)canGetMyAccountTransactions; ++ (id)canGetAllAccountTransactions; ++ (id)canGetDomainAccountTransactions; ++ (id)canGetMyAccountAssetTransactions; ++ (id)canGetAllAccountAssetTransactions; ++ (id)canGetDomainAccountAsssetTransactions; ++ (id)canGetMyTransactions; ++ (id)canGetAllTransactions; ++ (id)canGetBlocks; ++ (id)canGetPeers; + #pragma mark - Grant permissions -+ (nonnull id)canGrantCanSetMyQuorum; -+ (nonnull id)canGrantCanAddMySignatory; -+ (nonnull id)canGrantCanRemoveMySignatory; -+ (nonnull id)canGrantCanTransferMyAssets; -+ (nonnull id)canGrantCanSetMyAccountDetail; ++ (id)canGrantCanSetMyQuorum; ++ (id)canGrantCanAddMySignatory; ++ (id)canGrantCanRemoveMySignatory; ++ (id)canGrantCanTransferMyAssets; ++ (id)canGrantCanSetMyAccountDetail; @end + + +NS_ASSUME_NONNULL_END diff --git a/IrohaCommunication/Classes/Public/Model/Common/IRRolePermission.m b/IrohaCommunication/Classes/Public/Model/Common/IRRolePermission.m index 0f98cbc1e..c3567b9b2 100755 --- a/IrohaCommunication/Classes/Public/Model/Common/IRRolePermission.m +++ b/IrohaCommunication/Classes/Public/Model/Common/IRRolePermission.m @@ -39,7 +39,7 @@ - (BOOL)isEqual:(id)object { @implementation IRRolePermissionFactory -+ (nullable id)permissionWithValue:(int32_t)value error:(NSError*_Nullable*_Nullable)error { ++ (nullable id)permissionWithValue:(int32_t)value error:(NSError *_Nullable*_Nullable)error { if (!RolePermission_IsValidValue(value)) { if (error) { NSString *message = @"Invalid role permission value passed."; diff --git a/IrohaCommunication/Classes/Public/Model/IRBlockQueryRequest.h b/IrohaCommunication/Classes/Public/Model/IRBlockQueryRequest.h index a4c7b36c1..390b57bf2 100755 --- a/IrohaCommunication/Classes/Public/Model/IRBlockQueryRequest.h +++ b/IrohaCommunication/Classes/Public/Model/IRBlockQueryRequest.h @@ -13,14 +13,14 @@ @protocol IRBlockQueryRequest -@property(nonatomic, readonly)id _Nonnull creator; -@property(nonatomic, readonly)NSDate* _Nonnull createdAt; -@property(nonatomic, readonly)UInt64 queryCounter; -@property(nonatomic, readonly)id _Nullable peerSignature; +@property (nonatomic, readonly) id _Nonnull creator; +@property (nonatomic, readonly) NSDate * _Nonnull createdAt; +@property (nonatomic, readonly) UInt64 queryCounter; +@property (nonatomic, readonly) id _Nullable peerSignature; - (nullable instancetype)signedWithSignatory:(nonnull id)signatory signatoryPublicKey:(nonnull id)signatoryPublicKey - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/IRBlockQueryResponse.h b/IrohaCommunication/Classes/Public/Model/IRBlockQueryResponse.h index f473a8fa8..67dc26a97 100755 --- a/IrohaCommunication/Classes/Public/Model/IRBlockQueryResponse.h +++ b/IrohaCommunication/Classes/Public/Model/IRBlockQueryResponse.h @@ -11,19 +11,19 @@ @protocol IRBlock -@property(nonatomic, readonly)UInt64 height; -@property(nonatomic, readonly)NSData * _Nullable previousBlockHash; -@property(nonatomic, readonly)NSDate * _Nonnull createdAt; -@property(nonatomic, readonly)NSArray> * _Nonnull transactions; -@property(nonatomic, readonly)NSArray * _Nonnull rejectedTransactionHashes; -@property(nonatomic, readonly)NSArray> * _Nonnull peerSignatures; +@property (nonatomic, readonly) UInt64 height; +@property (nonatomic, readonly) NSData * _Nullable previousBlockHash; +@property (nonatomic, readonly) NSDate * _Nonnull createdAt; +@property (nonatomic, readonly) NSArray> * _Nonnull transactions; +@property (nonatomic, readonly) NSArray * _Nonnull rejectedTransactionHashes; +@property (nonatomic, readonly) NSArray> * _Nonnull peerSignatures; @end @protocol IRBlockQueryResponse -@property(nonatomic, readonly)id _Nullable block; -@property(nonatomic, readonly)NSError * _Nullable error; +@property (nonatomic, readonly) id _Nullable block; +@property (nonatomic, readonly) NSError * _Nullable error; @end diff --git a/IrohaCommunication/Classes/Public/Model/IRCommand.h b/IrohaCommunication/Classes/Public/Model/IRCommand.h index ae327b30d..4ef7a7563 100755 --- a/IrohaCommunication/Classes/Public/Model/IRCommand.h +++ b/IrohaCommunication/Classes/Public/Model/IRCommand.h @@ -23,149 +23,149 @@ @protocol IRAddAssetQuantity -@property(nonatomic, readonly)id _Nonnull assetId; -@property(nonatomic, readonly)id _Nonnull amount; +@property (nonatomic, readonly) id _Nonnull assetId; +@property (nonatomic, readonly) id _Nonnull amount; @end @protocol IRAddPeer -@property(nonatomic, readonly)id _Nonnull address; -@property(nonatomic, readonly)id _Nonnull publicKey; +@property (nonatomic, readonly) id _Nonnull address; +@property (nonatomic, readonly) id _Nonnull publicKey; @end @protocol IRAddSignatory -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nonnull publicKey; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull publicKey; @end @protocol IRAppendRole -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nonnull roleName; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull roleName; @end @protocol IRCreateAccount -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nonnull publicKey; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull publicKey; @end @protocol IRCreateAsset -@property(nonatomic, readonly)id _Nonnull assetId; -@property(nonatomic, readonly)UInt32 precision; +@property (nonatomic, readonly) id _Nonnull assetId; +@property (nonatomic, readonly) UInt32 precision; @end @protocol IRCreateDomain -@property(nonatomic, readonly)id _Nonnull domainId; -@property(nonatomic, readonly)id _Nullable defaultRole; +@property (nonatomic, readonly) id _Nonnull domainId; +@property (nonatomic, readonly) id _Nullable defaultRole; @end @protocol IRCreateRole -@property(nonatomic, readonly)id _Nonnull roleName; -@property(nonatomic, readonly)NSArray> * _Nonnull permissions; +@property (nonatomic, readonly) id _Nonnull roleName; +@property (nonatomic, readonly) NSArray> * _Nonnull permissions; @end @protocol IRDetachRole -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nonnull roleName; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull roleName; @end @protocol IRGrantPermission -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nonnull permission; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull permission; @end @protocol IRRemoveSignatory -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nonnull publicKey; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull publicKey; @end @protocol IRRevokePermission -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nonnull permission; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull permission; @end @protocol IRSetAccountDetail -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)NSString* _Nonnull key; -@property(nonatomic, readonly)NSString* _Nonnull value; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) NSString * _Nonnull key; +@property (nonatomic, readonly) NSString * _Nonnull value; @end @protocol IRSetAccountQuorum -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)UInt32 quorum; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) UInt32 quorum; @end @protocol IRSubtractAssetQuantity -@property(nonatomic, readonly)id _Nonnull assetId; -@property(nonatomic, readonly)id _Nonnull amount; +@property (nonatomic, readonly) id _Nonnull assetId; +@property (nonatomic, readonly) id _Nonnull amount; @end @protocol IRTransferAsset -@property(nonatomic, readonly)id _Nonnull sourceAccountId; -@property(nonatomic, readonly)id _Nonnull destinationAccountId; -@property(nonatomic, readonly)id _Nonnull assetId; -@property(nonatomic, readonly)NSString* _Nonnull transferDescription; -@property(nonatomic, readonly)id _Nonnull amount; +@property (nonatomic, readonly) id _Nonnull sourceAccountId; +@property (nonatomic, readonly) id _Nonnull destinationAccountId; +@property (nonatomic, readonly) id _Nonnull assetId; +@property (nonatomic, readonly) NSString * _Nonnull transferDescription; +@property (nonatomic, readonly) id _Nonnull amount; @end @protocol IRRemovePeer -@property(nonatomic, readonly)id _Nonnull peerKey; +@property (nonatomic, readonly) id _Nonnull peerKey; @end @protocol IRCompareAndSetAccountDetail -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)NSString* _Nonnull key; -@property(nonatomic, readonly)NSString* _Nonnull value; -@property(nonatomic, readonly)NSString* _Nullable oldValue; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) NSString * _Nonnull key; +@property (nonatomic, readonly) NSString * _Nonnull value; +@property (nonatomic, readonly) NSString * _Nullable oldValue; @end diff --git a/IrohaCommunication/Classes/Public/Model/IRQuery.h b/IrohaCommunication/Classes/Public/Model/IRQuery.h index 6d78e7c62..9a078ef5d 100755 --- a/IrohaCommunication/Classes/Public/Model/IRQuery.h +++ b/IrohaCommunication/Classes/Public/Model/IRQuery.h @@ -20,56 +20,56 @@ @protocol IRGetAccount -@property(nonatomic, readonly)id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull accountId; @end @protocol IRGetSignatories -@property(nonatomic, readonly)id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull accountId; @end @protocol IRGetAccountTransactions -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nullable pagination; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nullable pagination; @end @protocol IRGetAccountAssetTransactions -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nonnull assetId; -@property(nonatomic, readonly)id _Nullable pagination; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nonnull assetId; +@property (nonatomic, readonly) id _Nullable pagination; @end @protocol IRGetTransactions -@property(nonatomic, readonly)NSArray * _Nonnull transactionHashes; +@property (nonatomic, readonly) NSArray * _Nonnull transactionHashes; @end @protocol IRGetAccountAssets -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)id _Nullable pagination; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) id _Nullable pagination; @end @protocol IRGetAccountDetail -@property(nonatomic, readonly)id _Nullable accountId; -@property(nonatomic, readonly)id _Nullable writer; -@property(nonatomic, readonly)NSString * _Nullable key; -@property(nonatomic, readonly)id _Nullable pagination; +@property (nonatomic, readonly) id _Nullable accountId; +@property (nonatomic, readonly) id _Nullable writer; +@property (nonatomic, readonly) NSString * _Nullable key; +@property (nonatomic, readonly) id _Nullable pagination; @end @@ -80,14 +80,14 @@ @protocol IRGetRolePermissions -@property(nonatomic, readonly)id _Nonnull roleName; +@property (nonatomic, readonly) id _Nonnull roleName; @end @protocol IRGetAssetInfo -@property(nonatomic, readonly)id _Nonnull assetId; +@property (nonatomic, readonly) id _Nonnull assetId; @end diff --git a/IrohaCommunication/Classes/Public/Model/IRQueryRequest.h b/IrohaCommunication/Classes/Public/Model/IRQueryRequest.h index 978699a98..1d8b78f40 100755 --- a/IrohaCommunication/Classes/Public/Model/IRQueryRequest.h +++ b/IrohaCommunication/Classes/Public/Model/IRQueryRequest.h @@ -13,15 +13,15 @@ @protocol IRQueryRequest -@property(nonatomic, readonly)id _Nonnull creator; -@property(nonatomic, readonly)NSDate* _Nonnull createdAt; -@property(nonatomic, readonly)UInt64 queryCounter; -@property(nonatomic, readonly)id _Nonnull query; -@property(nonatomic, readonly)id _Nullable peerSignature; +@property (nonatomic, readonly) id _Nonnull creator; +@property (nonatomic, readonly) NSDate * _Nonnull createdAt; +@property (nonatomic, readonly) UInt64 queryCounter; +@property (nonatomic, readonly) id _Nonnull query; +@property (nonatomic, readonly) id _Nullable peerSignature; - (nullable instancetype)signedWithSignatory:(nonnull id)signatory signatoryPublicKey:(nonnull id)signatoryPublicKey - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/IRQueryResponse.h b/IrohaCommunication/Classes/Public/Model/IRQueryResponse.h index 74a160ac2..df9698365 100755 --- a/IrohaCommunication/Classes/Public/Model/IRQueryResponse.h +++ b/IrohaCommunication/Classes/Public/Model/IRQueryResponse.h @@ -18,63 +18,63 @@ @protocol IRQueryResponse -@property (nonatomic, readonly) NSData* _Nonnull queryHash; +@property (nonatomic, readonly) NSData * _Nonnull queryHash; @end @protocol IRAccountAssetsResponse -@property(nonatomic, readonly)NSArray>* _Nonnull accountAssets; -@property(nonatomic, readonly)UInt32 totalCount; -@property(nonatomic, readonly)id _Nullable nextAssetId; +@property (nonatomic, readonly) NSArray> * _Nonnull accountAssets; +@property (nonatomic, readonly) UInt32 totalCount; +@property (nonatomic, readonly) id _Nullable nextAssetId; @end @protocol IRAccountDetailResponse -@property(nonatomic, readonly)NSString* _Nonnull detail; -@property(nonatomic, readonly)UInt64 totalCount; -@property(nonatomic, readonly)id _Nullable nextRecordId; +@property (nonatomic, readonly) NSString * _Nonnull detail; +@property (nonatomic, readonly) UInt64 totalCount; +@property (nonatomic, readonly) id _Nullable nextRecordId; @end @protocol IRSignatoriesResponse -@property(nonatomic, readonly)NSArray>* _Nonnull publicKeys; +@property (nonatomic, readonly) NSArray> * _Nonnull publicKeys; @end @protocol IRTransactionsResponse -@property(nonatomic, readonly)NSArray>* _Nonnull transactions; +@property (nonatomic, readonly) NSArray> * _Nonnull transactions; @end @protocol IRRolesResponse -@property(nonatomic, readonly)NSArray>* _Nonnull roles; +@property (nonatomic, readonly) NSArray> * _Nonnull roles; @end @protocol IRRolePermissionsResponse -@property(nonatomic, readonly)NSArray>* _Nonnull permissions; +@property (nonatomic, readonly) NSArray> * _Nonnull permissions; @end @protocol IRAccountResponse -@property(nonatomic, readonly)id _Nonnull accountId; -@property(nonatomic, readonly)UInt32 quorum; -@property(nonatomic, readonly)NSString * _Nullable details; -@property(nonatomic, readonly)NSArray> * _Nonnull roles; +@property (nonatomic, readonly) id _Nonnull accountId; +@property (nonatomic, readonly) UInt32 quorum; +@property (nonatomic, readonly) NSString * _Nullable details; +@property (nonatomic, readonly) NSArray> * _Nonnull roles; @end @@ -94,33 +94,33 @@ typedef NS_ENUM(NSUInteger, IRErrorResponseReason) { @protocol IRErrorResponse -@property(nonatomic, readonly)IRErrorResponseReason reason; -@property(nonatomic, readonly)NSString * _Nonnull message; -@property(nonatomic, readonly)UInt32 code; +@property (nonatomic, readonly) IRErrorResponseReason reason; +@property (nonatomic, readonly) NSString * _Nonnull message; +@property (nonatomic, readonly) UInt32 code; @end @protocol IRAssetResponse -@property(nonatomic, readonly)id _Nonnull assetId; -@property(nonatomic, readonly)UInt32 precision; +@property (nonatomic, readonly) id _Nonnull assetId; +@property (nonatomic, readonly) UInt32 precision; @end @protocol IRTransactionsPageResponse -@property(nonatomic, readonly)NSArray>* _Nonnull transactions; -@property(nonatomic, readonly)UInt32 totalCount; -@property(nonatomic, readonly)NSData * _Nullable nextTransactionHash; +@property (nonatomic, readonly) NSArray> * _Nonnull transactions; +@property (nonatomic, readonly) UInt32 totalCount; +@property (nonatomic, readonly) NSData * _Nullable nextTransactionHash; @end @protocol IRPeersResponse -@property(nonatomic, readonly)NSArray>* _Nonnull peers; +@property (nonatomic, readonly) NSArray> * _Nonnull peers; @end diff --git a/IrohaCommunication/Classes/Public/Model/IRSignable.h b/IrohaCommunication/Classes/Public/Model/IRSignable.h index c5f61c3b5..b6068f5ad 100755 --- a/IrohaCommunication/Classes/Public/Model/IRSignable.h +++ b/IrohaCommunication/Classes/Public/Model/IRSignable.h @@ -13,7 +13,7 @@ - (nullable id)signWithSignatory:(nonnull id)signatory signatoryPublicKey:(nonnull id)signatoryPublicKey - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/IRTransaction.h b/IrohaCommunication/Classes/Public/Model/IRTransaction.h index 972f51f86..0b8128e70 100755 --- a/IrohaCommunication/Classes/Public/Model/IRTransaction.h +++ b/IrohaCommunication/Classes/Public/Model/IRTransaction.h @@ -19,25 +19,25 @@ typedef NS_ENUM(NSUInteger, IRTransactionBatchType) { @protocol IRTransaction -@property(nonatomic, readonly)id _Nonnull creator; -@property(nonatomic, readonly)NSDate* _Nonnull createdAt; -@property(nonatomic, readonly)NSArray>* _Nonnull commands; -@property(nonatomic, readonly)NSUInteger quorum; -@property(nonatomic, readonly)NSArray>* _Nullable signatures; -@property(nonatomic, readonly)NSArray* _Nullable batchHashes; -@property(nonatomic, readonly)IRTransactionBatchType batchType; +@property (nonatomic, readonly) id _Nonnull creator; +@property (nonatomic, readonly) NSDate * _Nonnull createdAt; +@property (nonatomic, readonly) NSArray> * _Nonnull commands; +@property (nonatomic, readonly) NSUInteger quorum; +@property (nonatomic, readonly) NSArray> * _Nullable signatures; +@property (nonatomic, readonly) NSArray * _Nullable batchHashes; +@property (nonatomic, readonly) IRTransactionBatchType batchType; -- (nullable NSData*)transactionHashWithError:(NSError*_Nullable*_Nullable)error; +- (nullable NSData *)transactionHashWithError:(NSError *_Nullable*_Nullable)error; -- (nullable NSData*)batchHashWithError:(NSError*_Nullable*_Nullable)error; +- (nullable NSData *)batchHashWithError:(NSError *_Nullable*_Nullable)error; -- (nullable instancetype)signedWithSignatories:(nonnull NSArray>*)signatories +- (nullable instancetype)signedWithSignatories:(nonnull NSArray> *)signatories signatoryPublicKeys:(nonnull NSArray> *)signatoryPublicKeys - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable*_Nullable)error; -- (nullable instancetype)batched:(nullable NSArray*)transactionBatchHashes +- (nullable instancetype)batched:(nullable NSArray *)transactionBatchHashes batchType:(IRTransactionBatchType)batchType - error:(NSError*_Nullable*_Nullable)error; + error:(NSError *_Nullable *_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Model/IRTransactionStatusResponse.h b/IrohaCommunication/Classes/Public/Model/IRTransactionStatusResponse.h index e77ef8dd1..0ab380623 100755 --- a/IrohaCommunication/Classes/Public/Model/IRTransactionStatusResponse.h +++ b/IrohaCommunication/Classes/Public/Model/IRTransactionStatusResponse.h @@ -20,8 +20,8 @@ typedef NS_ENUM(NSUInteger, IRTransactionStatus) { @protocol IRTransactionStatusResponse -@property(nonatomic, readonly)IRTransactionStatus status; -@property(nonatomic, readonly)NSData * _Nonnull transactionHash; -@property(nonatomic, readonly)NSString * _Nullable statusDescription; +@property (nonatomic, readonly) IRTransactionStatus status; +@property (nonatomic, readonly) NSData * _Nonnull transactionHash; +@property (nonatomic, readonly) NSString * _Nullable statusDescription; @end diff --git a/IrohaCommunication/Classes/Public/Promise/IRPromise.h b/IrohaCommunication/Classes/Public/Promise/IRPromise.h index 490d48b44..6cff9635c 100755 --- a/IrohaCommunication/Classes/Public/Promise/IRPromise.h +++ b/IrohaCommunication/Classes/Public/Promise/IRPromise.h @@ -5,24 +5,24 @@ #import + @class IRPromise; -typedef IRPromise* _Nullable (^IRPromiseResultHandler)(id _Nullable); -typedef IRPromise* _Nullable (^IRPromiseErrorHandler)(NSError* _Nonnull); -@interface IRPromise : NSObject +typedef IRPromise *_Nullable (^IRPromiseResultHandler)(id _Nullable); +typedef IRPromise *_Nullable (^IRPromiseErrorHandler)(NSError * _Nonnull); + -@property(nonatomic, readonly)BOOL isFulfilled; -@property(nonatomic, readonly)BOOL isProcessed; +@interface IRPromise : NSObject -@property(nonatomic, readonly)id _Nullable result; +@property (nonatomic, readonly) BOOL isFulfilled; +@property (nonatomic, readonly) BOOL isProcessed; +@property (nonatomic, readonly) id _Nullable result; +@property (nonatomic, readonly) IRPromise* _Nonnull (^ _Nonnull onThen)(IRPromiseResultHandler _Nonnull); +@property (nonatomic, readonly) IRPromise* _Nonnull (^ _Nonnull onError)(IRPromiseErrorHandler _Nonnull); + (nonnull instancetype)promise; + (nonnull instancetype)promiseWithResult:(nullable id)result; - -@property(nonatomic, readonly)IRPromise* _Nonnull (^ _Nonnull onThen)(IRPromiseResultHandler _Nonnull); -@property(nonatomic, readonly)IRPromise* _Nonnull (^ _Nonnull onError)(IRPromiseErrorHandler _Nonnull); - - (void)fulfillWithResult:(id _Nullable)result; @end diff --git a/IrohaCommunication/Classes/Public/Promise/IRPromise.m b/IrohaCommunication/Classes/Public/Promise/IRPromise.m index ea69cde8a..455909da9 100755 --- a/IrohaCommunication/Classes/Public/Promise/IRPromise.m +++ b/IrohaCommunication/Classes/Public/Promise/IRPromise.m @@ -7,13 +7,13 @@ @interface IRPromise() -@property(strong, nonatomic)IRPromise* _Nullable next; +@property (nonatomic, strong) IRPromise* _Nullable next; -@property(strong, nonatomic)IRPromiseResultHandler _Nullable resultHandler; +@property (nonatomic, strong) IRPromiseResultHandler _Nullable resultHandler; -@property(strong, nonatomic)IRPromiseErrorHandler _Nullable errorHandler; +@property (nonatomic, strong) IRPromiseErrorHandler _Nullable errorHandler; -@property(strong, nonatomic)dispatch_semaphore_t semaphore; +@property (nonatomic, strong) dispatch_semaphore_t semaphore; @end diff --git a/IrohaCommunication/Classes/Public/Serializers/IRSerializationFactory.h b/IrohaCommunication/Classes/Public/Serializers/IRSerializationFactory.h index 9bc7d3d04..e600d99b2 100644 --- a/IrohaCommunication/Classes/Public/Serializers/IRSerializationFactory.h +++ b/IrohaCommunication/Classes/Public/Serializers/IRSerializationFactory.h @@ -10,11 +10,11 @@ @protocol IRSerializationFactoryProtocol -+ (nullable NSData*)serializeTransaction:(nonnull id)transaction error:(NSError*_Nullable*_Nullable)error; -+ (nullable NSData*)serializeQueryRequest:(nonnull id)queryRequest error:(NSError*_Nullable*_Nullable)error; ++ (nullable NSData *)serializeTransaction:(nonnull id)transaction error:(NSError *_Nullable*_Nullable)error; ++ (nullable NSData *)serializeQueryRequest:(nonnull id)queryRequest error:(NSError *_Nullable*_Nullable)error; -+ (nullable id)deserializeTransactionFromData:(nonnull NSData*)data error:(NSError*_Nullable*_Nullable)error; -+ (nullable id)deserializeQueryResponseFromData:(nonnull NSData*)data error:(NSError*_Nullable*_Nullable)error; ++ (nullable id)deserializeTransactionFromData:(nonnull NSData *)data error:(NSError *_Nullable*_Nullable)error; ++ (nullable id)deserializeQueryResponseFromData:(nonnull NSData *)data error:(NSError *_Nullable*_Nullable)error; @end diff --git a/IrohaCommunication/Classes/Public/Serializers/IRSerializationFactory.m b/IrohaCommunication/Classes/Public/Serializers/IRSerializationFactory.m index ee2e40951..7f97b652d 100644 --- a/IrohaCommunication/Classes/Public/Serializers/IRSerializationFactory.m +++ b/IrohaCommunication/Classes/Public/Serializers/IRSerializationFactory.m @@ -14,7 +14,7 @@ @implementation IRSerializationFactory -+ (nullable NSData*)serializeTransaction:(nonnull id)transaction error:(NSError**)error { ++ (nullable NSData *)serializeTransaction:(nonnull id)transaction error:(NSError **)error { if (![transaction conformsToProtocol:@protocol(IRProtobufTransformable)]) { if (error) { @@ -36,7 +36,7 @@ + (nullable NSData*)serializeTransaction:(nonnull id)transaction return [pbTransaction data]; } -+ (nullable NSData*)serializeQueryRequest:(nonnull id)queryRequest error:(NSError**)error { ++ (nullable NSData *)serializeQueryRequest:(nonnull id)queryRequest error:(NSError **)error { if (![queryRequest conformsToProtocol:@protocol(IRProtobufTransformable)]) { if (error) { @@ -58,7 +58,7 @@ + (nullable NSData*)serializeQueryRequest:(nonnull id)queryReque return [protobufQuery data]; } -+ (nullable id)deserializeTransactionFromData:(nonnull NSData*)data error:(NSError**)error { ++ (nullable id)deserializeTransactionFromData:(nonnull NSData *)data error:(NSError **)error { Transaction *transaction = [[Transaction alloc] initWithData:data error:error]; if (!transaction) { @@ -68,7 +68,7 @@ + (nullable NSData*)serializeQueryRequest:(nonnull id)queryReque return [IRTransaction transactionFromPbTransaction:transaction error:error]; } -+ (nullable id)deserializeQueryResponseFromData:(nonnull NSData*)data error:(NSError**)error { ++ (nullable id)deserializeQueryResponseFromData:(nonnull NSData *)data error:(NSError **)error { QueryResponse *response = [[QueryResponse alloc] initWithData:data error:error]; if (!response) { diff --git a/IrohaCommunication/Classes/Public/Service/IRNetworkService.h b/IrohaCommunication/Classes/Public/Service/IRNetworkService.h index 948785d08..1bd8323bf 100755 --- a/IrohaCommunication/Classes/Public/Service/IRNetworkService.h +++ b/IrohaCommunication/Classes/Public/Service/IRNetworkService.h @@ -21,7 +21,7 @@ typedef NS_ENUM(NSUInteger, IRNetworkServiceError) { @interface IRNetworkService : NSObject -@property(strong, nonatomic)dispatch_queue_t _Nonnull responseSerialQueue; +@property (nonatomic, strong) dispatch_queue_t _Nonnull responseSerialQueue; - (nonnull instancetype)initWithAddress:(nonnull id)address; @@ -31,7 +31,7 @@ typedef NS_ENUM(NSUInteger, IRNetworkServiceError) { - (nonnull IRPromise *)executeBatchTransactions:(nonnull NSArray>*)transactions; -- (nonnull IRPromise *)fetchTransactionStatus:(nonnull NSData*)transactionHash; +- (nonnull IRPromise *)fetchTransactionStatus:(nonnull NSData *)transactionHash; - (nonnull IRPromise*)executeQueryRequest:(nonnull id)queryRequest; diff --git a/IrohaCommunication/Classes/Public/Service/IRNetworkService.m b/IrohaCommunication/Classes/Public/Service/IRNetworkService.m index 179ad662d..7fa7d3563 100755 --- a/IrohaCommunication/Classes/Public/Service/IRNetworkService.m +++ b/IrohaCommunication/Classes/Public/Service/IRNetworkService.m @@ -18,8 +18,8 @@ @interface IRNetworkService() -@property(strong, nonatomic)CommandService_v1 *commandService; -@property(strong, nonatomic)QueryService_v1 *queryService; +@property (nonatomic, strong) CommandService_v1 *commandService; +@property (nonatomic, strong) QueryService_v1 *queryService; @end @@ -97,7 +97,7 @@ - (nonnull IRPromise *)executeBatchTransactions:(nonnull NSArray *pbTransactions = [NSMutableArray array]; - NSMutableArray *transactionHashes = [NSMutableArray array]; + NSMutableArray *transactionHashes = [NSMutableArray array]; for (NSUInteger i = 0; i < transactions.count; i++) { if (![transactions[i] conformsToProtocol:@protocol(IRProtobufTransformable)]) { @@ -149,7 +149,7 @@ - (nonnull IRPromise *)executeBatchTransactions:(nonnull NSArray)streamTransactionStatus:(nonnull NSData*)transactionHash +- (id)streamTransactionStatus:(nonnull NSData *)transactionHash withBlock:(nonnull IRTransactionStatusBlock)block { TxStatusRequest *statusRequest = [[TxStatusRequest alloc] init]; statusRequest.txHash = [transactionHash toHexString]; @@ -224,7 +224,7 @@ - (nonnull IRPromise*)executeQueryRequest:(nonnull id)queryReque } GRPCProtoCall *call = [_queryService RPCToFindWithRequest:protobufQuery - handler:^(QueryResponse* _Nullable response, NSError* _Nullable error) { + handler:^(QueryResponse* _Nullable response, NSError * _Nullable error) { if (response) { NSError *parsingError = nil; id queryResponse = [IRQueryResponseProtoFactory responseFromProtobuf:response diff --git a/IrohaCommunication/Classes/Public/Service/IRRepeatableStatusStream.h b/IrohaCommunication/Classes/Public/Service/IRRepeatableStatusStream.h index 313224a5d..4a4247656 100644 --- a/IrohaCommunication/Classes/Public/Service/IRRepeatableStatusStream.h +++ b/IrohaCommunication/Classes/Public/Service/IRRepeatableStatusStream.h @@ -17,7 +17,7 @@ typedef NS_ENUM(NSUInteger, IRTransactionStatusStreamError) { @protocol IRRepeatableStatusStreamProtocol + (nonnull IRPromise*)onTransactionStatus:(IRTransactionStatus)transactionStatus - withHash:(nonnull NSData*)transactionHash + withHash:(nonnull NSData *)transactionHash from:(nonnull id)streamable maxReconnection:(NSUInteger)trialsCount; @@ -26,7 +26,7 @@ typedef NS_ENUM(NSUInteger, IRTransactionStatusStreamError) { @interface IRRepeatableStatusStream : NSObject + (nonnull IRPromise*)onTransactionStatus:(IRTransactionStatus)transactionStatus - withHash:(nonnull NSData*)transactionHash + withHash:(nonnull NSData *)transactionHash from:(nonnull id)streamable; @end diff --git a/IrohaCommunication/Classes/Public/Service/IRRepeatableStatusStream.m b/IrohaCommunication/Classes/Public/Service/IRRepeatableStatusStream.m index d874c4d9d..32265ece5 100644 --- a/IrohaCommunication/Classes/Public/Service/IRRepeatableStatusStream.m +++ b/IrohaCommunication/Classes/Public/Service/IRRepeatableStatusStream.m @@ -10,27 +10,20 @@ @interface IRRepeatableStatusStream() -@property(strong, nonatomic)NSData * _Nonnull transactionHash; - -@property(weak, nonatomic)id _Nullable streamable; - -@property(strong, nonatomic)IRPromise * _Nullable promise; - -@property(strong, nonatomic)id _Nullable operation; - -@property(nonatomic, readonly)IRTransactionStatus expectedTransactionStatus; - -@property(nonatomic, readonly)NSUInteger maxTrialsCount; - -@property(nonatomic, readwrite)NSUInteger currentTrial; - -@property(nonatomic, strong)NSMutableArray *receivedStatuses; +@property (nonatomic, strong) NSData * _Nonnull transactionHash; +@property (nonatomic, weak) id _Nullable streamable; +@property (nonatomic, strong) IRPromise * _Nullable promise; +@property (nonatomic, strong) id _Nullable operation; +@property (nonatomic, readonly) IRTransactionStatus expectedTransactionStatus; +@property (nonatomic, readonly) NSUInteger maxTrialsCount; +@property (nonatomic, readwrite) NSUInteger currentTrial; +@property (nonatomic, strong) NSMutableArray *receivedStatuses; @end @implementation IRRepeatableStatusStream -- (instancetype)initWithTransactionHash:(nonnull NSData*)transactionHash +- (instancetype)initWithTransactionHash:(nonnull NSData *)transactionHash streamingFrom:(nonnull id)streamable expecting:(IRTransactionStatus)transactionStatus maxTrials:(NSUInteger)trialsCount { @@ -67,7 +60,7 @@ - (void)performAttempt { _operation = [_streamable streamTransactionStatus:_transactionHash withBlock:eventHandler]; } -- (void)handle:(nullable id)response done:(BOOL)done error:(nullable NSError*)error { +- (void)handle:(nullable id)response done:(BOOL)done error:(nullable NSError *)error { if (response) { if ([_receivedStatuses containsObject:@(response.status)]) { @@ -113,7 +106,7 @@ - (BOOL)isFinal:(IRTransactionStatus)status { } } -- (nonnull NSError*)prepareNotReceivedError { +- (nonnull NSError *)prepareNotReceivedError { NSString *message = [NSString stringWithFormat:@"Received statuses [%@], but waited for %@. Streaming closed", [_receivedStatuses componentsJoinedByString:@","], @(_expectedTransactionStatus)]; return [NSError errorWithDomain:NSStringFromClass([IRRepeatableStatusStream class]) diff --git a/IrohaCommunication/Classes/Public/Service/IRTransactionStatusStreamable.h b/IrohaCommunication/Classes/Public/Service/IRTransactionStatusStreamable.h index d40a25bc0..22612cd19 100644 --- a/IrohaCommunication/Classes/Public/Service/IRTransactionStatusStreamable.h +++ b/IrohaCommunication/Classes/Public/Service/IRTransactionStatusStreamable.h @@ -13,7 +13,7 @@ typedef void (^IRTransactionStatusBlock)(id _Nullab @protocol IRTransactionStatusStreamable -- (nullable id)streamTransactionStatus:(nonnull NSData*)transactionHash +- (nullable id)streamTransactionStatus:(nonnull NSData *)transactionHash withBlock:(nonnull IRTransactionStatusBlock)block; @end diff --git a/ProtoGen/Block.pbobjc.h b/ProtoGen/Block.pbobjc.h index fc25404d9..4f39f04cf 100644 --- a/ProtoGen/Block.pbobjc.h +++ b/ProtoGen/Block.pbobjc.h @@ -104,7 +104,7 @@ typedef GPB_ENUM(Block_v1_Payload_FieldNumber) { * / Needed here to be able to guarantee the client that this transaction * / was not and will never be executed. **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *rejectedTransactionsHashesArray; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *rejectedTransactionsHashesArray; /** The number of items in @c rejectedTransactionsHashesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger rejectedTransactionsHashesArray_Count; diff --git a/ProtoGen/QryResponses.pbobjc.h b/ProtoGen/QryResponses.pbobjc.h index 155538818..c4c99d8ca 100644 --- a/ProtoGen/QryResponses.pbobjc.h +++ b/ProtoGen/QryResponses.pbobjc.h @@ -252,7 +252,7 @@ typedef GPB_ENUM(AccountResponse_FieldNumber) { /** Test to see if @c account has been set. */ @property(nonatomic, readwrite) BOOL hasAccount; -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *accountRolesArray; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *accountRolesArray; /** The number of items in @c accountRolesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger accountRolesArray_Count; @@ -280,7 +280,7 @@ typedef GPB_ENUM(RolesResponse_FieldNumber) { @interface RolesResponse : GPBMessage -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *rolesArray; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *rolesArray; /** The number of items in @c rolesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger rolesArray_Count; @@ -339,7 +339,7 @@ typedef GPB_ENUM(SignatoriesResponse_FieldNumber) { @interface SignatoriesResponse : GPBMessage -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *keysArray; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *keysArray; /** The number of items in @c keysArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger keysArray_Count; diff --git a/ProtoGen/Queries.pbobjc.h b/ProtoGen/Queries.pbobjc.h index 6947b474f..1ad9fe3a9 100644 --- a/ProtoGen/Queries.pbobjc.h +++ b/ProtoGen/Queries.pbobjc.h @@ -200,7 +200,7 @@ typedef GPB_ENUM(GetTransactions_FieldNumber) { @interface GetTransactions : GPBMessage -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *txHashesArray; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *txHashesArray; /** The number of items in @c txHashesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger txHashesArray_Count; diff --git a/ProtoGen/Transaction.pbobjc.h b/ProtoGen/Transaction.pbobjc.h index 3d20cafff..92f471384 100644 --- a/ProtoGen/Transaction.pbobjc.h +++ b/ProtoGen/Transaction.pbobjc.h @@ -133,7 +133,7 @@ typedef GPB_ENUM(Transaction_Payload_BatchMeta_FieldNumber) { @property(nonatomic, readwrite) Transaction_Payload_BatchMeta_BatchType type; /** array of reduced hashes of all txs from the batch */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *reducedHashesArray; +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *reducedHashesArray; /** The number of items in @c reducedHashesArray without causing the array to be created. */ @property(nonatomic, readonly) NSUInteger reducedHashesArray_Count; diff --git a/Tests/Model/IRAccountIdTests.m b/Tests/Model/IRAccountIdTests.m index 287e6b5cc..87df9c531 100755 --- a/Tests/Model/IRAccountIdTests.m +++ b/Tests/Model/IRAccountIdTests.m @@ -7,7 +7,7 @@ @import IrohaCommunication; static const NSUInteger VALID_ACCOUNT_NAMES_COUNT = 5; -static NSString* const VALID_ACCOUNT_NAMES[] = { +static NSString * const VALID_ACCOUNT_NAMES[] = { @"bob", @"123", @"bob123bob123bob123bob123bob__123", @@ -16,7 +16,7 @@ }; static const NSUInteger INVALID_ACCOUNT_NAMES_COUNT = 5; -static NSString* const INVALID_ACCOUNT_NAMES[] = { +static NSString * const INVALID_ACCOUNT_NAMES[] = { @"", @"-", @"bOb", @@ -25,7 +25,7 @@ }; static const NSUInteger INVALID_ACCOUNT_IDENTIFIERS_COUNT = 4; -static NSString* const INVALID_ACCOUNT_IDENTIFIERS[] = { +static NSString * const INVALID_ACCOUNT_IDENTIFIERS[] = { @"", @"-", @"bOb@gmail.com", diff --git a/Tests/Model/IRAddressTests.m b/Tests/Model/IRAddressTests.m index 10bae3d9e..14d51e83b 100755 --- a/Tests/Model/IRAddressTests.m +++ b/Tests/Model/IRAddressTests.m @@ -7,7 +7,7 @@ @import IrohaCommunication; static const NSUInteger VALID_ADDRESSES_COUNT = 4; -static NSString* const VALID_IPV4[] = { +static NSString * const VALID_IPV4[] = { @"255.255.255.255", @"192.168.0.1", @"3.222.2.250", @@ -15,7 +15,7 @@ }; static const NSUInteger INVALID_ADDRESSES_COUNT = 5; -static NSString* const INVALID_IPV4[] = { +static NSString * const INVALID_IPV4[] = { @"", @"255.255.255", @"00.168.0.1", @@ -23,10 +23,10 @@ @"1.1111.1.1" }; -static NSString* const VALID_PORT = @"8080"; +static NSString * const VALID_PORT = @"8080"; static const NSUInteger INVALID_PORTS_COUNT = 4; -static NSString* const INVALID_PORTS[] = { +static NSString * const INVALID_PORTS[] = { @"", @"65356666", @"68678", diff --git a/Tests/Model/IRAssetIdTests.m b/Tests/Model/IRAssetIdTests.m index 97ea36419..794615818 100755 --- a/Tests/Model/IRAssetIdTests.m +++ b/Tests/Model/IRAssetIdTests.m @@ -7,7 +7,7 @@ @import IrohaCommunication; static const NSUInteger VALID_ASSET_NAMES_COUNT = 5; -static NSString* const VALID_ASSET_NAMES[] = { +static NSString * const VALID_ASSET_NAMES[] = { @"bob", @"123", @"bob123bob123bob123bob123bob__123", @@ -16,7 +16,7 @@ }; static const NSUInteger INVALID_ASSET_NAMES_COUNT = 5; -static NSString* const INVALID_ASSET_NAMES[] = { +static NSString * const INVALID_ASSET_NAMES[] = { @"", @"-", @"bOb", @@ -25,7 +25,7 @@ }; static const NSUInteger INVALID_ASSET_IDENTIFIERS_COUNT = 4; -static NSString* const INVALID_ASSET_IDENTIFIERS[] = { +static NSString * const INVALID_ASSET_IDENTIFIERS[] = { @"", @"-", @"bOb@gmail.com", diff --git a/Tests/Model/IRAssetPaginationTests.m b/Tests/Model/IRAssetPaginationTests.m index cd58f1248..2efff2cec 100644 --- a/Tests/Model/IRAssetPaginationTests.m +++ b/Tests/Model/IRAssetPaginationTests.m @@ -6,7 +6,7 @@ @import XCTest; @import IrohaCommunication; -static NSString* const ASSET_ID = @"test#test"; +static NSString * const ASSET_ID = @"test#test"; @interface IRAssetPaginationTests : XCTestCase diff --git a/Tests/Model/IRRoleNameTests.m b/Tests/Model/IRRoleNameTests.m index c33d74a52..84772070e 100755 --- a/Tests/Model/IRRoleNameTests.m +++ b/Tests/Model/IRRoleNameTests.m @@ -7,7 +7,7 @@ @import IrohaCommunication; static const NSUInteger VALID_ROLE_NAMES_COUNT = 6; -static NSString* const VALID_ROLE_NAMES[] = { +static NSString * const VALID_ROLE_NAMES[] = { @"test", @"admin", @"admin_test", @@ -17,7 +17,7 @@ }; static const NSUInteger INVALID_ROLE_NAMES_COUNT = 6; -static NSString* const INVALID_ROLE_NAMES[] = { +static NSString * const INVALID_ROLE_NAMES[] = { @"", @"a@dmin", @"admin-test", diff --git a/Tests/Promise/IRPromiseTests.m b/Tests/Promise/IRPromiseTests.m index ce343611f..49579eae3 100755 --- a/Tests/Promise/IRPromiseTests.m +++ b/Tests/Promise/IRPromiseTests.m @@ -93,7 +93,7 @@ - (void)testWithErrorFullfiled { }); } - currentPromise.onError(^IRPromise*(NSError* error) { + currentPromise.onError(^IRPromise*(NSError * error) { [expectation fulfill]; return nil; diff --git a/Tests/Query/IRQueryBuilderTests.m b/Tests/Query/IRQueryBuilderTests.m index 5ca515cbc..4ae19efeb 100755 --- a/Tests/Query/IRQueryBuilderTests.m +++ b/Tests/Query/IRQueryBuilderTests.m @@ -18,9 +18,9 @@ @interface IRQueryTestCase : NSObject -@property(nonatomic, readonly)SEL selector; -@property(nonatomic, readonly)NSArray *arguments; -@property(nonatomic, readonly)Protocol* protocol; +@property (nonatomic, readonly) SEL selector; +@property (nonatomic, readonly) NSArray *arguments; +@property (nonatomic, readonly) Protocol *protocol; @end diff --git a/Tests/Transaction/IRTransactionTests.m b/Tests/Transaction/IRTransactionTests.m index 0aadbae09..02f571554 100755 --- a/Tests/Transaction/IRTransactionTests.m +++ b/Tests/Transaction/IRTransactionTests.m @@ -164,7 +164,7 @@ - (void)testBatchInitialization { #pragma mark - Private -- (nullable id)createTransactionWithAllCommands:(NSError**)error { +- (nullable id)createTransactionWithAllCommands:(NSError **)error { id domain = [IRDomainFactory domainWithIdentitifer:VALID_DOMAIN error:nil]; id accountId = [IRAccountIdFactory accountIdWithName:VALID_ACCOUNT_NAME @@ -216,7 +216,7 @@ - (void)testBatchInitialization { - (nullable id)createSignedFromTransaction:(id)transaction keypair:(id)keypair - error:(NSError**)error { + error:(NSError **)error { id signatory = [[IREd25519Sha512Signer alloc] initWithPrivateKey:[keypair privateKey]]; return [transaction signedWithSignatories:@[signatory]