ox 0.14.42 → 0.14.44
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.
- package/CHANGELOG.md +12 -0
- package/_cjs/tempo/MultisigConfig.js +9 -2
- package/_cjs/tempo/MultisigConfig.js.map +1 -1
- package/_cjs/tempo/MultisigSimulation.js +115 -0
- package/_cjs/tempo/MultisigSimulation.js.map +1 -0
- package/_cjs/tempo/SignatureEnvelope.js +12 -21
- package/_cjs/tempo/SignatureEnvelope.js.map +1 -1
- package/_cjs/tempo/TransactionRequest.js +7 -7
- package/_cjs/tempo/TransactionRequest.js.map +1 -1
- package/_cjs/tempo/index.js +2 -2
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/tempo/MultisigConfig.js +14 -4
- package/_esm/tempo/MultisigConfig.js.map +1 -1
- package/_esm/tempo/MultisigSimulation.js +145 -0
- package/_esm/tempo/MultisigSimulation.js.map +1 -0
- package/_esm/tempo/SignatureEnvelope.js +12 -21
- package/_esm/tempo/SignatureEnvelope.js.map +1 -1
- package/_esm/tempo/TransactionRequest.js +7 -7
- package/_esm/tempo/TransactionRequest.js.map +1 -1
- package/_esm/tempo/index.js +4 -4
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/tempo/KeyAuthorization.d.ts +1 -1
- package/_types/tempo/KeyAuthorization.d.ts.map +1 -1
- package/_types/tempo/MultisigConfig.d.ts +5 -3
- package/_types/tempo/MultisigConfig.d.ts.map +1 -1
- package/_types/tempo/MultisigOperation.d.ts +2 -2
- package/_types/tempo/MultisigOperation.d.ts.map +1 -1
- package/_types/tempo/MultisigSimulation.d.ts +132 -0
- package/_types/tempo/MultisigSimulation.d.ts.map +1 -0
- package/_types/tempo/SignatureEnvelope.d.ts +10 -34
- package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/_types/tempo/TransactionRequest.d.ts +9 -9
- package/_types/tempo/TransactionRequest.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +4 -4
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/package.json +9 -9
- package/tempo/AuthorizationTempo.test.ts +4 -0
- package/tempo/KeyAuthorization.test-d.ts +1 -12
- package/tempo/KeyAuthorization.test.ts +37 -9
- package/tempo/KeyAuthorization.ts +3 -3
- package/tempo/MultisigConfig.test.ts +21 -5
- package/tempo/MultisigConfig.ts +18 -6
- package/tempo/MultisigOperation.test.ts +37 -37
- package/tempo/MultisigOperation.ts +2 -2
- package/tempo/MultisigSimulation/package.json +6 -0
- package/tempo/MultisigSimulation.test-d/package.json +6 -0
- package/tempo/MultisigSimulation.test-d.ts +33 -0
- package/tempo/MultisigSimulation.test.ts +284 -0
- package/tempo/MultisigSimulation.ts +266 -0
- package/tempo/RpcSchemaTempo.test-d.ts +4 -4
- package/tempo/SignatureEnvelope.test-d.ts +8 -44
- package/tempo/SignatureEnvelope.test.ts +106 -65
- package/tempo/SignatureEnvelope.ts +27 -61
- package/tempo/Transaction.test.ts +61 -0
- package/tempo/TransactionRequest.test-d.ts +9 -9
- package/tempo/TransactionRequest.test.ts +122 -49
- package/tempo/TransactionRequest.ts +20 -16
- package/tempo/index.ts +4 -4
- package/tempo/multisig.e2e.test.ts +71 -21
- package/version.ts +1 -1
- package/_cjs/tempo/MultisigWitness.js +0 -92
- package/_cjs/tempo/MultisigWitness.js.map +0 -1
- package/_esm/tempo/MultisigWitness.js +0 -123
- package/_esm/tempo/MultisigWitness.js.map +0 -1
- package/_types/tempo/MultisigWitness.d.ts +0 -106
- package/_types/tempo/MultisigWitness.d.ts.map +0 -1
- package/tempo/MultisigWitness/package.json +0 -6
- package/tempo/MultisigWitness.test-d/package.json +0 -6
- package/tempo/MultisigWitness.test-d.ts +0 -42
- package/tempo/MultisigWitness.test.ts +0 -289
- package/tempo/MultisigWitness.ts +0 -210
|
@@ -99,10 +99,11 @@ describe('fromRpc/toRpc', () => {
|
|
|
99
99
|
})
|
|
100
100
|
|
|
101
101
|
describe('getAddress', () => {
|
|
102
|
-
test('example: matches the frozen
|
|
102
|
+
test('example: matches the frozen CREATE2 vector', () => {
|
|
103
103
|
expect(account).toMatchInlineSnapshot(
|
|
104
|
-
`"
|
|
104
|
+
`"0xf4b916c5aea0fb199bd942389be00db0690c961f"`,
|
|
105
105
|
)
|
|
106
|
+
expect(account).not.toBe('0x8820d1497eeaf4f68e00b2cfc00a2f3b1dbb00da')
|
|
106
107
|
})
|
|
107
108
|
|
|
108
109
|
test('behavior: includes salt, threshold, and owners', () => {
|
|
@@ -115,7 +116,22 @@ describe('getAddress', () => {
|
|
|
115
116
|
salt: `0x${'42'.repeat(32)}`,
|
|
116
117
|
threshold: 2,
|
|
117
118
|
}),
|
|
118
|
-
).toMatchInlineSnapshot(`"
|
|
119
|
+
).toMatchInlineSnapshot(`"0x94040edd3d7b542e0a96e01141bc250d709b4469"`)
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
test('behavior: is stable and binds the salt', () => {
|
|
123
|
+
expect({
|
|
124
|
+
repeated: MultisigConfig.getAddress(config),
|
|
125
|
+
salted: MultisigConfig.getAddress({
|
|
126
|
+
...config,
|
|
127
|
+
salt: `0x${'42'.repeat(32)}`,
|
|
128
|
+
}),
|
|
129
|
+
}).toMatchInlineSnapshot(`
|
|
130
|
+
{
|
|
131
|
+
"repeated": "0xf4b916c5aea0fb199bd942389be00db0690c961f",
|
|
132
|
+
"salted": "0x95e771f514fd6ac5b8bbd62a9b37db86eeed7e38",
|
|
133
|
+
}
|
|
134
|
+
`)
|
|
119
135
|
})
|
|
120
136
|
|
|
121
137
|
test('error: rejects a current configuration', () => {
|
|
@@ -152,7 +168,7 @@ describe('getSignPayload', () => {
|
|
|
152
168
|
expect(
|
|
153
169
|
MultisigConfig.getSignPayload({ account, config, payload }),
|
|
154
170
|
).toMatchInlineSnapshot(
|
|
155
|
-
`"
|
|
171
|
+
`"0xdba6b49849aaef399fbc1de73fe26d520f21846c80c3e5d2486ad56e8df3cee3"`,
|
|
156
172
|
)
|
|
157
173
|
})
|
|
158
174
|
|
|
@@ -214,7 +230,7 @@ describe('assert/validate', () => {
|
|
|
214
230
|
valid: MultisigConfig.validate(boundary),
|
|
215
231
|
}).toMatchInlineSnapshot(`
|
|
216
232
|
{
|
|
217
|
-
"account": "
|
|
233
|
+
"account": "0xa832c9a61d254a157c05edcd856b2cbe4dea8c77",
|
|
218
234
|
"commitment": "0x0dc47a7ab45ffa21a01bfd115427e26617b5a57d7ccbea57db2fd4537ba96f56",
|
|
219
235
|
"rlpHash": "0xbaf0d030add91caaa10815d2e99c942f1e39b0d199216973781adb4fc1af6955",
|
|
220
236
|
"rlpLength": 1145,
|
package/tempo/MultisigConfig.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Address from '../core/Address.js'
|
|
2
2
|
import type * as Bytes from '../core/Bytes.js'
|
|
3
|
+
import * as ContractAddress from '../core/ContractAddress.js'
|
|
3
4
|
import * as Errors from '../core/Errors.js'
|
|
4
5
|
import * as Hash from '../core/Hash.js'
|
|
5
6
|
import * as Hex from '../core/Hex.js'
|
|
@@ -38,6 +39,13 @@ const accountDomain = 'tempo:multisig:account'
|
|
|
38
39
|
/** Domain prefix for native multisig configuration commitments. */
|
|
39
40
|
const configDomain = 'tempo:multisig:config'
|
|
40
41
|
|
|
42
|
+
/** Canonical CREATE2 factory for multisig recovery wallets. */
|
|
43
|
+
const recoveryFactory = '0x8a196A227C48Ae8A3E36EebD4E106675CC0f6E64'
|
|
44
|
+
|
|
45
|
+
/** Keccak-256 of the canonical recovery wallet creation code. */
|
|
46
|
+
const recoveryWalletInitCodeHash =
|
|
47
|
+
'0x4b5ff53c5328a10a6ec5224adf16de5e204a47057c98af037ee30b7de660a8a6'
|
|
48
|
+
|
|
41
49
|
/** Domain prefix for native multisig owner approvals. */
|
|
42
50
|
const signatureDomain = 'tempo:multisig:signature'
|
|
43
51
|
|
|
@@ -309,8 +317,9 @@ export function fromTuple(tuple: Tuple): Config {
|
|
|
309
317
|
/**
|
|
310
318
|
* Derives the stable native multisig account address.
|
|
311
319
|
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
320
|
+
* The initial config is hashed into a CREATE2 salt using fixed-width
|
|
321
|
+
* big-endian fields, not RLP. The account uses the canonical recovery factory
|
|
322
|
+
* and wallet init-code hash.
|
|
314
323
|
*
|
|
315
324
|
* The address is derived once from the initial version-0 config. Config
|
|
316
325
|
* updates do not change it.
|
|
@@ -338,7 +347,7 @@ export function getAddress(config: Input): Address.Address {
|
|
|
338
347
|
throw new InvalidConfigError({
|
|
339
348
|
reason: 'account address requires version zero',
|
|
340
349
|
})
|
|
341
|
-
const
|
|
350
|
+
const accountSalt = Hash.keccak256(
|
|
342
351
|
Hex.concat(
|
|
343
352
|
Hex.fromString(accountDomain),
|
|
344
353
|
Hex.padLeft(config.salt ?? zeroSalt, 32),
|
|
@@ -350,7 +359,11 @@ export function getAddress(config: Input): Address.Address {
|
|
|
350
359
|
]),
|
|
351
360
|
),
|
|
352
361
|
)
|
|
353
|
-
const account =
|
|
362
|
+
const account = ContractAddress.fromCreate2({
|
|
363
|
+
bytecodeHash: recoveryWalletInitCodeHash,
|
|
364
|
+
from: recoveryFactory,
|
|
365
|
+
salt: accountSalt,
|
|
366
|
+
})
|
|
354
367
|
if (Hex.toBigInt(account) === 0n)
|
|
355
368
|
throw new InvalidConfigError({ reason: 'derived account cannot be zero' })
|
|
356
369
|
if (config.owners.some((owner) => Address.isEqual(owner.owner, account)))
|
|
@@ -363,12 +376,11 @@ export function getAddress(config: Input): Address.Address {
|
|
|
363
376
|
export declare namespace getAddress {
|
|
364
377
|
type ErrorType =
|
|
365
378
|
| assert.ErrorType
|
|
366
|
-
|
|
|
379
|
+
| ContractAddress.fromCreate2.ErrorType
|
|
367
380
|
| Hash.keccak256.ErrorType
|
|
368
381
|
| Hex.concat.ErrorType
|
|
369
382
|
| Hex.fromNumber.ErrorType
|
|
370
383
|
| Hex.fromString.ErrorType
|
|
371
|
-
| Hex.slice.ErrorType
|
|
372
384
|
| Errors.GlobalErrorType
|
|
373
385
|
}
|
|
374
386
|
|
|
@@ -149,8 +149,8 @@ describe('getHash', () => {
|
|
|
149
149
|
}),
|
|
150
150
|
}).toMatchInlineSnapshot(`
|
|
151
151
|
{
|
|
152
|
-
"keyAuthorization": "
|
|
153
|
-
"transaction": "
|
|
152
|
+
"keyAuthorization": "0xd903cd2c94f6a1526a6f79da6f87087c10b26e06d4d4bc1624ce4498961a3b04",
|
|
153
|
+
"transaction": "0xc93c1dc27cc9fb7616d61f97962e4fab8b39af0d1dace8f8b8730cb6922bd096",
|
|
154
154
|
}
|
|
155
155
|
`)
|
|
156
156
|
})
|
|
@@ -303,10 +303,10 @@ describe('selectApprovals', () => {
|
|
|
303
303
|
"complete": {
|
|
304
304
|
"approvals": [
|
|
305
305
|
"0x07e1ed8ea0e9601e5546b0a03aed683df3601407",
|
|
306
|
-
"
|
|
306
|
+
"0xf75618474e5f7fd9ef17dd85167a5b1e1f19b84b",
|
|
307
307
|
],
|
|
308
308
|
"selectedApprovals": [
|
|
309
|
-
"
|
|
309
|
+
"0xf75618474e5f7fd9ef17dd85167a5b1e1f19b84b",
|
|
310
310
|
],
|
|
311
311
|
"signatureCount": 1,
|
|
312
312
|
"threshold": 2,
|
|
@@ -315,7 +315,7 @@ describe('selectApprovals', () => {
|
|
|
315
315
|
"partial": {
|
|
316
316
|
"approvals": [
|
|
317
317
|
"0x07e1ed8ea0e9601e5546b0a03aed683df3601407",
|
|
318
|
-
"
|
|
318
|
+
"0xf75618474e5f7fd9ef17dd85167a5b1e1f19b84b",
|
|
319
319
|
],
|
|
320
320
|
"selectedApprovals": [
|
|
321
321
|
"0x07e1ed8ea0e9601e5546b0a03aed683df3601407",
|
|
@@ -393,7 +393,7 @@ describe('selectApprovals', () => {
|
|
|
393
393
|
hash,
|
|
394
394
|
}),
|
|
395
395
|
).rejects.toThrowErrorMatchingInlineSnapshot(
|
|
396
|
-
`[MultisigOperation.InvalidApprovalError: Invalid multisig approval: nested multisig owner
|
|
396
|
+
`[MultisigOperation.InvalidApprovalError: Invalid multisig approval: nested multisig owner 0x5b7c564e95bde16197e73f9eaa9c7413f11f49ad has conflicting config witnesses.]`,
|
|
397
397
|
)
|
|
398
398
|
})
|
|
399
399
|
|
|
@@ -672,7 +672,7 @@ describe('selectApprovals', () => {
|
|
|
672
672
|
hash,
|
|
673
673
|
}),
|
|
674
674
|
).rejects.toThrowErrorMatchingInlineSnapshot(
|
|
675
|
-
`[MultisigOperation.InvalidApprovalError: Invalid multisig approval: nested multisig owner
|
|
675
|
+
`[MultisigOperation.InvalidApprovalError: Invalid multisig approval: nested multisig owner 0x4e51c0503aab130b1a358e8eab4c6302618fb3a6 is invalid.]`,
|
|
676
676
|
)
|
|
677
677
|
})
|
|
678
678
|
})
|
|
@@ -725,14 +725,14 @@ describe('serializeKeyAuthorization', () => {
|
|
|
725
725
|
expect(results).toMatchInlineSnapshot(`
|
|
726
726
|
[
|
|
727
727
|
{
|
|
728
|
-
"account": "
|
|
729
|
-
"hash": "
|
|
728
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
729
|
+
"hash": "0x52562f8b8042498f83189316f0aacda4d5b80468f0001300829c4d353db5f101",
|
|
730
730
|
"signatureCount": 2,
|
|
731
731
|
"version": 1n,
|
|
732
732
|
},
|
|
733
733
|
{
|
|
734
|
-
"account": "
|
|
735
|
-
"hash": "
|
|
734
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
735
|
+
"hash": "0x948de4ae52c7cd35151c2ddcd31c97ea89662e83bd18a3cbc323894a1fd8ca06",
|
|
736
736
|
"signatureCount": 2,
|
|
737
737
|
"version": 0n,
|
|
738
738
|
},
|
|
@@ -826,15 +826,15 @@ describe('serializeTransaction', () => {
|
|
|
826
826
|
expect(results).toMatchInlineSnapshot(`
|
|
827
827
|
[
|
|
828
828
|
{
|
|
829
|
-
"account": "
|
|
830
|
-
"hash": "
|
|
829
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
830
|
+
"hash": "0x2d4748a76d91da5fd3d762cb0f925de32347fdbd89d23356d481b526e3d3ab10",
|
|
831
831
|
"signatureCount": 2,
|
|
832
832
|
"type": "0x76",
|
|
833
833
|
"version": 1n,
|
|
834
834
|
},
|
|
835
835
|
{
|
|
836
|
-
"account": "
|
|
837
|
-
"hash": "
|
|
836
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
837
|
+
"hash": "0x2bf7e539779104921d32758dc184ece6aa8872bfb3b86e2f4d8e0ba1d85ee821",
|
|
838
838
|
"signatureCount": 2,
|
|
839
839
|
"type": "0x76",
|
|
840
840
|
"version": 0n,
|
|
@@ -911,7 +911,7 @@ describe('serializeTransaction', () => {
|
|
|
911
911
|
[
|
|
912
912
|
{
|
|
913
913
|
"feePayerSignature": null,
|
|
914
|
-
"from": "
|
|
914
|
+
"from": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
915
915
|
"signatureCount": 2,
|
|
916
916
|
"type": "0x78",
|
|
917
917
|
},
|
|
@@ -921,7 +921,7 @@ describe('serializeTransaction', () => {
|
|
|
921
921
|
"s": 6n,
|
|
922
922
|
"yParity": 0,
|
|
923
923
|
},
|
|
924
|
-
"from": "
|
|
924
|
+
"from": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
925
925
|
"signatureCount": 2,
|
|
926
926
|
"type": "0x78",
|
|
927
927
|
},
|
|
@@ -993,7 +993,7 @@ describe('from', () => {
|
|
|
993
993
|
expect({ pending, submitting, success }).toMatchInlineSnapshot(`
|
|
994
994
|
{
|
|
995
995
|
"pending": {
|
|
996
|
-
"account": "
|
|
996
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
997
997
|
"approvals": [
|
|
998
998
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
999
999
|
],
|
|
@@ -1013,7 +1013,7 @@ describe('from', () => {
|
|
|
1013
1013
|
"version": 1n,
|
|
1014
1014
|
},
|
|
1015
1015
|
"createdAt": 1,
|
|
1016
|
-
"hash": "
|
|
1016
|
+
"hash": "0xc93c1dc27cc9fb7616d61f97962e4fab8b39af0d1dace8f8b8730cb6922bd096",
|
|
1017
1017
|
"signatureCount": 1,
|
|
1018
1018
|
"status": "pending",
|
|
1019
1019
|
"threshold": 2,
|
|
@@ -1023,7 +1023,7 @@ describe('from', () => {
|
|
|
1023
1023
|
"weight": 1,
|
|
1024
1024
|
},
|
|
1025
1025
|
"submitting": {
|
|
1026
|
-
"account": "
|
|
1026
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1027
1027
|
"approvals": [
|
|
1028
1028
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1029
1029
|
"0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
@@ -1045,7 +1045,7 @@ describe('from', () => {
|
|
|
1045
1045
|
},
|
|
1046
1046
|
"createdAt": 1,
|
|
1047
1047
|
"expiresAt": 10,
|
|
1048
|
-
"hash": "
|
|
1048
|
+
"hash": "0xc93c1dc27cc9fb7616d61f97962e4fab8b39af0d1dace8f8b8730cb6922bd096",
|
|
1049
1049
|
"signatureCount": 2,
|
|
1050
1050
|
"status": "submitting",
|
|
1051
1051
|
"submissionId": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
@@ -1056,7 +1056,7 @@ describe('from', () => {
|
|
|
1056
1056
|
"weight": 2,
|
|
1057
1057
|
},
|
|
1058
1058
|
"success": {
|
|
1059
|
-
"account": "
|
|
1059
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1060
1060
|
"approvals": [
|
|
1061
1061
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1062
1062
|
"0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
@@ -1077,7 +1077,7 @@ describe('from', () => {
|
|
|
1077
1077
|
"version": 1n,
|
|
1078
1078
|
},
|
|
1079
1079
|
"createdAt": 1,
|
|
1080
|
-
"hash": "
|
|
1080
|
+
"hash": "0xc93c1dc27cc9fb7616d61f97962e4fab8b39af0d1dace8f8b8730cb6922bd096",
|
|
1081
1081
|
"signatureCount": 2,
|
|
1082
1082
|
"status": "success",
|
|
1083
1083
|
"threshold": 2,
|
|
@@ -1118,7 +1118,7 @@ describe('from', () => {
|
|
|
1118
1118
|
},
|
|
1119
1119
|
`
|
|
1120
1120
|
{
|
|
1121
|
-
"account": "
|
|
1121
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1122
1122
|
"approvals": [
|
|
1123
1123
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1124
1124
|
],
|
|
@@ -1195,7 +1195,7 @@ describe('from', () => {
|
|
|
1195
1195
|
},
|
|
1196
1196
|
`
|
|
1197
1197
|
{
|
|
1198
|
-
"account": "
|
|
1198
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1199
1199
|
"approvals": [
|
|
1200
1200
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1201
1201
|
],
|
|
@@ -1255,7 +1255,7 @@ describe('from', () => {
|
|
|
1255
1255
|
expect({ pending, success }).toMatchInlineSnapshot(`
|
|
1256
1256
|
{
|
|
1257
1257
|
"pending": {
|
|
1258
|
-
"account": "
|
|
1258
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1259
1259
|
"approvals": [
|
|
1260
1260
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1261
1261
|
],
|
|
@@ -1275,8 +1275,8 @@ describe('from', () => {
|
|
|
1275
1275
|
"version": 1n,
|
|
1276
1276
|
},
|
|
1277
1277
|
"createdAt": 1,
|
|
1278
|
-
"hash": "
|
|
1279
|
-
"keyAuthorization": "
|
|
1278
|
+
"hash": "0xd903cd2c94f6a1526a6f79da6f87087c10b26e06d4d4bc1624ce4498961a3b04",
|
|
1279
|
+
"keyAuthorization": "0xf838f782107980943333333333333333333333333333333333333333846b49d200808080809417e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1280
1280
|
"signatureCount": 1,
|
|
1281
1281
|
"status": "pending",
|
|
1282
1282
|
"threshold": 2,
|
|
@@ -1285,7 +1285,7 @@ describe('from', () => {
|
|
|
1285
1285
|
"weight": 1,
|
|
1286
1286
|
},
|
|
1287
1287
|
"success": {
|
|
1288
|
-
"account": "
|
|
1288
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1289
1289
|
"approvals": [
|
|
1290
1290
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1291
1291
|
"0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
@@ -1306,8 +1306,8 @@ describe('from', () => {
|
|
|
1306
1306
|
"version": 1n,
|
|
1307
1307
|
},
|
|
1308
1308
|
"createdAt": 1,
|
|
1309
|
-
"hash": "
|
|
1310
|
-
"keyAuthorization": "
|
|
1309
|
+
"hash": "0xd903cd2c94f6a1526a6f79da6f87087c10b26e06d4d4bc1624ce4498961a3b04",
|
|
1310
|
+
"keyAuthorization": "0xf901b3f782107980943333333333333333333333333333333333333333846b49d200808080809417e90f73f4c7c75dc01b00b262e7b95ed3086bd0b9017805f901749417e90f73f4c7c75dc01b00b262e7b95ed3086bd0f852a000000000000000000000000000000000000000000000000000000000000000000102eed69407e1ed8ea0e9601e5546b0a03aed683df360140701d694288f0cd85005f34168f731a468aef268c2f9456f01f90108b88201000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200b88201000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
1311
1311
|
"signatureCount": 2,
|
|
1312
1312
|
"status": "success",
|
|
1313
1313
|
"threshold": 2,
|
|
@@ -1356,7 +1356,7 @@ describe('from', () => {
|
|
|
1356
1356
|
},
|
|
1357
1357
|
`
|
|
1358
1358
|
{
|
|
1359
|
-
"account": "
|
|
1359
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1360
1360
|
"approvals": [
|
|
1361
1361
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1362
1362
|
"0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
@@ -1402,7 +1402,7 @@ describe('RPC conversion', () => {
|
|
|
1402
1402
|
expect({ keyAuthorizationRpc, transactionRpc }).toMatchInlineSnapshot(`
|
|
1403
1403
|
{
|
|
1404
1404
|
"keyAuthorizationRpc": {
|
|
1405
|
-
"account": "
|
|
1405
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1406
1406
|
"approvals": [
|
|
1407
1407
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1408
1408
|
],
|
|
@@ -1422,8 +1422,8 @@ describe('RPC conversion', () => {
|
|
|
1422
1422
|
"version": "0x1",
|
|
1423
1423
|
},
|
|
1424
1424
|
"createdAt": 1,
|
|
1425
|
-
"hash": "
|
|
1426
|
-
"keyAuthorization": "
|
|
1425
|
+
"hash": "0xd903cd2c94f6a1526a6f79da6f87087c10b26e06d4d4bc1624ce4498961a3b04",
|
|
1426
|
+
"keyAuthorization": "0xf838f782107980943333333333333333333333333333333333333333846b49d200808080809417e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1427
1427
|
"signatureCount": 1,
|
|
1428
1428
|
"status": "pending",
|
|
1429
1429
|
"threshold": 2,
|
|
@@ -1432,7 +1432,7 @@ describe('RPC conversion', () => {
|
|
|
1432
1432
|
"weight": 1,
|
|
1433
1433
|
},
|
|
1434
1434
|
"transactionRpc": {
|
|
1435
|
-
"account": "
|
|
1435
|
+
"account": "0x17e90f73f4c7c75dc01b00b262e7b95ed3086bd0",
|
|
1436
1436
|
"approvals": [
|
|
1437
1437
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1438
1438
|
],
|
|
@@ -1452,7 +1452,7 @@ describe('RPC conversion', () => {
|
|
|
1452
1452
|
"version": "0x1",
|
|
1453
1453
|
},
|
|
1454
1454
|
"createdAt": 1,
|
|
1455
|
-
"hash": "
|
|
1455
|
+
"hash": "0xc93c1dc27cc9fb7616d61f97962e4fab8b39af0d1dace8f8b8730cb6922bd096",
|
|
1456
1456
|
"signatureCount": 1,
|
|
1457
1457
|
"status": "pending",
|
|
1458
1458
|
"threshold": 2,
|
|
@@ -287,7 +287,7 @@ export function serializeKeyAuthorization(
|
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
export declare namespace serializeKeyAuthorization {
|
|
290
|
-
/** Options for
|
|
290
|
+
/** Options for `serializeKeyAuthorization`. */
|
|
291
291
|
export type Options = {
|
|
292
292
|
/** Root multisig account. */
|
|
293
293
|
account: Address.Address
|
|
@@ -297,7 +297,7 @@ export declare namespace serializeKeyAuthorization {
|
|
|
297
297
|
config: MultisigConfig.Config
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
/** Error type for
|
|
300
|
+
/** Error type for `serializeKeyAuthorization`. */
|
|
301
301
|
export type ErrorType =
|
|
302
302
|
| InvalidOperationError
|
|
303
303
|
| KeyAuthorization_.deserialize.ErrorType
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { expectTypeOf, test } from 'vitest'
|
|
2
|
+
import * as MultisigSimulation from './MultisigSimulation.js'
|
|
3
|
+
|
|
4
|
+
const rpc = {
|
|
5
|
+
account: '0x2222222222222222222222222222222222222222',
|
|
6
|
+
approvals: [
|
|
7
|
+
{
|
|
8
|
+
owner: '0x1111111111111111111111111111111111111111',
|
|
9
|
+
type: 'primitive',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
config:
|
|
13
|
+
'0xf83ba000000000000000000000000000000000000000000000000000000000000000008001d7d694111111111111111111111111111111111111111101',
|
|
14
|
+
} as const satisfies MultisigSimulation.Rpc
|
|
15
|
+
|
|
16
|
+
test('fromRpc returns a domain spec', () => {
|
|
17
|
+
const spec = MultisigSimulation.fromRpc(rpc)
|
|
18
|
+
|
|
19
|
+
expectTypeOf(spec).toEqualTypeOf<MultisigSimulation.Spec>()
|
|
20
|
+
expectTypeOf(spec.config.version).toEqualTypeOf<bigint>()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
test('RPC specs use encoded configurations', () => {
|
|
24
|
+
expectTypeOf<
|
|
25
|
+
MultisigSimulation.Rpc['config']
|
|
26
|
+
>().toEqualTypeOf<`0x${string}`>()
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
test('toRpc returns an RPC spec', () => {
|
|
30
|
+
expectTypeOf(
|
|
31
|
+
MultisigSimulation.toRpc(MultisigSimulation.fromRpc(rpc)),
|
|
32
|
+
).toEqualTypeOf<MultisigSimulation.Rpc>()
|
|
33
|
+
})
|