Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a7e815f
chore: dirty
pankcuf Jan 10, 2025
91855ab
chore: new portion of requests
pankcuf Jan 14, 2025
d6f726d
chore: switch onto remote dash-shared-core
pankcuf Jan 14, 2025
b5a52c9
chore: fix dtor
pankcuf Jan 20, 2025
50c8926
feat: doc requests
pankcuf Jan 29, 2025
66a868a
chore: remove old DAPI deps
pankcuf Jan 30, 2025
a2905f3
chore: dashpay continuation (sync with identities/usernames/profiles …
pankcuf Feb 6, 2025
2c6d6f6
chore: cleanup
pankcuf Feb 10, 2025
f13c8ad
chore: continuation (fix identity key dictionary)
pankcuf Feb 13, 2025
9535a57
chore: fix flag descriptors
pankcuf Feb 13, 2025
3056edf
chore: stream contact requests
pankcuf Feb 13, 2025
40e83d1
chore: tmp commit
pankcuf Feb 28, 2025
af4cf45
chore: start (before merge with bindings)
pankcuf Mar 5, 2025
1b087bc
chore: continuation
pankcuf Mar 14, 2025
4431af1
chore: continuation
pankcuf Mar 14, 2025
93fb368
chore: continuation
pankcuf Mar 19, 2025
b868973
Merge branch 'develop' into feat/merge-with-coinjoin
pankcuf Mar 19, 2025
7705823
chore: compilation sucess
pankcuf Mar 21, 2025
c3aeb2d
chore: warnings
pankcuf Mar 21, 2025
51dcda8
chore: remove unused
pankcuf Mar 21, 2025
487bf1f
chore: cleanup
pankcuf Mar 21, 2025
d3ca8b4
chore: cleanup
pankcuf Mar 21, 2025
18c655c
chore: cleanup
pankcuf Mar 21, 2025
baacd7a
chore: cleanup
pankcuf Mar 24, 2025
43de8f6
chore: cleanup
pankcuf Mar 24, 2025
45a1e73
chore: cleanup
pankcuf Mar 24, 2025
3a18462
chore: some dtors/cleanup
pankcuf Mar 24, 2025
f085f08
fix: restore incoming funds account flow
pankcuf Mar 24, 2025
ef8c110
fix: revive coinjoin test
pankcuf Mar 24, 2025
b776325
chore: add SMLError conversion
pankcuf Mar 25, 2025
442e433
chore: update masternode stuff as for rust-dashcore v0.39.1
pankcuf Mar 25, 2025
c5dbd55
chore: comment block removal logs
pankcuf Mar 25, 2025
83a70f8
chore: some debug options
pankcuf Mar 25, 2025
7293bda
chore: test address with gaps
pankcuf Mar 25, 2025
2484530
Merge branch 'develop' into feat/merge-with-coinjoin
pankcuf Mar 25, 2025
e649fc7
chore: update podspec
pankcuf Mar 25, 2025
ada4a2b
chore: cleanup
pankcuf Mar 25, 2025
f3d6111
chore: cleanup
pankcuf Mar 25, 2025
685afc5
chore: cleanup
pankcuf Mar 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "dashsync/crypto/secp256k1"]
path = dashsync/crypto/secp256k1
url = https://github.com/bitcoin-core/secp256k1.git
[submodule "platform"]
path = platform
url = https://github.com/dashevo/platform.git
81 changes: 0 additions & 81 deletions DAPI-GRPC.podspec

This file was deleted.

4 changes: 1 addition & 3 deletions DashSync.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.homepage = 'https://github.com/dashevo/dashsync-ios.git'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'quantumexplorer' => 'quantum@dash.org' }
s.source = { :git => 'https://github.com/dashevo/dashsync-iOS.git', :tag => s.version.to_s }
s.source = { :git => 'https://github.com/dashpay/dashsync-iOS.git', :tag => s.version.to_s }

s.ios.deployment_target = '13.0'
s.osx.deployment_target = '10.15'
Expand All @@ -38,8 +38,6 @@ Pod::Spec.new do |s|
s.dependency 'CocoaLumberjack', '3.7.2'
s.ios.dependency 'DWAlertController', '0.2.1'
s.dependency 'DSDynamicOptions', '0.1.2'
s.dependency 'DAPI-GRPC', '0.22.0-dev.8'
s.dependency 'TinyCborObjc', '0.4.6'
s.prefix_header_contents = '#import "DSEnvironment.h"'

end
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ @interface DSBasePinViewController ()
@implementation DSBasePinViewController

+ (NSString *)defaultTitle {
return [NSString stringWithFormat:DSLocalizedString(@"PIN for %@", nil), DISPLAY_NAME];
return DSLocalizedFormat(@"PIN for %@", nil, DISPLAY_NAME);
}

