Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@agoric/captp

Package Overview
Dependencies
Maintainers
5
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agoric/captp - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

CHANGELOG.md

75

lib/captp.js

@@ -14,5 +14,5 @@ // This logic was mostly lifted from @agoric/swingset-vat liveSlots.js

// eslint-disable-next-line no-use-before-define
serializeSlot,
convertValToSlot,
// eslint-disable-next-line no-use-before-define
unserializeSlot,
convertSlotToVal,
);

@@ -30,45 +30,33 @@

function serializeSlot(val, slots, slotMap) {
if (!slotMap.has(val)) {
function convertValToSlot(val) {
if (!valToSlot.has(val)) {
let slot;
if (!valToSlot.has(val)) {
// new export
if (HandledPromise.resolve(val) === val) {
lastPromiseID += 1;
const promiseID = lastPromiseID;
slot = `p+${promiseID}`;
val.then(
res =>
send({
type: 'CTP_RESOLVE',
promiseID,
res: serialize(harden(res)),
}),
rej =>
send({
type: 'CTP_RESOLVE',
promiseID,
rej: serialize(harden(rej)),
}),
);
} else {
lastExportID += 1;
const exportID = lastExportID;
slot = `o+${exportID}`;
}
valToSlot.set(val, slot);
slotToVal.set(slot, val);
// new export
if (HandledPromise.resolve(val) === val) {
lastPromiseID += 1;
const promiseID = lastPromiseID;
slot = `p+${promiseID}`;
val.then(
res =>
send({
type: 'CTP_RESOLVE',
promiseID,
res: serialize(harden(res)),
}),
rej =>
send({
type: 'CTP_RESOLVE',
promiseID,
rej: serialize(harden(rej)),
}),
);
} else {
lastExportID += 1;
const exportID = lastExportID;
slot = `o+${exportID}`;
}
slot = valToSlot.get(val);
const slotIndex = slots.length;
slots.push(slot);
slotMap.set(val, slotIndex);
valToSlot.set(val, slot);
slotToVal.set(slot, val);
}
const slotIndex = slotMap.get(val);
return harden({
[QCLASS]: 'slot',
index: slotIndex,
});
return valToSlot.get(val);
}

@@ -119,4 +107,3 @@

function unserializeSlot(data, slots) {
const theirSlot = slots[Nat(data.index)];
function convertSlotToVal(theirSlot) {
let val;

@@ -123,0 +110,0 @@ const otherDir = theirSlot[1] === '+' ? '-' : '+';

{
"name": "@agoric/captp",
"version": "1.2.0",
"version": "1.2.1",
"description": "Capability Transfer Protocol for distributed objects",

@@ -11,6 +11,6 @@ "keywords": [

"author": "Michael FIG <michael@fig.org>",
"homepage": "https://github.com/Agoric/CapTP#readme",
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
"license": "Apache-2.0",
"main": "dist/captp.cjs.js",
"module": "dist/captp.esm.js",
"module": "lib/captp.js",
"browser": "dist/captp.umd.js",

@@ -27,3 +27,3 @@ "directories": {

"type": "git",
"url": "git+https://github.com/Agoric/CapTP.git"
"url": "git+https://github.com/Agoric/agoric-sdk.git"
},

@@ -33,6 +33,6 @@ "scripts": {

"test": "tape -r esm 'test/**/*.js'",
"lint-fix": "eslint --fix '**/*.{js,jsx}'",
"lint-check": "eslint '**/*.{js,jsx}'",
"lint-fix-jessie": "eslint -c '.eslintrc-jessie.js' --fix '**/*.{js,jsx}'",
"lint-check-jessie": "eslint -c '.eslintrc-jessie.js' '**/*.{js,jsx}'"
"lint-fix": "eslint --fix '**/*.js'",
"lint-check": "eslint '**/*.js'",
"lint-fix-jessie": "eslint -c '.eslintrc-jessie.js' --fix '**/*.js'",
"lint-check-jessie": "eslint -c '.eslintrc-jessie.js' '**/*.js'"
},

@@ -45,5 +45,5 @@ "devDependencies": {

"dependencies": {
"@agoric/eventual-send": "^0.5.0",
"@agoric/eventual-send": "^0.6.0",
"@agoric/harden": "^0.0.4",
"@agoric/marshal": "^0.1.1",
"@agoric/marshal": "^0.1.3",
"@agoric/nat": "^2.0.1",

@@ -56,4 +56,8 @@ "esm": "^3.2.5",

"bugs": {
"url": "https://github.com/Agoric/CapTP/issues"
}
"url": "https://github.com/Agoric/agoric-sdk/issues"
},
"publishConfig": {
"access": "public"
},
"gitHead": "fab9b8247f684b3a849c09611e0e9d16fffbea3a"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc