Skip to content

Commit

Permalink
fix: motivate some changes, drop an extraneous JSON-laundering
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Dec 15, 2020
1 parent ebfc6a8 commit 6a1dfe0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions golang/cosmos/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# sed is more fragile, but we don't want to take a Node.js or jq dependency
# just to compile the Golang pieces under Docker.
NAME := $(shell sed -ne 's/.*"name": "\([^"]*\)".*/\1/p' package.json)
VERSION := $(shell sed -ne 's/.*"version": "\([^"]*\)".*/\1/p' package.json)
COMMIT = $(shell hash=`git rev-parse --short HEAD 2>/dev/null`; if test -n "$$hash"; then echo $$hash`git diff --quiet || echo -dirty`; else cat git-revision.txt; fi)
Expand Down
3 changes: 2 additions & 1 deletion packages/cosmic-swingset/lib/ag-solo/vats/vat-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function buildRootObject(vatPowers) {
const channelID = channelHandleToId.get(channelHandle);
if (channelID) {
const o = { ...obj, meta: { channelID } };
D(commandDevice).sendBroadcast(JSON.parse(JSON.stringify(o)));
D(commandDevice).sendBroadcast(o);
}
}
};
Expand Down Expand Up @@ -143,6 +143,7 @@ export function buildRootObject(vatPowers) {
async inbound(count, rawObj) {
// Launder the data, since the command device tends to pass device nodes
// when there are empty objects, which screw things up for us.
// Analysis is in https://github.com/Agoric/agoric-sdk/pull/1956
const obj = JSON.parse(JSON.stringify(rawObj));
console.debug(
`vat-http.inbound (from browser) ${count}`,
Expand Down

0 comments on commit 6a1dfe0

Please sign in to comment.