- (void)viewDidLoad {
Expand Down
1 change: 1 addition & 0 deletions DashSync/shared/Categories/BigIntTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ typedef uint32_t (^_Nullable BlockHeightFinder)(UInt256 blockHash);
#define uint768_hex(u) [NSData dataWithUInt768:u].hexString
#define uint768_reverse_hex(u) [NSData dataWithUInt768:u].reverse.hexString
#define ecpoint_hex(u) [NSData dataWithBytes:u.p length:sizeof(DSECPoint)].hexString
#define dsutxo_hex(u) [NSData dataWithBytes:u.p length:sizeof(DSUTXO)].hexString
#define uint256_reverse(u) [NSData dataWithUInt256:u].reverse.UInt256

#define uint256_from_int(u) ((UInt256){.u32 = {u, 0, 0, 0, 0, 0, 0, 0}})
Expand Down
33 changes: 33 additions & 0 deletions DashSync/shared/Categories/NSArray+Dash.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//

#import "BigIntTypes.h"
#import "dash_spv_apple_bindings.h"
#import "DSKeyManager.h"
#import "NSData+Dash.h"
#import <Foundation/Foundation.h>

Expand All @@ -23,4 +25,35 @@ NS_ASSUME_NONNULL_BEGIN

@end

@interface NSArray (_)
+ (NSArray<NSString *> *)ffi_from_vec:(Vec_ *)ffi_ref;
+ (Vec_ *)ffi_to_vec:(NSArray<NSString *> *)obj;
+ (void)ffi_destroy_vec:(Vec_ *)ffi_ref;
@end

@interface NSArray (Vec_String)
+ (NSArray<NSString *> *)ffi_from_vec_of_string:(Vec_String *)ffi_ref;
+ (Vec_String *)ffi_to_vec_of_string:(NSArray<NSString *> *)obj;
+ (void)ffi_destroy_vec_of_string:(Vec_String *)ffi_ref;
@end

@interface NSArray (Vec_u8_32)
+ (NSArray<NSData *> *)ffi_from_vec_u256:(Vec_u8_32 *)ffi_ref;
+ (Vec_u8_32 *)ffi_to_vec_u256:(NSArray<NSData *> *)obj;
+ (void)ffi_destroy_vec_u256:(Vec_u8_32 *)ffi_ref;
@end

@interface NSArray (Vec_Vec_u8)
+ (NSArray<NSData *> *)ffi_from_vec_vec_u8:(Vec_Vec_u8 *)ffi_ref;
+ (Vec_Vec_u8 *)ffi_to_vec_vec_u8:(NSArray<NSData *> *)obj;
+ (void)ffi_destroy_vec_vec_u8:(Vec_Vec_u8 *)ffi_ref;
@end

@interface NSArray (std_collections_BTreeSet_dashcore_hash_types_BlockHash)
+ (NSArray<NSData *> *)ffi_from_block_hash_btree_set:(std_collections_BTreeSet_dashcore_hash_types_BlockHash *)ffi_ref;
+ (std_collections_BTreeSet_dashcore_hash_types_BlockHash *)ffi_to_block_hash_btree_set:(NSArray<NSData *> *)obj;
+ (void)ffi_destroy_block_hash_btree_set:(std_collections_BTreeSet_dashcore_hash_types_BlockHash *)ffi_ref;
@end


NS_ASSUME_NONNULL_END
114 changes: 114 additions & 0 deletions DashSync/shared/Categories/NSArray+Dash.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,117 @@ - (NSArray *)map:(id (^)(id obj))block {
}

@end

@implementation NSArray (_)

+ (NSArray<NSString *> *)ffi_from_vec:(Vec_ *)ffi_ref {
NSMutableArray<NSString *> *arr = [NSMutableArray arrayWithCapacity:ffi_ref->count];
for (int i = 0; i < ffi_ref->count; i++) {
[arr addObject:[NSString stringWithUTF8String:ffi_ref->values[i]]];
}
return arr;
}
+ (Vec_ *)ffi_to_vec:(NSArray<NSString *> *)obj {
NSUInteger count = obj.count;
char **values = malloc(count * sizeof(char *));
for (NSUInteger i = 0; i < count; i++) {
values[i] = strdup([obj[i] UTF8String]);
}
return Vec__ctor(count, values);
}
+ (void)ffi_destroy_vec:(Vec_ *)ffi_ref {
Vec__destroy(ffi_ref);
}
@end

@implementation NSArray (Vec_String)

+ (NSArray<NSString *> *)ffi_from_vec_of_string:(Vec_String *)ffi_ref {
NSMutableArray<NSString *> *arr = [NSMutableArray arrayWithCapacity:ffi_ref->count];
for (int i = 0; i < ffi_ref->count; i++) {
[arr addObject:[NSString stringWithUTF8String:ffi_ref->values[i]]];
}
return arr;
}
+ (Vec_String *)ffi_to_vec_of_string:(NSArray<NSString *> *)obj {
NSUInteger count = obj.count;
char **values = malloc(count * sizeof(char *));
for (NSUInteger i = 0; i < count; i++) {
values[i] = strdup([obj[i] UTF8String]);
}
return Vec_String_ctor(count, values);
}
+ (void)ffi_destroy_vec_of_string:(Vec_String *)ffi_ref {
Vec_String_destroy(ffi_ref);
}
@end

@implementation NSArray (Vec_u8_32)

+ (NSArray<NSData *> *)ffi_from_vec_u256:(Vec_u8_32 *)ffi_ref {
NSMutableArray<NSData *> *arr = [NSMutableArray arrayWithCapacity:ffi_ref->count];
for (int i = 0; i < ffi_ref->count; i++) {
[arr addObject:NSDataFromPtr(ffi_ref->values[i])];
}
return arr;
}
+ (Vec_u8_32 *)ffi_to_vec_u256:(NSArray<NSData *> *)obj {
NSUInteger count = obj.count;
u256 **values = malloc(count * sizeof(u256 *));
for (NSUInteger i = 0; i < count; i++) {
values[i] = u256_ctor(obj[i]);
}
return Vec_u8_32_ctor(count, values);
}
+ (void)ffi_destroy_vec_u256:(Vec_u8_32 *)ffi_ref {
Vec_u8_32_destroy(ffi_ref);
}
@end

@implementation NSArray (Vec_Vec_u8)

+ (NSArray<NSData *> *)ffi_from_vec_vec_u8:(Vec_Vec_u8 *)ffi_ref {
NSMutableArray<NSData *> *arr = [NSMutableArray arrayWithCapacity:ffi_ref->count];
for (int i = 0; i < ffi_ref->count; i++) {
[arr addObject:NSDataFromPtr(ffi_ref->values[i])];
}
return arr;
}
+ (Vec_Vec_u8 *)ffi_to_vec_vec_u8:(NSArray<NSData *> *)obj {
NSUInteger count = obj.count;
Vec_u8 **values = malloc(sizeof(Vec_u8 *) * count);
for (int i = 0; i < count; i++) {
values[i] = bytes_ctor(obj[i]);
}
return Vec_Vec_u8_ctor(count, values);
}
+ (void)ffi_destroy_vec_vec_u8:(Vec_Vec_u8 *)ffi_ref {
Vec_Vec_u8_destroy(ffi_ref);
}
@end

@implementation NSArray (std_collections_BTreeSet_dashcore_hash_types_BlockHash)

+ (NSArray<NSData *> *)ffi_from_block_hash_btree_set:(std_collections_BTreeSet_dashcore_hash_types_BlockHash *)ffi_ref {
NSMutableArray<NSData *> *arr = [NSMutableArray arrayWithCapacity:ffi_ref->count];
for (int i = 0; i < ffi_ref->count; i++) {
u256 *block_hash = dashcore_hash_types_BlockHash_inner(ffi_ref->values[i]);
NSData *blockHashData = NSDataFromPtr(block_hash);
u256_dtor(block_hash);
[arr addObject:blockHashData];
}
return arr;
}
+ (std_collections_BTreeSet_dashcore_hash_types_BlockHash *)ffi_to_block_hash_btree_set:(NSArray<NSData *> *)obj {
NSUInteger count = obj.count;
DBlockHash **values = malloc(sizeof(DBlockHash *) * count);
for (int i = 0; i < count; i++) {
values[i] = dashcore_hash_types_BlockHash_ctor(u256_ctor(obj[i]));
}
return std_collections_BTreeSet_dashcore_hash_types_BlockHash_ctor(count, values);
}
+ (void)ffi_destroy_block_hash_btree_set:(std_collections_BTreeSet_dashcore_hash_types_BlockHash *)ffi_ref {
std_collections_BTreeSet_dashcore_hash_types_BlockHash_destroy(ffi_ref);
}
@end

8 changes: 6 additions & 2 deletions DashSync/shared/Categories/NSData/NSData+DSHash.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import "dash_shared_core.h"
#import "dash_spv_apple_bindings.h"
#import "DSKeyManager.h"
#import "NSData+DSHash.h"

@implementation NSData (DSHash)

- (NSData *)blake3Data {
return [DSKeyManager NSDataFrom:processor_blake3(self.bytes, self.length)];
Slice_u8 *slice = slice_ctor(self);
u256 *result = dash_spv_crypto_blake3(slice);
NSData *data = NSDataFromPtr(result);
u256_dtor(result);
return data;
}


Expand Down
6 changes: 3 additions & 3 deletions DashSync/shared/Categories/NSData/NSData+DSMerkAVLTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
// limitations under the License.
//

#import "DSDAPIPlatformNetworkServiceProtocol.h"
//#import "DSDAPIPlatformNetworkServiceProtocol.h"
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class DSPlatformTreeQuery;
//@class DSPlatformTreeQuery;

@interface NSData (DSMerkAVLTree)

/* executeProofReturnElementDictionary returns items from the proof that match the specific query, if no query is set all
items are returned.
*/
- (NSData *_Nullable)executeProofReturnElementDictionary:(NSDictionary *_Nonnull *_Nullable)rElementDictionary query:(DSPlatformTreeQuery *_Nullable)query decode:(BOOL)decode usesVersion:(BOOL)usesVersion error:(NSError **)error;
//- (NSData *_Nullable)executeProofReturnElementDictionary:(NSDictionary *_Nonnull *_Nullable)rElementDictionary query:(DSPlatformTreeQuery *_Nullable)query decode:(BOOL)decode usesVersion:(BOOL)usesVersion error:(NSError **)error;

@end

Expand Down
Loading