Skip to content

Commit dd0a8e3

Browse files
authored
Merge pull request #497 from dashpay/develop
chore: Merge develop in master
2 parents 842c4ec + d96601d commit dd0a8e3

File tree

9 files changed

+38
-33
lines changed

9 files changed

+38
-33
lines changed

DashSync.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
3434
s.ios.framework = 'UIKit'
3535
s.macos.framework = 'Cocoa'
3636
s.compiler_flags = '-Wno-comma'
37-
s.dependency 'DashSharedCore', '0.4.7'
37+
s.dependency 'DashSharedCore', '0.4.8'
3838
s.dependency 'CocoaLumberjack', '3.7.2'
3939
s.ios.dependency 'DWAlertController', '0.2.1'
4040
s.dependency 'DSDynamicOptions', '0.1.2'

DashSync/shared/Models/Derivation Paths/DSAuthenticationKeysDerivationPath.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ + (instancetype)providerOwnerKeysDerivationPathForChain:(DSChain *)chain {
8383
+ (instancetype)providerOperatorKeysDerivationPathForChain:(DSChain *)chain {
8484
UInt256 indexes[] = {uint256_from_long(FEATURE_PURPOSE), uint256_from_long(chain_coin_type(chain.chainType)), uint256_from_long(3), uint256_from_long(3)};
8585
BOOL hardenedIndexes[] = {YES, YES, YES, YES};
86-
return [DSAuthenticationKeysDerivationPath derivationPathWithIndexes:indexes hardened:hardenedIndexes length:4 type:DSDerivationPathType_SingleUserAuthentication signingAlgorithm:[chain activeBLSType] reference:DSDerivationPathReference_ProviderOperatorKeys onChain:chain];
86+
return [DSAuthenticationKeysDerivationPath derivationPathWithIndexes:indexes hardened:hardenedIndexes length:4 type:DSDerivationPathType_SingleUserAuthentication signingAlgorithm:KeyKind_BLS reference:DSDerivationPathReference_ProviderOperatorKeys onChain:chain];
8787
}
8888

8989
+ (instancetype)platformNodeKeysDerivationPathForChain:(DSChain *)chain {
@@ -107,7 +107,7 @@ + (instancetype)blockchainIdentityECDSAKeysDerivationPathForChain:(DSChain *)cha
107107
+ (instancetype)blockchainIdentityBLSKeysDerivationPathForChain:(DSChain *)chain {
108108
UInt256 indexes[] = {uint256_from_long(FEATURE_PURPOSE), uint256_from_long(chain_coin_type(chain.chainType)), uint256_from_long(FEATURE_PURPOSE_IDENTITIES), uint256_from_long(FEATURE_PURPOSE_IDENTITIES_SUBFEATURE_AUTHENTICATION), uint256_from_long(1)};
109109
BOOL hardenedIndexes[] = {YES, YES, YES, YES, YES};
110-
DSAuthenticationKeysDerivationPath *blockchainIdentityBLSKeysDerivationPath = [DSAuthenticationKeysDerivationPath derivationPathWithIndexes:indexes hardened:hardenedIndexes length:5 type:DSDerivationPathType_MultipleUserAuthentication signingAlgorithm:[chain activeBLSType] reference:DSDerivationPathReference_BlockchainIdentities onChain:chain];
110+
DSAuthenticationKeysDerivationPath *blockchainIdentityBLSKeysDerivationPath = [DSAuthenticationKeysDerivationPath derivationPathWithIndexes:indexes hardened:hardenedIndexes length:5 type:DSDerivationPathType_MultipleUserAuthentication signingAlgorithm:/*[chain activeBLSType]*/KeyKind_BLS reference:DSDerivationPathReference_BlockchainIdentities onChain:chain];
111111
blockchainIdentityBLSKeysDerivationPath.shouldStoreExtendedPrivateKey = YES;
112112
blockchainIdentityBLSKeysDerivationPath.usesHardenedKeys = YES;
113113
return blockchainIdentityBLSKeysDerivationPath;

DashSync/shared/Models/Derivation Paths/DSDerivationPath.m

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,19 +256,27 @@ - (NSData *)extendedPublicKeyData {
256256
return nil;
257257
}
258258

259+
- (void)maybeRevertBLSMigration:(NSData *)extendedPublicKeyData {
260+
// revert
261+
// for those who already migrated from legacy to basic BLS derivation scheme
262+
// we revert back their extended public key to legacy
263+
BOOL isBasicBLS = self.signingAlgorithm == KeyKind_BLSBasic;
264+
if (isBasicBLS) {
265+
_extendedPublicKey = key_bls_migrate_from_basic_extended_public_key_data(extendedPublicKeyData.bytes, extendedPublicKeyData.length);
266+
if (_extendedPublicKey) {
267+
setKeychainData([DSKeyManager extendedPublicKeyData:_extendedPublicKey], [self standaloneExtendedPublicKeyLocationString], NO);
268+
}
269+
}
270+
}
271+
259272
- (OpaqueKey *)extendedPublicKey {
260273
if (!_extendedPublicKey) {
261274
if (self.wallet && (self.length || self.reference == DSDerivationPathReference_Root)) {
262275
NSData *extendedPublicKeyData = getKeychainData([self walletBasedExtendedPublicKeyLocationString], nil);
263276
if (extendedPublicKeyData) {
277+
NoTimeLog(@"_extendedPublicKey (%d) = %@", self.signingAlgorithm, extendedPublicKeyData.hexString);
264278
_extendedPublicKey = key_create_from_extended_public_key_data(extendedPublicKeyData.bytes, extendedPublicKeyData.length, (int16_t) self.signingAlgorithm);
265-
if (!_extendedPublicKey && self.signingAlgorithm == KeyKind_BLSBasic) {
266-
// Migrate BLS key from keychain: legacy -> basic
267-
_extendedPublicKey = key_bls_migrate_from_legacy_extended_public_key_data(extendedPublicKeyData.bytes, extendedPublicKeyData.length);
268-
if (_extendedPublicKey) {
269-
setKeychainData([DSKeyManager extendedPublicKeyData:_extendedPublicKey], [self standaloneExtendedPublicKeyLocationString], NO);
270-
}
271-
}
279+
[self maybeRevertBLSMigration:extendedPublicKeyData];
272280
NSAssert(_extendedPublicKey, @"extended public key not set");
273281
}
274282
} else {
@@ -293,11 +301,9 @@ - (OpaqueKey *)extendedPublicKey {
293301
}
294302
}
295303
#endif
304+
NoTimeLog(@"_extendedPublicKey (%d) = %@", self.signingAlgorithm, extendedPublicKeyData.hexString);
296305
_extendedPublicKey = key_create_from_extended_public_key_data(extendedPublicKeyData.bytes, extendedPublicKeyData.length, (int16_t) self.signingAlgorithm);
297-
if (!_extendedPublicKey && self.signingAlgorithm == KeyKind_BLSBasic) {
298-
// Migrate BLS key from keychain: legacy -> basic
299-
_extendedPublicKey = key_bls_migrate_from_legacy_extended_public_key_data(extendedPublicKeyData.bytes, extendedPublicKeyData.length);
300-
}
306+
[self maybeRevertBLSMigration:extendedPublicKeyData];
301307
}
302308
}
303309
return _extendedPublicKey;

DashSync/shared/Models/Masternode/DSLocalMasternode.m

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,8 @@ - (void)registrationTransactionFundedByAccount:(DSAccount *)fundingAccount toAdd
492492
} else {
493493
operatorKey = [providerOperatorKeysDerivationPath publicKeyDataAtIndex:self.operatorWalletIndex].UInt384;
494494
}
495-
496-
DSProviderRegistrationTransaction *providerRegistrationTransaction;
497-
if ([self.chain isMainnet]) {
498-
providerRegistrationTransaction = [[DSProviderRegistrationTransaction alloc] initWithProviderRegistrationTransactionVersion:1 type:0 mode:0 collateralOutpoint:collateral ipAddress:self.ipAddress port:self.port ownerKeyHash:ownerKeyHash operatorKey:operatorKey votingKeyHash:votingKeyHash platformNodeID:UINT160_ZERO operatorReward:0 scriptPayout:script onChain:fundingAccount.wallet.chain];
499-
} else {
500-
providerRegistrationTransaction = [[DSProviderRegistrationTransaction alloc] initWithProviderRegistrationTransactionVersion:2 type:0 mode:0 collateralOutpoint:collateral ipAddress:self.ipAddress port:self.port ownerKeyHash:ownerKeyHash operatorKey:operatorKey votingKeyHash:votingKeyHash platformNodeID:platformNodeID operatorReward:0 scriptPayout:script onChain:fundingAccount.wallet.chain];
501-
}
495+
uint16_t operatorKeyVersion = providerOperatorKeysDerivationPath.signingAlgorithm == KeyKind_BLS ? 1 : 2;
496+
DSProviderRegistrationTransaction *providerRegistrationTransaction = [[DSProviderRegistrationTransaction alloc] initWithProviderRegistrationTransactionVersion:2 type:0 mode:0 collateralOutpoint:collateral ipAddress:self.ipAddress port:self.port ownerKeyHash:ownerKeyHash operatorKey:operatorKey operatorKeyVersion:operatorKeyVersion votingKeyHash:votingKeyHash platformNodeID:platformNodeID operatorReward:0 scriptPayout:script onChain:fundingAccount.wallet.chain];
502497
if (dsutxo_is_zero(collateral)) {
503498
NSString *holdingAddress = [providerFundsDerivationPath receiveAddress];
504499
NSData *scriptPayout = [DSKeyManager scriptPubKeyForAddress:holdingAddress forChain:self.holdingKeysWallet.chain];

DashSync/shared/Models/Transactions/Provider/DSProviderRegistrationTransaction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ NS_ASSUME_NONNULL_BEGIN
4646
@property (nonatomic, assign) UInt160 platformNodeID;
4747
@property (nullable, nonatomic, readonly) NSString *platformNodeAddress;
4848

49-
- (instancetype)initWithInputHashes:(NSArray *)hashes inputIndexes:(NSArray *)indexes inputScripts:(NSArray *)scripts inputSequences:(NSArray *)inputSequences outputAddresses:(NSArray *)addresses outputAmounts:(NSArray *)amounts providerRegistrationTransactionVersion:(uint16_t)version type:(uint16_t)providerType mode:(uint16_t)providerMode collateralOutpoint:(DSUTXO)collateralOutpoint ipAddress:(UInt128)ipAddress port:(uint16_t)port ownerKeyHash:(UInt160)ownerKeyHash operatorKey:(UInt384)operatorKey votingKeyHash:(UInt160)votingKeyHash operatorReward:(uint16_t)operatorReward scriptPayout:(NSData *)scriptPayout onChain:(DSChain *)chain;
49+
- (instancetype)initWithInputHashes:(NSArray *)hashes inputIndexes:(NSArray *)indexes inputScripts:(NSArray *)scripts inputSequences:(NSArray *)inputSequences outputAddresses:(NSArray *)addresses outputAmounts:(NSArray *)amounts providerRegistrationTransactionVersion:(uint16_t)version type:(uint16_t)providerType mode:(uint16_t)providerMode collateralOutpoint:(DSUTXO)collateralOutpoint ipAddress:(UInt128)ipAddress port:(uint16_t)port ownerKeyHash:(UInt160)ownerKeyHash operatorKey:(UInt384)operatorKey operatorKeyVersion:(uint16_t)operatorKeyVersion votingKeyHash:(UInt160)votingKeyHash operatorReward:(uint16_t)operatorReward scriptPayout:(NSData *)scriptPayout onChain:(DSChain *)chain;
5050

51-
- (instancetype)initWithProviderRegistrationTransactionVersion:(uint16_t)version type:(uint16_t)providerType mode:(uint16_t)providerMode collateralOutpoint:(DSUTXO)collateralOutpoint ipAddress:(UInt128)ipAddress port:(uint16_t)port ownerKeyHash:(UInt160)ownerKeyHash operatorKey:(UInt384)operatorKey votingKeyHash:(UInt160)votingKeyHash platformNodeID:(UInt160)platformNodeID operatorReward:(uint16_t)operatorReward scriptPayout:(NSData *)scriptPayout onChain:(DSChain *)chain;
51+
- (instancetype)initWithProviderRegistrationTransactionVersion:(uint16_t)version type:(uint16_t)providerType mode:(uint16_t)providerMode collateralOutpoint:(DSUTXO)collateralOutpoint ipAddress:(UInt128)ipAddress port:(uint16_t)port ownerKeyHash:(UInt160)ownerKeyHash operatorKey:(UInt384)operatorKey operatorKeyVersion:(uint16_t)operatorKeyVersion votingKeyHash:(UInt160)votingKeyHash platformNodeID:(UInt160)platformNodeID operatorReward:(uint16_t)operatorReward scriptPayout:(NSData *)scriptPayout onChain:(DSChain *)chain;
5252

5353
- (void)updateInputsHash;
5454

DashSync/shared/Models/Transactions/Provider/DSProviderRegistrationTransaction.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ - (instancetype)initWithMessage:(NSData *)message onChain:(DSChain *)chain {
119119
}
120120

121121

122-
- (instancetype)initWithProviderRegistrationTransactionVersion:(uint16_t)version type:(uint16_t)providerType mode:(uint16_t)providerMode collateralOutpoint:(DSUTXO)collateralOutpoint ipAddress:(UInt128)ipAddress port:(uint16_t)port ownerKeyHash:(UInt160)ownerKeyHash operatorKey:(UInt384)operatorKey votingKeyHash:(UInt160)votingKeyHash platformNodeID:(UInt160)platformNodeID operatorReward:(uint16_t)operatorReward scriptPayout:(NSData *)scriptPayout onChain:(DSChain *)chain {
122+
- (instancetype)initWithProviderRegistrationTransactionVersion:(uint16_t)version type:(uint16_t)providerType mode:(uint16_t)providerMode collateralOutpoint:(DSUTXO)collateralOutpoint ipAddress:(UInt128)ipAddress port:(uint16_t)port ownerKeyHash:(UInt160)ownerKeyHash operatorKey:(UInt384)operatorKey operatorKeyVersion:(uint16_t)operatorKeyVersion votingKeyHash:(UInt160)votingKeyHash platformNodeID:(UInt160)platformNodeID operatorReward:(uint16_t)operatorReward scriptPayout:(NSData *)scriptPayout onChain:(DSChain *)chain {
123123
NSParameterAssert(scriptPayout);
124124
NSParameterAssert(chain);
125125

@@ -134,6 +134,7 @@ - (instancetype)initWithProviderRegistrationTransactionVersion:(uint16_t)version
134134
self.port = port;
135135
self.ownerKeyHash = ownerKeyHash;
136136
self.operatorKey = operatorKey;
137+
self.operatorKeyVersion = operatorKeyVersion;
137138
self.votingKeyHash = votingKeyHash;
138139
self.platformNodeID = platformNodeID;
139140
self.operatorReward = operatorReward;
@@ -142,7 +143,7 @@ - (instancetype)initWithProviderRegistrationTransactionVersion:(uint16_t)version
142143
return self;
143144
}
144145

145-
- (instancetype)initWithInputHashes:(NSArray *)hashes inputIndexes:(NSArray *)indexes inputScripts:(NSArray *)scripts inputSequences:(NSArray *)inputSequences outputAddresses:(NSArray *)addresses outputAmounts:(NSArray *)amounts providerRegistrationTransactionVersion:(uint16_t)version type:(uint16_t)providerType mode:(uint16_t)providerMode collateralOutpoint:(DSUTXO)collateralOutpoint ipAddress:(UInt128)ipAddress port:(uint16_t)port ownerKeyHash:(UInt160)ownerKeyHash operatorKey:(UInt384)operatorKey votingKeyHash:(UInt160)votingKeyHash operatorReward:(uint16_t)operatorReward scriptPayout:(NSData *)scriptPayout onChain:(DSChain *_Nonnull)chain {
146+
- (instancetype)initWithInputHashes:(NSArray *)hashes inputIndexes:(NSArray *)indexes inputScripts:(NSArray *)scripts inputSequences:(NSArray *)inputSequences outputAddresses:(NSArray *)addresses outputAmounts:(NSArray *)amounts providerRegistrationTransactionVersion:(uint16_t)version type:(uint16_t)providerType mode:(uint16_t)providerMode collateralOutpoint:(DSUTXO)collateralOutpoint ipAddress:(UInt128)ipAddress port:(uint16_t)port ownerKeyHash:(UInt160)ownerKeyHash operatorKey:(UInt384)operatorKey operatorKeyVersion:(uint16_t)operatorKeyVersion votingKeyHash:(UInt160)votingKeyHash operatorReward:(uint16_t)operatorReward scriptPayout:(NSData *)scriptPayout onChain:(DSChain *_Nonnull)chain {
146147
NSParameterAssert(hashes);
147148
NSParameterAssert(indexes);
148149
NSParameterAssert(scripts);
@@ -163,6 +164,7 @@ - (instancetype)initWithInputHashes:(NSArray *)hashes inputIndexes:(NSArray *)in
163164
self.port = port;
164165
self.ownerKeyHash = ownerKeyHash;
165166
self.operatorKey = operatorKey;
167+
self.operatorKeyVersion = operatorKeyVersion;
166168
self.votingKeyHash = votingKeyHash;
167169
self.operatorReward = operatorReward;
168170
self.scriptPayout = scriptPayout;

Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
def common_pods
2-
# pod 'DashSharedCore', :git => 'https://github.com/dashpay/dash-shared-core.git', :branch => 'fix/bls-bindings'
2+
# pod 'DashSharedCore', :git => 'https://github.com/dashpay/dash-shared-core.git', :branch => 'fix/revert-bls-legacy-scheme-derivation'
33
# pod 'DashSharedCore', :git => 'https://github.com/dashpay/dash-shared-core.git', :commit => '27157c7'
44
pod 'DashSync', :path => '../'
55
pod 'SDWebImage', '5.14.3'

Example/Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -586,11 +586,11 @@ PODS:
586586
- "!ProtoCompiler-gRPCPlugin (~> 1.0)"
587587
- DAPI-GRPC/Messages
588588
- gRPC-ProtoRPC
589-
- DashSharedCore (0.4.7)
589+
- DashSharedCore (0.4.8)
590590
- DashSync (0.1.0):
591591
- CocoaLumberjack (= 3.7.2)
592592
- DAPI-GRPC (= 0.22.0-dev.8)
593-
- DashSharedCore (= 0.4.7)
593+
- DashSharedCore (= 0.4.8)
594594
- DSDynamicOptions (= 0.1.2)
595595
- DWAlertController (= 0.2.1)
596596
- TinyCborObjc (= 0.4.6)
@@ -712,8 +712,8 @@ SPEC CHECKSUMS:
712712
CocoaImageHashing: 8656031d0899abe6c1c415827de43e9798189c53
713713
CocoaLumberjack: b7e05132ff94f6ae4dfa9d5bce9141893a21d9da
714714
DAPI-GRPC: 138d62523bbfe7e88a39896f1053c0bc12390d9f
715-
DashSharedCore: c33567249c4bf4166609d828e5b45cacf41b784c
716-
DashSync: bc3998e01da4f74bfb8fc9d4637d8a291704a8a9
715+
DashSharedCore: cc87193cfc09b816c5f472b50174cc76e41668b1
716+
DashSync: d53609a65e3965d246f68244883062093c0bbee6
717717
DSDynamicOptions: 347cc5d2c4e080eb3de6a86719ad3d861b82adfc
718718
DWAlertController: 5f4cd8adf90336331c054857f709f5f8d4b16a5b
719719
gRPC: 64f36d689b2ecd99c4351f74e6f91347cdc65d9f
@@ -726,6 +726,6 @@ SPEC CHECKSUMS:
726726
tinycbor: d4d71dddda1f8392fbb4249f63faf8552f327590
727727
TinyCborObjc: 5204540fb90ff0c40fb22d408fa51bab79d78a80
728728

729-
PODFILE CHECKSUM: 4a6ed5ed41963191295a38fad9760424b46ae9a9
729+
PODFILE CHECKSUM: 65ee9c6b1d7ae6ab3bc40337f53a5135ff99a2f1
730730

731731
COCOAPODS: 1.12.1

Example/Tests/DSProviderTransactionsTests.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ - (void)testCollateralProviderRegistrationTransaction {
148148
OpaqueKey *ownerKey = [providerOwnerKeysDerivationPath privateKeyAtIndex:0 fromSeed:seed];
149149
UInt160 votingKeyHash = [providerVotingKeysDerivationPath publicKeyDataAtIndex:0].hash160;
150150
UInt384 operatorKey = [providerOperatorKeysDerivationPath publicKeyDataAtIndex:0].UInt384;
151+
uint16_t operatorKeyVersion = 1; // BLS legacy
151152
NSData *scriptPayout = [DSKeyManager scriptPubKeyForAddress:payoutAddress forChain:chain];
152153

153154
UInt128 ipAddress = {.u32 = {0, 0, CFSwapInt32HostToBig(0xffff), 0}};
@@ -159,7 +160,7 @@ - (void)testCollateralProviderRegistrationTransaction {
159160

160161
NSData *inputScript = [DSKeyManager scriptPubKeyForAddress:inputAddress0 forChain:chain];
161162

162-
DSProviderRegistrationTransaction *providerRegistrationTransaction = [[DSProviderRegistrationTransaction alloc] initWithInputHashes:@[inputTransactionHashValue] inputIndexes:@[@1] inputScripts:@[inputScript] inputSequences:@[@(TXIN_SEQUENCE)] outputAddresses:@[outputAddress0] outputAmounts:@[@40777037710] providerRegistrationTransactionVersion:1 type:0 mode:0 collateralOutpoint:reversedCollateral ipAddress:ipAddress port:19999 ownerKeyHash:[DSKeyManager publicKeyData:ownerKey].hash160 operatorKey:operatorKey votingKeyHash:votingKeyHash operatorReward:0 scriptPayout:scriptPayout onChain:chain];
163+
DSProviderRegistrationTransaction *providerRegistrationTransaction = [[DSProviderRegistrationTransaction alloc] initWithInputHashes:@[inputTransactionHashValue] inputIndexes:@[@1] inputScripts:@[inputScript] inputSequences:@[@(TXIN_SEQUENCE)] outputAddresses:@[outputAddress0] outputAmounts:@[@40777037710] providerRegistrationTransactionVersion:1 type:0 mode:0 collateralOutpoint:reversedCollateral ipAddress:ipAddress port:19999 ownerKeyHash:[DSKeyManager publicKeyData:ownerKey].hash160 operatorKey:operatorKey operatorKeyVersion:operatorKeyVersion votingKeyHash:votingKeyHash operatorReward:0 scriptPayout:scriptPayout onChain:chain];
163164

164165

165166
providerRegistrationTransaction.payloadSignature = signatureData;
@@ -242,6 +243,7 @@ - (void)testNoCollateralProviderRegistrationTransaction {
242243
UInt160 votingKeyHash = [providerVotingKeysDerivationPath publicKeyDataAtIndex:0].hash160;
243244
UInt384 operatorKey = [providerOperatorKeysDerivationPath publicKeyDataAtIndex:0].UInt384;
244245

246+
uint16_t operatorKeyVersion = 1; // BLS legacy
245247
DSProviderRegistrationTransaction *providerRegistrationTransactionFromMessage = [[DSProviderRegistrationTransaction alloc] initWithMessage:hexData onChain:chain];
246248

247249
XCTAssertEqualObjects(providerRegistrationTransactionFromMessage.toData, hexData, @"Provider transaction does not match it's data");
@@ -263,7 +265,7 @@ - (void)testNoCollateralProviderRegistrationTransaction {
263265
[DSKeyManager scriptPubKeyForAddress:inputAddress2 forChain:chain]
264266
];
265267

266-
DSProviderRegistrationTransaction *providerRegistrationTransaction = [[DSProviderRegistrationTransaction alloc] initWithInputHashes:inputHashes inputIndexes:inputIndexes inputScripts:inputScripts inputSequences:@[@(TXIN_SEQUENCE), @(TXIN_SEQUENCE), @(TXIN_SEQUENCE)] outputAddresses:@[outputAddress0, outputAddress1] outputAmounts:@[@100000000000, @10110995523] providerRegistrationTransactionVersion:1 type:0 mode:0 collateralOutpoint:DSUTXO_ZERO ipAddress:ipAddress port:19999 ownerKeyHash:[DSKeyManager publicKeyData:ownerKey].hash160 operatorKey:operatorKey votingKeyHash:votingKeyHash operatorReward:0 scriptPayout:scriptPayout onChain:wallet.chain];
268+
DSProviderRegistrationTransaction *providerRegistrationTransaction = [[DSProviderRegistrationTransaction alloc] initWithInputHashes:inputHashes inputIndexes:inputIndexes inputScripts:inputScripts inputSequences:@[@(TXIN_SEQUENCE), @(TXIN_SEQUENCE), @(TXIN_SEQUENCE)] outputAddresses:@[outputAddress0, outputAddress1] outputAmounts:@[@100000000000, @10110995523] providerRegistrationTransactionVersion:1 type:0 mode:0 collateralOutpoint:DSUTXO_ZERO ipAddress:ipAddress port:19999 ownerKeyHash:[DSKeyManager publicKeyData:ownerKey].hash160 operatorKey:operatorKey operatorKeyVersion:operatorKeyVersion votingKeyHash:votingKeyHash operatorReward:0 scriptPayout:scriptPayout onChain:wallet.chain];
267269

268270

269271
[providerRegistrationTransaction updateInputsHash];

0 commit comments

Comments
 (0)