Skip to content

Commit

Permalink
feat: SES compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Feb 26, 2024
1 parent 348d739 commit f67bda7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/cosmic-proto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@
"@cosmjs/proto-signing": "^0.32.2",
"@cosmjs/stargate": "^0.32.2",
"@cosmjs/tendermint-rpc": "^0.32.2",
"@endo/init": "^1.0.3"
"@endo/init": "^1.0.3",
"axios": "^1.6.7"
},
"resolutions": {
"**/protobufjs": "^7.2.4"
},
"ava": {
"typescript": {
Expand Down
3 changes: 1 addition & 2 deletions packages/cosmic-proto/test/test-exports.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
// @ts-nocheck tsc also not finding the "exports" map
import test from 'ava';

// FIXME not compatible with regular lockdown, even with { overrideTaming: 'severe' }
import '@endo/init/legacy.js';
import '@endo/init';

import * as index from '@agoric/cosmic-proto';
import * as swingsetMsgs from '@agoric/cosmic-proto/swingset/msgs.js';
Expand Down
36 changes: 36 additions & 0 deletions patches/axios+1.6.7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/node_modules/axios/dist/node/axios.cjs b/node_modules/axios/dist/node/axios.cjs
index 9099d87..def15d4 100644
--- a/node_modules/axios/dist/node/axios.cjs
+++ b/node_modules/axios/dist/node/axios.cjs
@@ -370,9 +370,9 @@ function merge(/* obj1, obj2, obj3, ... */) {
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
forEach(b, (val, key) => {
if (thisArg && isFunction(val)) {
- a[key] = bind(val, thisArg);
+ Object.defineProperty(a, key, {value: bind(val, thisArg)});
} else {
- a[key] = val;
+ Object.defineProperty(a, key, {value: val});
}
}, {allOwnKeys});
return a;
@@ -403,7 +403,9 @@ const stripBOM = (content) => {
*/
const inherits = (constructor, superConstructor, props, descriptors) => {
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
- constructor.prototype.constructor = constructor;
+ Object.defineProperty(constructor, 'constructor', {
+ value: constructor
+ });
Object.defineProperty(constructor, 'super', {
value: superConstructor.prototype
});
@@ -570,7 +572,7 @@ const reduceDescriptors = (obj, reducer) => {
forEach(descriptors, (descriptor, name) => {
let ret;
if ((ret = reducer(descriptor, name, obj)) !== false) {
- reducedDescriptors[name] = ret || descriptor;
+ Object.defineProperty(reducedDescriptors, name, { value: ret || descriptor });
}
});

0 comments on commit f67bda7

Please sign in to comment.