@0xsequence/guard 0.0.0-20230825151821 → 0.0.0-20230831141757
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.
|
@@ -163,7 +163,7 @@ class GuardSigner {
|
|
|
163
163
|
this.requests.get(id).onRejection('Expected Sequence-like metadata (status update)');
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
this.evaluateRequest(id, status.message, status, metadata);
|
|
166
|
+
this.evaluateRequest(id, status.message, status, metadata).catch(console.error);
|
|
167
167
|
}
|
|
168
168
|
packMsgAndSig(address, msg, sig, chainId) {
|
|
169
169
|
return ethers.ethers.utils.defaultAbiCoder.encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig]);
|
|
@@ -201,12 +201,15 @@ class GuardSigner {
|
|
|
201
201
|
this.requests.delete(id);
|
|
202
202
|
}
|
|
203
203
|
} catch (e) {
|
|
204
|
+
console.error('evaluateRequest error', e);
|
|
205
|
+
throw e;
|
|
204
206
|
// The guard signer may reject the request for a number of reasons
|
|
205
207
|
// like for example, if it's being the first signer (it waits for other signers to sign first)
|
|
206
208
|
// for now we ignore all errors, but we should probably handle them
|
|
207
209
|
// TODO: Filter real errors from control flow errors
|
|
208
210
|
}
|
|
209
211
|
}
|
|
212
|
+
|
|
210
213
|
suffix() {
|
|
211
214
|
return this.appendSuffix ? [3] : [];
|
|
212
215
|
}
|
|
@@ -163,7 +163,7 @@ class GuardSigner {
|
|
|
163
163
|
this.requests.get(id).onRejection('Expected Sequence-like metadata (status update)');
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
this.evaluateRequest(id, status.message, status, metadata);
|
|
166
|
+
this.evaluateRequest(id, status.message, status, metadata).catch(console.error);
|
|
167
167
|
}
|
|
168
168
|
packMsgAndSig(address, msg, sig, chainId) {
|
|
169
169
|
return ethers.ethers.utils.defaultAbiCoder.encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig]);
|
|
@@ -201,12 +201,15 @@ class GuardSigner {
|
|
|
201
201
|
this.requests.delete(id);
|
|
202
202
|
}
|
|
203
203
|
} catch (e) {
|
|
204
|
+
console.error('evaluateRequest error', e);
|
|
205
|
+
throw e;
|
|
204
206
|
// The guard signer may reject the request for a number of reasons
|
|
205
207
|
// like for example, if it's being the first signer (it waits for other signers to sign first)
|
|
206
208
|
// for now we ignore all errors, but we should probably handle them
|
|
207
209
|
// TODO: Filter real errors from control flow errors
|
|
208
210
|
}
|
|
209
211
|
}
|
|
212
|
+
|
|
210
213
|
suffix() {
|
|
211
214
|
return this.appendSuffix ? [3] : [];
|
|
212
215
|
}
|
|
@@ -159,7 +159,7 @@ class GuardSigner {
|
|
|
159
159
|
this.requests.get(id).onRejection('Expected Sequence-like metadata (status update)');
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
this.evaluateRequest(id, status.message, status, metadata);
|
|
162
|
+
this.evaluateRequest(id, status.message, status, metadata).catch(console.error);
|
|
163
163
|
}
|
|
164
164
|
packMsgAndSig(address, msg, sig, chainId) {
|
|
165
165
|
return ethers.utils.defaultAbiCoder.encode(['address', 'uint256', 'bytes', 'bytes'], [address, chainId, msg, sig]);
|
|
@@ -197,12 +197,15 @@ class GuardSigner {
|
|
|
197
197
|
this.requests.delete(id);
|
|
198
198
|
}
|
|
199
199
|
} catch (e) {
|
|
200
|
+
console.error('evaluateRequest error', e);
|
|
201
|
+
throw e;
|
|
200
202
|
// The guard signer may reject the request for a number of reasons
|
|
201
203
|
// like for example, if it's being the first signer (it waits for other signers to sign first)
|
|
202
204
|
// for now we ignore all errors, but we should probably handle them
|
|
203
205
|
// TODO: Filter real errors from control flow errors
|
|
204
206
|
}
|
|
205
207
|
}
|
|
208
|
+
|
|
206
209
|
suffix() {
|
|
207
210
|
return this.appendSuffix ? [3] : [];
|
|
208
211
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/guard",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20230831141757",
|
|
4
4
|
"description": "guard sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/guard",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"ethers": "^5.7.2",
|
|
13
|
-
"@0xsequence/core": "0.0.0-
|
|
14
|
-
"@0xsequence/signhub": "0.0.0-
|
|
13
|
+
"@0xsequence/core": "0.0.0-20230831141757",
|
|
14
|
+
"@0xsequence/signhub": "0.0.0-20230831141757"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"src",
|
package/src/signer.ts
CHANGED
|
@@ -58,7 +58,7 @@ export class GuardSigner implements signers.SapientSigner {
|
|
|
58
58
|
return
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
this.evaluateRequest(id, status.message, status, metadata)
|
|
61
|
+
this.evaluateRequest(id, status.message, status, metadata).catch(console.error)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
private packMsgAndSig(address: string, msg: BytesLike, sig: BytesLike, chainId: ethers.BigNumberish): string {
|
|
@@ -103,6 +103,8 @@ export class GuardSigner implements signers.SapientSigner {
|
|
|
103
103
|
this.requests.delete(id)
|
|
104
104
|
}
|
|
105
105
|
} catch (e) {
|
|
106
|
+
console.error('evaluateRequest error', e)
|
|
107
|
+
throw e
|
|
106
108
|
// The guard signer may reject the request for a number of reasons
|
|
107
109
|
// like for example, if it's being the first signer (it waits for other signers to sign first)
|
|
108
110
|
// for now we ignore all errors, but we should probably handle them
|