Skip to content

Commit 67d7ec8

Browse files
committed
release
1 parent bc69dd5 commit 67d7ec8

20 files changed

+310
-145
lines changed

BeamWallet.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4418,7 +4418,7 @@
44184418
CLANG_WARN_ENUM_CONVERSION = NO;
44194419
CODE_SIGN_ENTITLEMENTS = Resources/BeamWallet.entitlements;
44204420
CODE_SIGN_STYLE = Automatic;
4421-
CURRENT_PROJECT_VERSION = 9;
4421+
CURRENT_PROJECT_VERSION = 5;
44224422
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
44234423
DEVELOPMENT_TEAM = KNU2R94BJK;
44244424
ENABLE_BITCODE = NO;
@@ -4452,7 +4452,7 @@
44524452
"$(PROJECT_DIR)",
44534453
"$(PROJECT_DIR)/Frameworks/boost",
44544454
);
4455-
MARKETING_VERSION = 5.0;
4455+
MARKETING_VERSION = 5.1;
44564456
OTHER_LDFLAGS = (
44574457
"$(inherited)",
44584458
"-ObjC",
@@ -4493,7 +4493,7 @@
44934493
CLANG_WARN_ENUM_CONVERSION = NO;
44944494
CODE_SIGN_ENTITLEMENTS = Resources/BeamWallet.entitlements;
44954495
CODE_SIGN_STYLE = Automatic;
4496-
CURRENT_PROJECT_VERSION = 9;
4496+
CURRENT_PROJECT_VERSION = 5;
44974497
DEVELOPMENT_TEAM = KNU2R94BJK;
44984498
ENABLE_BITCODE = NO;
44994499
FRAMEWORK_SEARCH_PATHS = (
@@ -4526,7 +4526,7 @@
45264526
"$(PROJECT_DIR)",
45274527
"$(PROJECT_DIR)/Frameworks/boost",
45284528
);
4529-
MARKETING_VERSION = 5.0;
4529+
MARKETING_VERSION = 5.1;
45304530
OTHER_LDFLAGS = (
45314531
"$(inherited)",
45324532
"-ObjC",
@@ -4568,7 +4568,7 @@
45684568
CODE_SIGN_ENTITLEMENTS = Resources/BeamWalletTestNet.entitlements;
45694569
CODE_SIGN_IDENTITY = "iPhone Developer";
45704570
CODE_SIGN_STYLE = Automatic;
4571-
CURRENT_PROJECT_VERSION = 1;
4571+
CURRENT_PROJECT_VERSION = 10;
45724572
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
45734573
DEVELOPMENT_TEAM = KNU2R94BJK;
45744574
ENABLE_BITCODE = NO;
@@ -4646,7 +4646,7 @@
46464646
CODE_SIGN_ENTITLEMENTS = Resources/BeamWalletTestNet.entitlements;
46474647
CODE_SIGN_IDENTITY = "iPhone Developer";
46484648
CODE_SIGN_STYLE = Automatic;
4649-
CURRENT_PROJECT_VERSION = 1;
4649+
CURRENT_PROJECT_VERSION = 10;
46504650
DEVELOPMENT_TEAM = KNU2R94BJK;
46514651
ENABLE_BITCODE = NO;
46524652
FRAMEWORK_SEARCH_PATHS = (
@@ -4731,7 +4731,7 @@
47314731
CODE_SIGN_ENTITLEMENTS = Resources/BeamWalletMasterNet.entitlements;
47324732
CODE_SIGN_IDENTITY = "iPhone Developer";
47334733
CODE_SIGN_STYLE = Automatic;
4734-
CURRENT_PROJECT_VERSION = 43;
4734+
CURRENT_PROJECT_VERSION = 55;
47354735
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
47364736
DEVELOPMENT_TEAM = KNU2R94BJK;
47374737
ENABLE_BITCODE = NO;
@@ -4808,7 +4808,7 @@
48084808
CODE_SIGN_ENTITLEMENTS = Resources/BeamWalletMasterNet.entitlements;
48094809
CODE_SIGN_IDENTITY = "iPhone Developer";
48104810
CODE_SIGN_STYLE = Automatic;
4811-
CURRENT_PROJECT_VERSION = 43;
4811+
CURRENT_PROJECT_VERSION = 55;
48124812
DEVELOPMENT_TEAM = KNU2R94BJK;
48134813
ENABLE_BITCODE = NO;
48144814
FRAMEWORK_SEARCH_PATHS = (

BeamWallet/AppDelegate.swift

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,27 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
8686

8787

8888
if let crash = UserDefaults.standard.string(forKey: "crash"), let crash_name = UserDefaults.standard.string(forKey: "crash_name") {
89-
90-
self.window?.rootViewController?.confirmAlert(title: Localizable.shared.strings.crash_title, message: Localizable.shared.strings.crash_message, cancelTitle: Localizable.shared.strings.crash_positive, confirmTitle: Localizable.shared.strings.crash_negative, cancelHandler: { _ in
91-
92-
var name = "";
93-
94-
if Settings.sharedManager().target == Mainnet {
95-
name = "GoogleServiceMain"
96-
}
97-
else if Settings.sharedManager().target == Testnet {
98-
name = "GoogleServiceTest"
99-
}
100-
else if Settings.sharedManager().target == Masternet {
101-
name = "GoogleServiceMaster"
89+
90+
var name = "";
91+
92+
if Settings.sharedManager().target == Mainnet {
93+
name = "GoogleServiceMain"
94+
}
95+
else if Settings.sharedManager().target == Testnet {
96+
name = "GoogleServiceTest"
97+
}
98+
else if Settings.sharedManager().target == Masternet {
99+
name = "GoogleServiceMaster"
100+
}
101+
102+
if let filePath = Bundle.main.path(forResource: name, ofType: "plist") {
103+
if let options = FirebaseOptions(contentsOfFile: filePath) {
104+
FirebaseApp.configure(options: options)
102105
}
103-
//
104-
// if let filePath = Bundle.main.path(forResource: name, ofType: "plist") {
105-
// if let options = FirebaseOptions(contentsOfFile: filePath) {
106-
// FirebaseApp.configure(options: options)
107-
// }
108-
// }
109-
106+
}
107+
108+
self.window?.rootViewController?.confirmAlert(title: Localizable.shared.strings.crash_title, message: Localizable.shared.strings.crash_message, cancelTitle: Localizable.shared.strings.crash_positive, confirmTitle: Localizable.shared.strings.crash_negative, cancelHandler: { _ in
109+
110110
let ex = ExceptionModel.init(name:crash_name, reason:crash)
111111
ex.stackTrace = []
112112

@@ -124,25 +124,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
124124
if #available(iOS 13.0, *) {
125125
window?.overrideUserInterfaceStyle = Settings.sharedManager().isDarkMode ? .dark : .light
126126
}
127-
128-
var name = "";
129-
130-
if Settings.sharedManager().target == Mainnet {
131-
name = "GoogleServiceMain"
132-
}
133-
else if Settings.sharedManager().target == Testnet {
134-
name = "GoogleServiceTest"
135-
}
136-
else if Settings.sharedManager().target == Masternet {
137-
name = "GoogleServiceMaster"
138-
}
139-
140-
141-
if let filePath = Bundle.main.path(forResource: name, ofType: "plist") {
142-
if let options = FirebaseOptions(contentsOfFile: filePath) {
143-
FirebaseApp.configure(options: options)
144-
}
145-
}
127+
146128

147129
return true
148130
}

BeamWallet/BeamSDK/AppModel.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ typedef int BMRestoreType;
7676

7777
typedef void(^NewAddressGeneratedBlock)(BMAddress* _Nullable address, NSError* _Nullable error);
7878
typedef void(^ExportOwnerKey)(NSString * _Nonnull key);
79-
typedef void(^FeecalculatedBlock)(uint64_t fee);
79+
typedef void(^FeecalculatedBlock)(uint64_t fee, double change, uint64_t shieldedInputsFee);
8080

8181
@interface AppModel : NSObject
8282

@@ -188,7 +188,7 @@ typedef void(^FeecalculatedBlock)(uint64_t fee);
188188
-(void)prepareDeleteAddress:(BMAddress*_Nonnull)address removeTransactions:(BOOL)removeTransactions;
189189
-(void)cancelDeleteAddress:(NSString*_Nonnull)address;
190190
-(void)deletePreparedAddresses:(NSString*_Nonnull)address;
191-
-(void)addContact:(NSString*_Nonnull)addressId name:(NSString*_Nonnull)name categories:(NSArray*_Nonnull)categories;
191+
-(void)addContact:(NSString*_Nonnull)addressId name:(NSString*_Nonnull)name categories:(NSArray*_Nonnull)categories identidy:(NSString*_Nullable)identidy;
192192
-(BMAddress*_Nullable)findAddressByID:(NSString*_Nonnull)ID;
193193
-(BMAddress*_Nullable)findAddressByName:(NSString*_Nonnull)name;
194194

@@ -207,6 +207,7 @@ typedef void(^FeecalculatedBlock)(uint64_t fee);
207207
-(double)remaining:(double)amount fee:(double)fee;
208208
-(BMTransactionParameters*_Nonnull)getTransactionParameters:(NSString*_Nonnull)token;
209209
-(void)calculateFee:(double)amount fee:(double)fee isShielded:(BOOL) isShielded result:(FeecalculatedBlock _Nonnull )block;
210+
-(void)calculateFee2:(double)amount fee:(double)fee isShielded:(BOOL) isShielded result:(FeecalculatedBlock _Nonnull )block;
210211

211212
// logs
212213
-(NSString*_Nonnull)getZipLogs ;

BeamWallet/BeamSDK/AppModel.mm

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,8 @@ -(void)changeNotifications {
296296
-(void)setWalletStatus:(BMWalletStatus *)walletStatus {
297297
_walletStatus = walletStatus;
298298

299-
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
300-
[[NSUserDefaults standardUserDefaults] setObject:[NSKeyedArchiver archivedDataWithRootObject:self->_walletStatus] forKey:walletStatusKey];
301-
[[NSUserDefaults standardUserDefaults] synchronize];
302-
});
299+
[[NSUserDefaults standardUserDefaults] setObject:[NSKeyedArchiver archivedDataWithRootObject:self->_walletStatus] forKey:walletStatusKey];
300+
[[NSUserDefaults standardUserDefaults] synchronize];
303301
}
304302

305303
#pragma mark - Exchange
@@ -868,6 +866,12 @@ -(void)changeNodeAddress {
868866
}
869867

870868
-(BOOL)isMyAddress:(NSString*_Nullable)address {
869+
if ([self isToken:address])
870+
{
871+
BMTransactionParameters *params = [self getTransactionParameters:address];
872+
address = params.address;
873+
}
874+
871875
for (BMAddress *add in _walletAddresses) {
872876
if ([add.walletId isEqualToString:address]) {
873877
return YES;
@@ -1127,6 +1131,10 @@ -(BOOL)isValidAddress:(NSString*_Nullable)address {
11271131
return NO;
11281132
}
11291133

1134+
if (address.length < 15) {
1135+
return NO;
1136+
}
1137+
11301138
return [self isAddress:address] || [self isToken:address];
11311139
}
11321140

@@ -1232,7 +1240,8 @@ -(void)setContactComment:(NSString*)comment toAddress:(NSString*_Nonnull)address
12321240
_address.m_category = addresses[i].m_category;
12331241
_address.m_walletID = walletID;
12341242
_address.m_createTime = NSDate.date.timeIntervalSince1970;
1235-
1243+
_address.m_Identity = addresses[i].m_Identity;
1244+
12361245
try{
12371246
wallet->getAsync()->saveAddress(_address, false);
12381247
}
@@ -1571,11 +1580,16 @@ -(void)editCategoryAddress:(BMAddress*_Nonnull)address {
15711580
WalletID walletID(Zero);
15721581
if (walletID.FromHex(address.walletId.string))
15731582
{
1583+
bool isValid = false;
1584+
auto buf = from_hex(contact.address.identity.string, &isValid);
1585+
PeerID m_Identity = Blob(buf);
1586+
15741587
WalletAddress _address;
15751588
_address.m_label = address.label.string;
15761589
_address.m_category = [address.categories componentsJoinedByString:@","].string;
15771590
_address.m_walletID = walletID;
15781591
_address.m_createTime = NSDate.date.timeIntervalSince1970;
1592+
_address.m_Identity = m_Identity;
15791593
walletDb->saveAddress(_address);
15801594
}
15811595
}
@@ -1604,10 +1618,15 @@ -(void)editAddress:(BMAddress*_Nonnull)address {
16041618
WalletID walletID(Zero);
16051619
if (walletID.FromHex(address.walletId.string))
16061620
{
1621+
bool isValid = false;
1622+
auto buf = from_hex(contact.address.identity.string, &isValid);
1623+
PeerID m_Identity = Blob(buf);
1624+
16071625
WalletAddress _address;
16081626
_address.m_label = address.label.string;
16091627
_address.m_category = [address.categories componentsJoinedByString:@","].string;
16101628
_address.m_walletID = walletID;
1629+
_address.m_Identity = m_Identity;
16111630
_address.m_createTime = NSDate.date.timeIntervalSince1970;
16121631
walletDb->saveAddress(_address);
16131632
}
@@ -1657,6 +1676,8 @@ -(void)editAddress:(BMAddress*_Nonnull)address {
16571676
}
16581677
}
16591678

1679+
// NSString *s = [NSString stringWithUTF8String:to_string(addresses[i].m_Identity).c_str()];
1680+
16601681
wallet->getAsync()->saveAddress(addresses[i], true);
16611682

16621683
break;
@@ -1685,15 +1706,21 @@ -(NSString*_Nonnull)generateQRCodeString:(NSString*_Nonnull)address amount:(NSSt
16851706
return qrString;
16861707
}
16871708

1688-
-(void)addContact:(NSString*_Nonnull)addressId name:(NSString*_Nonnull)name categories:(NSArray*_Nonnull)categories {
1709+
-(void)addContact:(NSString*_Nonnull)addressId name:(NSString*_Nonnull)name categories:(NSArray*_Nonnull)categories identidy:(NSString*_Nullable)identidy {
16891710

16901711
WalletID walletID(Zero);
16911712
if (walletID.FromHex(addressId.string))
1692-
{
1713+
{
16931714
WalletAddress address;
16941715
address.m_label = name.string;
16951716
address.m_category = [categories componentsJoinedByString:@","].string;
16961717
address.m_walletID = walletID;
1718+
if (identidy!=nil) {
1719+
bool isValid = false;
1720+
auto buf = from_hex(identidy.string, &isValid);
1721+
PeerID m_Identity = Blob(buf);
1722+
address.m_Identity = m_Identity;
1723+
}
16971724
address.m_createTime = NSDate.date.timeIntervalSince1970;
16981725
walletDb->saveAddress(address);
16991726
}
@@ -1864,6 +1891,16 @@ -(void)calculateFee:(double)amount fee:(double)fee isShielded:(BOOL) isShielded
18641891
wallet->getAsync()->calcShieldedCoinSelectionInfo(bAmount, bFee, isShielded);
18651892
}
18661893

1894+
-(void)calculateFee2:(double)amount fee:(double)fee isShielded:(BOOL) isShielded result:(FeecalculatedBlock _Nonnull )block {
1895+
1896+
self.feecalculatedBlock = block;
1897+
1898+
Amount bAmount = round(amount * Rules::Coin);
1899+
Amount bFee = fee;
1900+
1901+
wallet->getAsync()->calcShieldedCoinSelectionInfo(bAmount, bFee, isShielded);
1902+
}
1903+
18671904
-(NSString*)sendError:(double)amount fee:(double)fee checkMinAmount:(BOOL)check {
18681905

18691906
Amount bAmount = round(amount * Rules::Coin);

BeamWallet/BeamSDK/Objects/BMTransaction.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,12 @@ -(NSString*)textDetails {
601601
}
602602
else if(_isIncome)
603603
{
604-
sender = [NSString stringWithFormat:@"%@\n%@",[[@"contact" localized]uppercaseString], _senderAddress];
604+
if (self.enumType == BMTransactionTypePushTransaction) {
605+
sender = [NSString stringWithFormat:@"%@\n%@",[[@"contact" localized]uppercaseString], [@"shielded_pool" localized]];
606+
}
607+
else {
608+
sender = [NSString stringWithFormat:@"%@\n%@",[[@"contact" localized]uppercaseString], _senderAddress];
609+
}
605610
receiver = [NSString stringWithFormat:@"%@\n%@",[[@"my_address" localized]uppercaseString], _receiverAddress];
606611
}
607612
else{
@@ -618,7 +623,9 @@ -(NSString*)textDetails {
618623
[details addObject:amount];
619624
[details addObject:sender];
620625
[details addObject:receiver];
621-
[details addObject:fee];
626+
if (_realFee > 0) {
627+
[details addObject:fee];
628+
}
622629
[details addObject:trid];
623630

624631
if(_identity.length > 0){

BeamWallet/BeamSDK/WalletModel.mm

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@
439439
address.label = [NSString stringWithUTF8String:walletAddr.m_label.c_str()];
440440
address.walletId = [NSString stringWithUTF8String:to_string(walletAddr.m_walletID).c_str()];
441441
address.categories = (categories.length == 0 ? [NSMutableArray new] : [NSMutableArray arrayWithArray:[categories componentsSeparatedByString:@","]]);
442+
address.identity = [NSString stringWithUTF8String:to_string(walletAddr.m_Identity).c_str()];
442443

443444
BMContact *contact = [[BMContact alloc] init];
444445
contact.address = address;
@@ -1102,7 +1103,15 @@
11021103
void WalletModel::onShieldedCoinsSelectionCalculated(const ShieldedCoinsSelectionInfo& selectionRes)
11031104
{
11041105
auto result = selectionRes.minimalFee;
1105-
[AppModel sharedManager].feecalculatedBlock(result);
1106+
auto change = selectionRes.change;
1107+
auto shieldedInputsFee = selectionRes.shieldedInputsFee;
1108+
1109+
// if (change > 0) {
1110+
// change = change + selectionRes.selectedFee; //+ selectionRes.requestedFee;
1111+
// }
1112+
double amount = double(int64_t(change)) / Rules::Coin;
1113+
1114+
[AppModel sharedManager].feecalculatedBlock(result, amount, shieldedInputsFee);
11061115

11071116
NSLog(@"onShieldedCoinsSelectionCalculated");
11081117
}

0 commit comments

Comments
 (0)