pshenmic-dpp 1.0.19 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,7 +60,7 @@ export const masternodevotetransitionwasm_fromStateTransition: (a: number, b: nu
60
60
  export const __wbg_identitycreatetransitionwasm_free: (a: number, b: number) => void;
61
61
  export const identitycreatetransitionwasm_type_name: (a: number, b: number) => void;
62
62
  export const identitycreatetransitionwasm_struct_name: (a: number) => void;
63
- export const identitycreatetransitionwasm_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
63
+ export const identitycreatetransitionwasm_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
64
64
  export const identitycreatetransitionwasm_default: (a: number, b: number) => void;
65
65
  export const identitycreatetransitionwasm_fromHex: (a: number, b: number, c: number) => void;
66
66
  export const identitycreatetransitionwasm_fromBase64: (a: number, b: number, c: number) => void;
@@ -236,6 +236,7 @@ export const chainassetlockproofwasm_set_core_chain_locked_height: (a: number, b
236
236
  export const chainassetlockproofwasm_set_out_point: (a: number, b: number) => void;
237
237
  export const chainassetlockproofwasm_get_core_chain_locked_height: (a: number) => number;
238
238
  export const chainassetlockproofwasm_get_out_point: (a: number) => number;
239
+ export const chainassetlockproofwasm_createIdentityId: (a: number) => number;
239
240
  export const __wbg_instantlockwasm_free: (a: number, b: number) => void;
240
241
  export const instantlockwasm_type_name: (a: number, b: number) => void;
241
242
  export const instantlockwasm_struct_name: (a: number) => void;
@@ -264,6 +265,7 @@ export const instantassetlockproofwasm_set_output_index: (a: number, b: number)
264
265
  export const instantassetlockproofwasm_set_instant_lock: (a: number, b: number) => void;
265
266
  export const instantassetlockproofwasm_getTransaction: (a: number, b: number) => void;
266
267
  export const instantassetlockproofwasm_getInstantLockBytes: (a: number, b: number) => void;
268
+ export const instantassetlockproofwasm_createIdentityId: (a: number, b: number) => void;
267
269
  export const __wbg_outpointwasm_free: (a: number, b: number) => void;
268
270
  export const outpointwasm_type_name: (a: number, b: number) => void;
269
271
  export const outpointwasm_struct_name: (a: number) => void;
@@ -297,7 +299,10 @@ export const assetlockproofwasm_getLockType: (a: number, b: number) => void;
297
299
  export const assetlockproofwasm_getInstantLockProof: (a: number) => number;
298
300
  export const assetlockproofwasm_getChainLockProof: (a: number) => number;
299
301
  export const assetlockproofwasm_getOutPoint: (a: number) => number;
302
+ export const assetlockproofwasm_createIdentityId: (a: number, b: number) => void;
300
303
  export const assetlockproofwasm_toObject: (a: number, b: number) => void;
304
+ export const assetlockproofwasm_hex: (a: number, b: number) => void;
305
+ export const assetlockproofwasm_fromHex: (a: number, b: number, c: number) => void;
301
306
  export const __wbg_identitywasm_free: (a: number, b: number) => void;
302
307
  export const identitywasm_type_name: (a: number, b: number) => void;
303
308
  export const identitywasm_struct_name: (a: number) => void;
@@ -628,20 +633,20 @@ export const batchtransitionwasm_fromBase64: (a: number, b: number, c: number) =
628
633
  export const batchtransitionwasm_fromHex: (a: number, b: number, c: number) => void;
629
634
  export const tokenfreezetransitionwasm_new: (a: number, b: number, c: number, d: number, e: number) => void;
630
635
  export const tokenunfreezetransitionwasm_new: (a: number, b: number, c: number, d: number, e: number) => void;
636
+ export const __wbg_tokenunfreezetransitionwasm_free: (a: number, b: number) => void;
631
637
  export const __wbg_tokenfreezetransitionwasm_free: (a: number, b: number) => void;
632
- export const __wbg_documentdeletetransitionwasm_free: (a: number, b: number) => void;
633
638
  export const __wbg_documentupdatepricetransitionwasm_free: (a: number, b: number) => void;
634
- export const __wbg_tokenunfreezetransitionwasm_free: (a: number, b: number) => void;
639
+ export const __wbg_documentdeletetransitionwasm_free: (a: number, b: number) => void;
635
640
  export const __wbg_tokenemergencyactiontransitionwasm_free: (a: number, b: number) => void;
636
- export const tokenunfreezetransitionwasm_get_base: (a: number) => number;
637
641
  export const tokenemergencyactiontransitionwasm_get_base: (a: number) => number;
642
+ export const tokenfreezetransitionwasm_get_base: (a: number) => number;
643
+ export const tokenunfreezetransitionwasm_get_base: (a: number) => number;
638
644
  export const documentupdatepricetransitionwasm_get_price: (a: number) => bigint;
639
645
  export const documentupdatepricetransitionwasm_get_base: (a: number) => number;
640
- export const tokenfreezetransitionwasm_get_base: (a: number) => number;
646
+ export const tokenemergencyactiontransitionwasm_set_base: (a: number, b: number) => void;
641
647
  export const tokenunfreezetransitionwasm_set_base: (a: number, b: number) => void;
642
648
  export const documentupdatepricetransitionwasm_set_price: (a: number, b: bigint) => void;
643
649
  export const tokenfreezetransitionwasm_set_base: (a: number, b: number) => void;
644
- export const tokenemergencyactiontransitionwasm_set_base: (a: number, b: number) => void;
645
650
  export const __wbg_privateencryptednotewasm_free: (a: number, b: number) => void;
646
651
  export const privateencryptednotewasm_type_name: (a: number, b: number) => void;
647
652
  export const privateencryptednotewasm_struct_name: (a: number) => void;
@@ -1047,73 +1052,74 @@ export const __wbg_set_distributioninvertedlogarithmicwasm_n: (a: number, b: big
1047
1052
  export const __wbg_set_distributioninvertedlogarithmicwasm_o: (a: number, b: bigint) => void;
1048
1053
  export const __wbg_set_distributioninvertedlogarithmicwasm_b: (a: number, b: bigint) => void;
1049
1054
  export const __wbg_set_timebaseddistributionwasm_interval: (a: number, b: bigint) => void;
1055
+ export const __wbg_set_distributionpolynomialwasm_startMoment: (a: number, b: number, c: bigint) => void;
1056
+ export const __wbg_set_distributionlogarithmicwasm_startMoment: (a: number, b: number, c: bigint) => void;
1057
+ export const __wbg_distributionpolynomialwasm_free: (a: number, b: number) => void;
1058
+ export const __wbg_set_distributionrandomwasm_min: (a: number, b: bigint) => void;
1059
+ export const __wbg_get_distributionrandomwasm_min: (a: number) => bigint;
1060
+ export const __wbg_set_distributionlinearwasm_startStep: (a: number, b: number, c: bigint) => void;
1061
+ export const __wbg_distributionlogarithmicwasm_free: (a: number, b: number) => void;
1062
+ export const __wbg_set_distributionstepdecreasingamountwasm_startDecreasingOffset: (a: number, b: number, c: bigint) => void;
1063
+ export const __wbg_set_distributioninvertedlogarithmicwasm_startMoment: (a: number, b: number, c: bigint) => void;
1064
+ export const __wbg_distributioninvertedlogarithmicwasm_free: (a: number, b: number) => void;
1065
+ export const __wbg_get_distributionstepdecreasingamountwasm_minValue: (a: number, b: number) => void;
1066
+ export const __wbg_get_distributionstepdecreasingamountwasm_startDecreasingOffset: (a: number, b: number) => void;
1067
+ export const __wbg_get_distributionlinearwasm_maxValue: (a: number, b: number) => void;
1068
+ export const __wbg_get_distributionlinearwasm_minValue: (a: number, b: number) => void;
1069
+ export const __wbg_get_distributionlinearwasm_startingAmount: (a: number) => bigint;
1070
+ export const __wbg_get_distributionlinearwasm_startStep: (a: number, b: number) => void;
1071
+ export const __wbg_get_distributionlinearwasm_d: (a: number) => bigint;
1072
+ export const __wbg_get_distributionlinearwasm_a: (a: number) => bigint;
1050
1073
  export const __wbg_get_distributionlogarithmicwasm_maxValue: (a: number, b: number) => void;
1051
1074
  export const __wbg_get_distributionlogarithmicwasm_minValue: (a: number, b: number) => void;
1052
1075
  export const __wbg_get_distributionlogarithmicwasm_b: (a: number) => bigint;
1053
- export const __wbg_set_distributionlogarithmicwasm_startMoment: (a: number, b: number, c: bigint) => void;
1076
+ export const __wbg_get_distributionlogarithmicwasm_startMoment: (a: number, b: number) => void;
1054
1077
  export const __wbg_get_distributionlogarithmicwasm_o: (a: number) => bigint;
1055
1078
  export const __wbg_get_distributionlogarithmicwasm_n: (a: number) => bigint;
1056
1079
  export const __wbg_get_distributionlogarithmicwasm_m: (a: number) => bigint;
1057
1080
  export const __wbg_get_distributionlogarithmicwasm_d: (a: number) => bigint;
1058
1081
  export const __wbg_get_distributionlogarithmicwasm_a: (a: number) => bigint;
1059
- export const __wbg_get_distributionlinearwasm_maxValue: (a: number, b: number) => void;
1060
- export const __wbg_get_distributionlinearwasm_minValue: (a: number, b: number) => void;
1061
- export const __wbg_get_distributionlinearwasm_startingAmount: (a: number) => bigint;
1062
- export const __wbg_set_distributionlinearwasm_startStep: (a: number, b: number, c: bigint) => void;
1063
- export const __wbg_get_distributionlinearwasm_d: (a: number) => bigint;
1064
- export const __wbg_get_distributionlinearwasm_a: (a: number) => bigint;
1065
- export const __wbg_get_distributioninvertedlogarithmicwasm_maxValue: (a: number, b: number) => void;
1066
- export const __wbg_get_distributioninvertedlogarithmicwasm_minValue: (a: number, b: number) => void;
1067
- export const __wbg_get_distributioninvertedlogarithmicwasm_b: (a: number) => bigint;
1068
- export const __wbg_set_distributioninvertedlogarithmicwasm_startMoment: (a: number, b: number, c: bigint) => void;
1069
- export const __wbg_get_distributioninvertedlogarithmicwasm_o: (a: number) => bigint;
1070
- export const __wbg_get_distributioninvertedlogarithmicwasm_n: (a: number) => bigint;
1071
- export const __wbg_get_distributioninvertedlogarithmicwasm_m: (a: number) => bigint;
1072
- export const __wbg_get_distributioninvertedlogarithmicwasm_d: (a: number) => bigint;
1073
- export const __wbg_get_distributioninvertedlogarithmicwasm_a: (a: number) => bigint;
1074
- export const __wbg_set_distributionrandomwasm_min: (a: number, b: bigint) => void;
1075
- export const __wbg_get_distributionstepdecreasingamountwasm_minValue: (a: number, b: number) => void;
1076
- export const __wbg_set_distributionstepdecreasingamountwasm_startDecreasingOffset: (a: number, b: number, c: bigint) => void;
1082
+ export const __wbg_get_timebaseddistributionwasm_interval: (a: number) => bigint;
1077
1083
  export const __wbg_get_distributionpolynomialwasm_maxValue: (a: number, b: number) => void;
1078
1084
  export const __wbg_get_distributionpolynomialwasm_minValue: (a: number, b: number) => void;
1079
1085
  export const __wbg_get_distributionpolynomialwasm_b: (a: number) => bigint;
1080
- export const __wbg_set_distributionpolynomialwasm_startMoment: (a: number, b: number, c: bigint) => void;
1086
+ export const __wbg_get_distributionpolynomialwasm_startMoment: (a: number, b: number) => void;
1081
1087
  export const __wbg_get_distributionpolynomialwasm_o: (a: number) => bigint;
1082
1088
  export const __wbg_get_distributionpolynomialwasm_n: (a: number) => bigint;
1083
1089
  export const __wbg_get_distributionpolynomialwasm_m: (a: number) => bigint;
1084
1090
  export const __wbg_get_distributionpolynomialwasm_d: (a: number) => bigint;
1085
1091
  export const __wbg_get_distributionpolynomialwasm_a: (a: number) => bigint;
1086
- export const __wbg_get_distributionpolynomialwasm_startMoment: (a: number, b: number) => void;
1087
- export const __wbg_get_distributionlinearwasm_startStep: (a: number, b: number) => void;
1088
- export const __wbg_get_distributionlogarithmicwasm_startMoment: (a: number, b: number) => void;
1092
+ export const __wbg_get_distributioninvertedlogarithmicwasm_maxValue: (a: number, b: number) => void;
1093
+ export const __wbg_get_distributioninvertedlogarithmicwasm_minValue: (a: number, b: number) => void;
1094
+ export const __wbg_get_distributioninvertedlogarithmicwasm_b: (a: number) => bigint;
1089
1095
  export const __wbg_get_distributioninvertedlogarithmicwasm_startMoment: (a: number, b: number) => void;
1090
- export const __wbg_get_distributionstepdecreasingamountwasm_startDecreasingOffset: (a: number, b: number) => void;
1091
- export const __wbg_get_distributionrandomwasm_min: (a: number) => bigint;
1092
- export const __wbg_get_timebaseddistributionwasm_interval: (a: number) => bigint;
1096
+ export const __wbg_get_distributioninvertedlogarithmicwasm_o: (a: number) => bigint;
1097
+ export const __wbg_get_distributioninvertedlogarithmicwasm_n: (a: number) => bigint;
1098
+ export const __wbg_get_distributioninvertedlogarithmicwasm_m: (a: number) => bigint;
1099
+ export const __wbg_get_distributioninvertedlogarithmicwasm_d: (a: number) => bigint;
1100
+ export const __wbg_get_distributioninvertedlogarithmicwasm_a: (a: number) => bigint;
1093
1101
  export const __wbg_set_distributionstepdecreasingamountwasm_minValue: (a: number, b: number, c: bigint) => void;
1102
+ export const __wbg_set_distributionlogarithmicwasm_maxValue: (a: number, b: number, c: bigint) => void;
1103
+ export const __wbg_set_distributionlogarithmicwasm_minValue: (a: number, b: number, c: bigint) => void;
1094
1104
  export const __wbg_set_distributionlinearwasm_maxValue: (a: number, b: number, c: bigint) => void;
1095
1105
  export const __wbg_set_distributionlinearwasm_minValue: (a: number, b: number, c: bigint) => void;
1096
1106
  export const __wbg_set_distributionpolynomialwasm_maxValue: (a: number, b: number, c: bigint) => void;
1097
1107
  export const __wbg_set_distributionpolynomialwasm_minValue: (a: number, b: number, c: bigint) => void;
1098
- export const __wbg_set_distributionlogarithmicwasm_maxValue: (a: number, b: number, c: bigint) => void;
1099
- export const __wbg_set_distributionlogarithmicwasm_minValue: (a: number, b: number, c: bigint) => void;
1100
1108
  export const __wbg_set_distributioninvertedlogarithmicwasm_maxValue: (a: number, b: number, c: bigint) => void;
1101
1109
  export const __wbg_set_distributioninvertedlogarithmicwasm_minValue: (a: number, b: number, c: bigint) => void;
1102
- export const __wbg_distributionlogarithmicwasm_free: (a: number, b: number) => void;
1103
- export const __wbg_distributionpolynomialwasm_free: (a: number, b: number) => void;
1104
- export const __wbg_distributioninvertedlogarithmicwasm_free: (a: number, b: number) => void;
1105
1110
  export const __wbg_tokenmarketplaceruleswasm_free: (a: number, b: number) => void;
1106
1111
  export const __wbg_timebaseddistributionwasm_free: (a: number, b: number) => void;
1107
1112
  export const epochbaseddistributionwasm_set_function: (a: number, b: number) => void;
1108
1113
  export const __wbg_epochbaseddistributionwasm_free: (a: number, b: number) => void;
1109
1114
  export const timebaseddistributionwasm_set_function: (a: number, b: number) => void;
1110
- export const epochbaseddistributionwasm_get_function: (a: number) => number;
1111
1115
  export const timebaseddistributionwasm_get_function: (a: number) => number;
1116
+ export const epochbaseddistributionwasm_get_function: (a: number) => number;
1112
1117
  export const __wbg_statetransitionwasm_free: (a: number, b: number) => void;
1113
1118
  export const statetransitionwasm_type_name: (a: number, b: number) => void;
1114
1119
  export const statetransitionwasm_struct_name: (a: number) => void;
1115
1120
  export const statetransitionwasm_sign: (a: number, b: number, c: number, d: number) => void;
1116
1121
  export const statetransitionwasm_signByPrivateKey: (a: number, b: number, c: number, d: number) => void;
1122
+ export const statetransitionwasm_verifyPublicKey: (a: number, b: number, c: number, d: number, e: number) => void;
1117
1123
  export const statetransitionwasm_bytes: (a: number, b: number) => void;
1118
1124
  export const statetransitionwasm_hex: (a: number, b: number) => void;
1119
1125
  export const statetransitionwasm_base64: (a: number, b: number) => void;
@@ -1128,9 +1134,32 @@ export const statetransitionwasm_get_signature: (a: number, b: number) => void;
1128
1134
  export const statetransitionwasm_get_signature_public_key_id: (a: number) => number;
1129
1135
  export const statetransitionwasm_get_user_fee_increase: (a: number) => number;
1130
1136
  export const statetransitionwasm_getPurposeRequirement: (a: number, b: number) => void;
1137
+ export const statetransitionwasm_getKeyLevelRequirement: (a: number, b: number, c: number) => void;
1131
1138
  export const statetransitionwasm_set_signature: (a: number, b: number, c: number) => void;
1132
1139
  export const statetransitionwasm_set_signature_public_key_id: (a: number, b: number) => void;
1133
1140
  export const statetransitionwasm_set_user_fee_increase: (a: number, b: number) => void;
1141
+ export const __wbg_privatekeywasm_free: (a: number, b: number) => void;
1142
+ export const privatekeywasm_type_name: (a: number, b: number) => void;
1143
+ export const privatekeywasm_struct_name: (a: number) => void;
1144
+ export const privatekeywasm_fromWIF: (a: number, b: number, c: number) => void;
1145
+ export const privatekeywasm_fromBytes: (a: number, b: number, c: number, d: number) => void;
1146
+ export const privatekeywasm_fromHex: (a: number, b: number, c: number, d: number) => void;
1147
+ export const privatekeywasm_getPublicKey: (a: number) => number;
1148
+ export const privatekeywasm_WIF: (a: number, b: number) => void;
1149
+ export const privatekeywasm_bytes: (a: number, b: number) => void;
1150
+ export const privatekeywasm_hex: (a: number, b: number) => void;
1151
+ export const privatekeywasm_getPublicKeyHash: (a: number, b: number) => void;
1152
+ export const __wbg_publickeywasm_free: (a: number, b: number) => void;
1153
+ export const publickeywasm_type_name: (a: number, b: number) => void;
1154
+ export const publickeywasm_struct_name: (a: number) => void;
1155
+ export const publickeywasm_new: (a: number, b: number, c: number, d: number) => void;
1156
+ export const publickeywasm_compressed: (a: number) => number;
1157
+ export const publickeywasm_inner: (a: number, b: number) => void;
1158
+ export const publickeywasm_set_compressed: (a: number, b: number) => void;
1159
+ export const publickeywasm_set_inner: (a: number, b: number, c: number, d: number) => void;
1160
+ export const publickeywasm_getPublicKeyHash: (a: number, b: number) => void;
1161
+ export const publickeywasm_bytes: (a: number, b: number) => void;
1162
+ export const publickeywasm_fromBytes: (a: number, b: number, c: number) => void;
1134
1163
  export const __wbg_identitypublickeywasm_free: (a: number, b: number) => void;
1135
1164
  export const identitypublickeywasm_type_name: (a: number, b: number) => void;
1136
1165
  export const identitypublickeywasm_struct_name: (a: number) => void;
@@ -1176,16 +1205,6 @@ export const contractboundswasm_contract_bounds_type: (a: number, b: number) =>
1176
1205
  export const contractboundswasm_contract_bounds_type_number: (a: number) => number;
1177
1206
  export const contractboundswasm_set_id: (a: number, b: number, c: number) => void;
1178
1207
  export const contractboundswasm_set_document_type_name: (a: number, b: number, c: number) => void;
1179
- export const __wbg_privatekeywasm_free: (a: number, b: number) => void;
1180
- export const privatekeywasm_type_name: (a: number, b: number) => void;
1181
- export const privatekeywasm_struct_name: (a: number) => void;
1182
- export const privatekeywasm_fromWIF: (a: number, b: number, c: number) => void;
1183
- export const privatekeywasm_fromBytes: (a: number, b: number, c: number, d: number) => void;
1184
- export const privatekeywasm_fromHex: (a: number, b: number, c: number, d: number) => void;
1185
- export const privatekeywasm_WIF: (a: number, b: number) => void;
1186
- export const privatekeywasm_bytes: (a: number, b: number) => void;
1187
- export const privatekeywasm_hex: (a: number, b: number) => void;
1188
- export const privatekeywasm_getPublicKeyHash: (a: number, b: number) => void;
1189
1208
  export const __wbg_identifierwasm_free: (a: number, b: number) => void;
1190
1209
  export const identifierwasm_type_name: (a: number, b: number) => void;
1191
1210
  export const identifierwasm_struct_name: (a: number) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pshenmic-dpp",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "main": "dist/wasm/index.js",
5
5
  "types": "dist/wasm/index.d.ts",
6
6
  "repository": {
@@ -6,9 +6,17 @@ const { default: wasm } = require('..')
6
6
  describe('AssetLockProof', function () {
7
7
  describe('serialization / deserialization', function () {
8
8
  it('should allow to get instant lock proof via constructor', () => {
9
- const instantLockProof = new wasm.AssetLockProofWASM('instant')
9
+ const outpoint = new wasm.OutPointWASM('e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d', 1)
10
+ const chainlock = new wasm.ChainAssetLockProofWASM(11, outpoint)
11
+ const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
10
12
 
11
- assert.equal(instantLockProof.constructor.name, 'AssetLockProofWASM')
13
+ const instantAssetLock = new wasm.AssetLockProofWASM(instantLockProof)
14
+ const chainAssetLock = new wasm.AssetLockProofWASM(chainlock)
15
+
16
+ assert.equal(instantAssetLock.constructor.name, 'AssetLockProofWASM')
17
+ assert.notEqual(instantAssetLock.__wbg_ptr, 0)
18
+ assert.equal(chainAssetLock.constructor.name, 'AssetLockProofWASM')
19
+ assert.notEqual(chainAssetLock.__wbg_ptr, 0)
12
20
  })
13
21
 
14
22
  it('shouldn\'t allow to get chain lock proof via constructor', () => {
@@ -35,37 +43,51 @@ describe('AssetLockProof', function () {
35
43
 
36
44
  assert.equal(chainLockProof.constructor.name, 'AssetLockProofWASM')
37
45
  })
46
+
47
+ it('should allow to serialize and deserialize asset lock in hex', () => {
48
+ const instantLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(instantLockBytes, transactionBytes, 0)
49
+
50
+ const newInstantLockProof = wasm.AssetLockProofWASM.fromHex(instantLockProof.hex())
51
+
52
+ assert.equal(instantLockProof.constructor.name, 'AssetLockProofWASM')
53
+ assert.equal(newInstantLockProof.constructor.name, 'AssetLockProofWASM')
54
+
55
+ assert.deepEqual(newInstantLockProof.toObject(), instantLockProof.toObject())
56
+ })
38
57
  })
39
58
 
40
59
  describe('getters', function () {
41
60
  it('should allow to get lock type', () => {
42
61
  const outpoint = new wasm.OutPointWASM('e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d', 1)
62
+ const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
43
63
 
64
+ const instantAssetLockProof = new wasm.AssetLockProofWASM(instantLockProof)
44
65
  const chainLockProof = wasm.AssetLockProofWASM.createChainAssetLockProof(1, outpoint)
45
66
 
46
- const instantLockProof = new wasm.AssetLockProofWASM('instant')
47
-
67
+ assert.equal(instantAssetLockProof.getLockType(), 'Instant')
48
68
  assert.equal(chainLockProof.getLockType(), 'Chain')
49
- assert.equal(instantLockProof.getLockType(), 'Instant')
50
69
  })
51
70
 
52
71
  it('should allow to get lock instances', () => {
53
72
  const outpoint = new wasm.OutPointWASM('e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d', 1)
73
+ const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
54
74
 
55
75
  const chainLockProof = wasm.AssetLockProofWASM.createChainAssetLockProof(1, outpoint)
76
+ const instantAssetLockProof = new wasm.AssetLockProofWASM(instantLockProof)
56
77
 
57
- const instantLockProof = new wasm.AssetLockProofWASM('instant')
58
78
 
59
79
  assert.equal(chainLockProof.getChainLockProof().constructor.name, 'ChainAssetLockProofWASM')
60
- assert.equal(instantLockProof.getInstantLockProof().constructor.name, 'InstantAssetLockProofWASM')
80
+ assert.equal(instantAssetLockProof.getInstantLockProof().constructor.name, 'InstantAssetLockProofWASM')
61
81
  })
62
82
 
63
83
  it('should allow to return object of lock', () => {
64
- const instantLockProof = new wasm.AssetLockProofWASM('instant')
84
+ const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
85
+
86
+ const instantAssetLockProof = new wasm.AssetLockProofWASM(instantLockProof)
65
87
 
66
88
  const expected = {
67
- instantLock: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
68
- transaction: [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 1, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0],
89
+ instantLock: instantLockBytes,
90
+ transaction: transactionBytes,
69
91
  outputIndex: 0
70
92
  }
71
93
 
@@ -42,7 +42,7 @@ describe('IdentityUpdateTransition', function () {
42
42
  })
43
43
 
44
44
  it('Should return publicKeyIdsToDisable', function () {
45
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
45
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
46
46
 
47
47
  assert.deepEqual(Array.from(transition.publicKeyIdsToDisable), [11])
48
48
  })
@@ -52,25 +52,25 @@ describe('IdentityUpdateTransition', function () {
52
52
  1, 'system', 'master', 'ECDSA_SECP256K1', false, [], []
53
53
  )
54
54
 
55
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [key], [11])
55
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [key], [11])
56
56
 
57
57
  assert.deepEqual(transition.publicKeyIdsToAdd.length, 1)
58
58
  })
59
59
 
60
60
  it('Should return userFeeIncrease', function () {
61
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
61
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11], 1)
62
62
 
63
63
  assert.deepEqual(transition.userFeeIncrease, 1)
64
64
  })
65
65
 
66
66
  it('Should return signature', function () {
67
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
67
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11], 1)
68
68
 
69
69
  assert.deepEqual(transition.signature, Uint8Array.from([]))
70
70
  })
71
71
 
72
72
  it('Should return signature public key id', function () {
73
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
73
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
74
74
 
75
75
  assert.deepEqual(transition.signaturePublicKeyId, 0)
76
76
  })
@@ -78,7 +78,7 @@ describe('IdentityUpdateTransition', function () {
78
78
 
79
79
  describe('setters', function () {
80
80
  it('Should allow to set identityIdentifier', function () {
81
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
81
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
82
82
 
83
83
  transition.identityIdentifier = '11Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3'
84
84
 
@@ -86,7 +86,7 @@ describe('IdentityUpdateTransition', function () {
86
86
  })
87
87
 
88
88
  it('Should allow to set revision', function () {
89
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
89
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
90
90
 
91
91
  transition.revision = BigInt(11111)
92
92
 
@@ -94,7 +94,7 @@ describe('IdentityUpdateTransition', function () {
94
94
  })
95
95
 
96
96
  it('Should allow to set nonce', function () {
97
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
97
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
98
98
 
99
99
  transition.nonce = BigInt(11111)
100
100
 
@@ -102,7 +102,7 @@ describe('IdentityUpdateTransition', function () {
102
102
  })
103
103
 
104
104
  it('Should allow to set publicKeyIdsToDisable', function () {
105
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
105
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
106
106
 
107
107
  transition.publicKeyIdsToDisable = [1, 2, 3, 4]
108
108
 
@@ -110,7 +110,7 @@ describe('IdentityUpdateTransition', function () {
110
110
  })
111
111
 
112
112
  it('Should allow to set publicKeyIdsToAdd', function () {
113
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
113
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
114
114
 
115
115
  const key = new wasm.IdentityPublicKeyInCreationWASM(
116
116
  1, 'system', 'master', 'ECDSA_SECP256K1', false, [], []
@@ -123,7 +123,7 @@ describe('IdentityUpdateTransition', function () {
123
123
  })
124
124
 
125
125
  it('Should allow to set signature', function () {
126
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
126
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
127
127
 
128
128
  transition.signature = [0, 1, 2, 3, 5]
129
129
 
@@ -131,7 +131,7 @@ describe('IdentityUpdateTransition', function () {
131
131
  })
132
132
 
133
133
  it('Should allow to set signature public key id', function () {
134
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [11])
134
+ const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
135
135
 
136
136
  transition.signaturePublicKeyId = 11
137
137