Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Russel <[email protected]>
  • Loading branch information
Andrei Marin authored and ERussel committed Sep 12, 2019
1 parent 8cb4e17 commit 3a0e2fc
Show file tree
Hide file tree
Showing 131 changed files with 547 additions and 538 deletions.
6 changes: 3 additions & 3 deletions IntegrationTests/IrohaContainer/IRIrohaContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 10 additions & 10 deletions IntegrationTests/IrohaContainer/IRIrohaContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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]]) {
Expand Down Expand Up @@ -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
Expand All @@ -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]]) {
Expand Down Expand Up @@ -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]]) {
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
22 changes: 11 additions & 11 deletions IntegrationTests/Scenarious/IRAccountRestoreWithBatchTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

@interface IRAccountRestoreWithBatchTest : IRBaseIrohaContainerTests

@property(strong, nonatomic)id<IRRoleName> userRole;
@property(strong, nonatomic)id<IRDomain> bankDomain;
@property(strong, nonatomic)id<IRDomain> recoveryDomain;
@property(strong, nonatomic)id<IRAccountId> recoveryAccount;
@property(strong, nonatomic)id<IRCryptoKeypairProtocol> recoveryKeypair;
@property(strong, nonatomic)id<IRSignatureCreatorProtocol> recoverySigner;
@property(strong, nonatomic)id<IRAccountId> clientAccount;
@property(strong, nonatomic)id<IRCryptoKeypairProtocol> clientKeypair;
@property(strong, nonatomic)id<IRSignatureCreatorProtocol> clientSigner;
@property (strong, nonatomic) id<IRRoleName> userRole;
@property (strong, nonatomic) id<IRDomain> bankDomain;
@property (strong, nonatomic) id<IRDomain> recoveryDomain;
@property (strong, nonatomic) id<IRAccountId> recoveryAccount;
@property (strong, nonatomic) id<IRCryptoKeypairProtocol> recoveryKeypair;
@property (strong, nonatomic) id<IRSignatureCreatorProtocol> recoverySigner;
@property (strong, nonatomic) id<IRAccountId> clientAccount;
@property (strong, nonatomic) id<IRCryptoKeypairProtocol> clientKeypair;
@property (strong, nonatomic) id<IRSignatureCreatorProtocol> clientSigner;

@end

Expand Down Expand Up @@ -71,7 +71,7 @@ - (void)testAccountRestoreScenarioWithoutBatch {
[expectation fulfill];

return nil;
}).onError(^IRPromise* _Nullable (NSError* error) {
}).onError(^IRPromise* _Nullable (NSError * error) {
XCTFail(@"%@", error);

[expectation fulfill];
Expand Down Expand Up @@ -105,7 +105,7 @@ - (void)testAccountRestoreScenarioWithBatch {
[expectation fulfill];

return nil;
}).onError(^IRPromise* _Nullable (NSError* error) {
}).onError(^IRPromise* _Nullable (NSError * error) {
XCTFail(@"%@", error);

[expectation fulfill];
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/Scenarious/IRCreateAccountTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ - (void)testCreateAccount {
[expectation fulfill];

return nil;
}).onError(^IRPromise * _Nullable(NSError* error) {
}).onError(^IRPromise * _Nullable(NSError * error) {
XCTFail();
NSLog(@"%@",error);

Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/Scenarious/IRCreateDomainTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/Scenarious/IRCreateRoleTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ - (void)testCreateRoleRejected {
[expectation fulfill];

return nil;
}).onError(^IRPromise* _Nullable (NSError* error) {
}).onError(^IRPromise* _Nullable (NSError * error) {
XCTFail();
NSLog(@"%@",error);

Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/Scenarious/IRGetAccountDetailTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ - (void)testGetAccountDetailInSeveralPages {
[expectation fulfill];

return nil;
}).onError(^IRPromise * _Nullable(NSError* error) {
}).onError(^IRPromise * _Nullable(NSError * error) {
XCTFail();
NSLog(@"%@",error);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ - (nonnull instancetype)initWithAssetId:(nonnull id<IRAssetId>)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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@interface IRSetAccountDetail : NSObject<IRSetAccountDetail, IRProtobufTransformable>

- (nonnull instancetype)initWithAccountId:(nonnull id<IRAccountId>)accountId
key:(nonnull NSString*)key
value:(nonnull NSString*)value;
key:(nonnull NSString *)key
value:(nonnull NSString *)value;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ @implementation IRSetAccountDetail
@synthesize value = _value;

- (nonnull instancetype)initWithAccountId:(nonnull id<IRAccountId>)accountId
key:(nonnull NSString*)key
value:(nonnull NSString*)value {
key:(nonnull NSString *)key
value:(nonnull NSString *)value {

if (self = [super init]) {
_accountId = accountId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- (nonnull instancetype)initWithSourceAccountId:(nonnull id<IRAccountId>)sourceAccountId
destinationAccountId:(nonnull id<IRAccountId>)destinationAccountId
assetId:(nonnull id<IRAssetId>)assetId
transferDescription:(nonnull NSString*)transferDescription
transferDescription:(nonnull NSString *)transferDescription
amount:(nonnull id<IRAmount>)amount;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ @implementation IRTransferAsset
- (nonnull instancetype)initWithSourceAccountId:(nonnull id<IRAccountId>)sourceAccountId
destinationAccountId:(nonnull id<IRAccountId>)destinationAccountId
assetId:(nonnull id<IRAssetId>)assetId
transferDescription:(nonnull NSString*)transferDescription
transferDescription:(nonnull NSString *)transferDescription
amount:(nonnull id<IRAmount>)amount {

if (self = [super init]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef NS_ENUM(NSUInteger, IRQueryRequestError) {
@interface IRBlockQueryRequest : NSObject<IRBlockQueryRequest, IRProtobufTransformable>

- (nonnull instancetype)initWithCreator:(nonnull id<IRAccountId>)creator
createdAt:(nonnull NSDate*)createdAt
createdAt:(nonnull NSDate *)createdAt
queryCounter:(UInt64)queryCounter
peerSignature:(nullable id<IRPeerSignature>)peerSignature;

Expand Down
12 changes: 6 additions & 6 deletions IrohaCommunication/Classes/Private/IRBlockQueryRequestImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ @implementation IRBlockQueryRequest
@synthesize peerSignature = _peerSignature;

- (nonnull instancetype)initWithCreator:(nonnull id<IRAccountId>)creator
createdAt:(nonnull NSDate*)createdAt
createdAt:(nonnull NSDate *)createdAt
queryCounter:(UInt64)queryCounter
peerSignature:(nullable id<IRPeerSignature>)peerSignature {

Expand All @@ -35,7 +35,7 @@ - (nonnull instancetype)initWithCreator:(nonnull id<IRAccountId>)creator

- (nullable instancetype)signedWithSignatory:(nonnull id<IRSignatureCreatorProtocol>)signatory
signatoryPublicKey:(nonnull id<IRPublicKeyProtocol>)signatoryPublicKey
error:(NSError**)error {
error:(NSError **)error {

id<IRPeerSignature> peerSignature = [self signWithSignatory:signatory
signatoryPublicKey:signatoryPublicKey
Expand Down Expand Up @@ -78,7 +78,7 @@ - (nullable instancetype)signedWithSignatory:(nonnull id<IRSignatureCreatorProto

#pragma mark - Protobuf Transformables

- (nullable id)transform:(NSError*_Nullable*_Nullable)error {
- (nullable id)transform:(NSError *_Nullable*_Nullable)error {
QueryPayloadMeta *payload = [self createPayload:error];

if (!payload) {
Expand All @@ -101,7 +101,7 @@ - (nullable id)transform:(NSError*_Nullable*_Nullable)error {

#pragma mark - Private

- (nullable QueryPayloadMeta*)createPayload:(NSError**)error {
- (nullable QueryPayloadMeta*)createPayload:(NSError **)error {
QueryPayloadMeta *meta = [[QueryPayloadMeta alloc] init];
meta.creatorAccountId = [_creator identifier];
meta.createdTime = [_createdAt milliseconds];
Expand All @@ -112,7 +112,7 @@ - (nullable QueryPayloadMeta*)createPayload:(NSError**)error {

- (nullable id<IRSignatureProtocol>)signPayload:(nonnull QueryPayloadMeta*)payload
signatory:(nonnull id<IRSignatureCreatorProtocol>)signatory
error:(NSError**)error {
error:(NSError **)error {
NSData *payloadData = [payload data];

if (!payloadData) {
Expand Down Expand Up @@ -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}];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@protocol IRProtobufTransformable <NSObject>

- (nullable id)transform:(NSError*_Nullable*_Nullable)error;
- (nullable id)transform:(NSError *_Nullable*_Nullable)error;

@end

Expand Down
2 changes: 1 addition & 1 deletion IrohaCommunication/Classes/Private/IRQueryRequestImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef NS_ENUM(NSUInteger, IRQueryRequestError) {
@interface IRQueryRequest : NSObject<IRQueryRequest, IRProtobufTransformable>

- (nonnull instancetype)initWithCreator:(nonnull id<IRAccountId>)creator
createdAt:(nonnull NSDate*)createdAt
createdAt:(nonnull NSDate *)createdAt
query:(nonnull id<IRQuery>)query
queryCounter:(UInt64)queryCounter
peerSignature:(nullable id<IRPeerSignature>)peerSignature;
Expand Down
12 changes: 6 additions & 6 deletions IrohaCommunication/Classes/Private/IRQueryRequestImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ @implementation IRQueryRequest
@synthesize peerSignature = _peerSignature;

- (nonnull instancetype)initWithCreator:(nonnull id<IRAccountId>)creator
createdAt:(nonnull NSDate*)createdAt
createdAt:(nonnull NSDate *)createdAt
query:(nonnull id<IRQuery>)query
queryCounter:(UInt64)queryCounter
peerSignature:(nullable id<IRPeerSignature>)peerSignature {
Expand All @@ -38,7 +38,7 @@ - (nonnull instancetype)initWithCreator:(nonnull id<IRAccountId>)creator

- (nullable instancetype)signedWithSignatory:(nonnull id<IRSignatureCreatorProtocol>)signatory
signatoryPublicKey:(nonnull id<IRPublicKeyProtocol>)signatoryPublicKey
error:(NSError**)error {
error:(NSError **)error {

id<IRPeerSignature> peerSignature = [self signWithSignatory:signatory
signatoryPublicKey:signatoryPublicKey
Expand Down Expand Up @@ -82,7 +82,7 @@ - (nullable instancetype)signedWithSignatory:(nonnull id<IRSignatureCreatorProto

#pragma mark - Protobuf Transformables

- (nullable id)transform:(NSError*_Nullable*_Nullable)error {
- (nullable id)transform:(NSError *_Nullable*_Nullable)error {
Query_Payload *payload = [self createPayload:error];

if (!payload) {
Expand All @@ -105,7 +105,7 @@ - (nullable id)transform:(NSError*_Nullable*_Nullable)error {

#pragma mark - Private

- (nullable Query_Payload*)createPayload:(NSError**)error {
- (nullable Query_Payload*)createPayload:(NSError **)error {
if (![_query conformsToProtocol:@protocol(IRProtobufTransformable)]) {
if (error) {
NSString *message = [NSString stringWithFormat:@"%@ query must conform %@",
Expand Down Expand Up @@ -136,7 +136,7 @@ - (nullable Query_Payload*)createPayload:(NSError**)error {

- (nullable id<IRSignatureProtocol>)signPayload:(nonnull Query_Payload*)payload
signatory:(nonnull id<IRSignatureCreatorProtocol>)signatory
error:(NSError**)error {
error:(NSError **)error {
NSData *payloadData = [payload data];

if (!payloadData) {
Expand Down Expand Up @@ -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}];
Expand Down
2 changes: 1 addition & 1 deletion IrohaCommunication/Classes/Private/IRQueryResponse+Proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ typedef NS_ENUM(NSUInteger, IRQueryResponseFactoryError) {
@interface IRQueryResponseProtoFactory : NSObject

+ (nullable id<IRQueryResponse>)responseFromProtobuf:(nonnull QueryResponse*)pbResponse
error:(NSError*_Nullable*_Nullable)error;
error:(NSError *_Nullable*_Nullable)error;

@end
Loading

0 comments on commit 3a0e2fc

Please sign in to comment.