@0xsequence/guard 3.0.2 → 3.0.3
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/sequence.js +1 -1
- package/package.json +3 -3
- package/src/sequence.ts +1 -1
- package/test/sequence.test.ts +15 -0
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-lint.log
CHANGED
package/CHANGELOG.md
CHANGED
package/dist/sequence.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/guard",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "guard sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/services/guard",
|
|
6
6
|
"author": "Sequence Platforms ULC",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"@types/node": "^25.3.0",
|
|
21
21
|
"typescript": "^5.9.3",
|
|
22
22
|
"vitest": "^4.0.18",
|
|
23
|
-
"@repo/
|
|
24
|
-
"@repo/
|
|
23
|
+
"@repo/eslint-config": "^0.0.1",
|
|
24
|
+
"@repo/typescript-config": "^0.0.1"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"ox": "^0.9.17"
|
package/src/sequence.ts
CHANGED
package/test/sequence.test.ts
CHANGED
|
@@ -116,6 +116,21 @@ describe('Sequence', () => {
|
|
|
116
116
|
).rejects.toThrow('Error signing with guard')
|
|
117
117
|
})
|
|
118
118
|
|
|
119
|
+
it('Should preserve the original guard failure as cause', async () => {
|
|
120
|
+
mockFetch.mockRejectedValueOnce(new Error('Network error'))
|
|
121
|
+
|
|
122
|
+
try {
|
|
123
|
+
await guard.signPayload(testWallet, 42161, PayloadType.ConfigUpdate, testMessageDigest, testMessage)
|
|
124
|
+
throw new Error('Expected signPayload to throw')
|
|
125
|
+
} catch (error) {
|
|
126
|
+
expect(error).toBeInstanceOf(Error)
|
|
127
|
+
expect((error as Error).message).toBe('Error signing with guard')
|
|
128
|
+
expect((error as Error & { cause?: unknown }).cause).toBeInstanceOf(Error)
|
|
129
|
+
expect((error as Error & { cause?: Error }).cause?.name).toBe('WebrpcRequestFailed')
|
|
130
|
+
expect((error as Error & { cause?: Error }).cause?.message).toBe('request failed')
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
|
|
119
134
|
it('Should include proper headers and signer address in request', async () => {
|
|
120
135
|
const mockGuardAddress = '0x9876543210987654321098765432109876543210' as Address.Address
|
|
121
136
|
const customGuard = new Guard('https://guard.sequence.app', mockGuardAddress, fetch)
|