New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cryptoeconomicslab/ovm

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cryptoeconomicslab/ovm - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

4

lib/deciders/atomic/IsContainedDecider.js

@@ -13,4 +13,4 @@ "use strict";

}
const first = coder_1.decodeStructable(primitives_1.Range, manager.coder, inputs[0]);
const second = coder_1.decodeStructable(primitives_1.Range, manager.coder, inputs[1]);
const first = coder_1.decodeStructable(primitives_1.Range, ovmContext.coder, inputs[0]);
const second = coder_1.decodeStructable(primitives_1.Range, ovmContext.coder, inputs[1]);
return {

@@ -17,0 +17,0 @@ outcome: first.start.data >= second.start.data &&

@@ -13,5 +13,5 @@ "use strict";

}
const first = coder_1.decodeStructable(primitives_1.Range, manager.coder, inputs[0]);
const first = coder_1.decodeStructable(primitives_1.Range, ovmContext.coder, inputs[0]);
const firstAmount = first.end.data - first.start.data;
const second = coder_1.decodeStructable(primitives_1.Range, manager.coder, inputs[1]);
const second = coder_1.decodeStructable(primitives_1.Range, ovmContext.coder, inputs[1]);
const secondAmount = second.end.data - second.start.data;

@@ -18,0 +18,0 @@ return {

@@ -10,3 +10,3 @@ "use strict";

try {
properties = inputs.map(i => helpers_1.decodeProperty(manager.coder, i));
properties = inputs.map(i => helpers_1.decodeProperty(ovmContext.coder, i));
}

@@ -25,4 +25,4 @@ catch (e) {

const challenge = {
property: new types_1.Property(manager.getDeciderAddress(types_1.LogicalConnective.Not), [manager.coder.encode(p.toStruct())]),
challengeInput: manager.coder.encode(primitives_1.Integer.from(index))
property: new types_1.Property(manager.getDeciderAddress(types_1.LogicalConnective.Not), [ovmContext.coder.encode(p.toStruct())]),
challengeInput: ovmContext.coder.encode(primitives_1.Integer.from(index))
};

@@ -29,0 +29,0 @@ return {

@@ -14,3 +14,3 @@ "use strict";

}
const innerProperty = types_1.Property.fromStruct(manager.coder.decode(types_1.Property.getParamType(), inputs[2]));
const innerProperty = types_1.Property.fromStruct(ovmContext.coder.decode(types_1.Property.getParamType(), inputs[2]));
const variableName = inputs[1].intoString();

@@ -23,3 +23,3 @@ const falseDecisions = await Promise.all(witnesses.map(async (q) => {

const challenge = {
property: new types_1.Property(manager.getDeciderAddress(types_1.LogicalConnective.Not), [manager.coder.encode(innerProperty.toStruct())]),
property: new types_1.Property(manager.getDeciderAddress(types_1.LogicalConnective.Not), [ovmContext.coder.encode(innerProperty.toStruct())]),
challengeInput: q

@@ -26,0 +26,0 @@ };

@@ -6,3 +6,3 @@ "use strict";

async decide(manager, inputs, substitutions = {}) {
const property = types_1.Property.fromStruct(manager.coder.decode(types_1.Property.getParamType(), inputs[0]));
const property = types_1.Property.fromStruct(ovmContext.coder.decode(types_1.Property.getParamType(), inputs[0]));
const decision = await manager.decide(property);

@@ -9,0 +9,0 @@ return {

@@ -9,3 +9,3 @@ "use strict";

try {
properties = inputs.map(i => helpers_1.decodeProperty(manager.coder, i));
properties = inputs.map(i => helpers_1.decodeProperty(ovmContext.coder, i));
}

@@ -30,5 +30,5 @@ catch (e) {

.map(p => new types_1.Property(manager.getDeciderAddress(types_1.LogicalConnective.Not), [
helpers_1.encodeProperty(manager.coder, p)
helpers_1.encodeProperty(ovmContext.coder, p)
]))
.map(i => helpers_1.encodeProperty(manager.coder, i))),
.map(i => helpers_1.encodeProperty(ovmContext.coder, i))),
challengeInput: null

@@ -35,0 +35,0 @@ };

@@ -14,3 +14,3 @@ "use strict";

}
const innerProperty = types_1.Property.fromStruct(manager.coder.decode(types_1.Property.getParamType(), inputs[2]));
const innerProperty = types_1.Property.fromStruct(ovmContext.coder.decode(types_1.Property.getParamType(), inputs[2]));
const variableName = inputs[1].intoString();

@@ -17,0 +17,0 @@ const decisions = await Promise.all(witnesses.map(async (witness) => {

@@ -10,3 +10,3 @@ "use strict";

async decide(manager, inputs, substitutions = {}) {
const property = this.predicateSource.decompileProperty(new types_1.Property(this.predicateSource.deployedAddress, inputs), manager.shortnameMap, this.constantTable, manager.coder);
const property = this.predicateSource.decompileProperty(new types_1.Property(this.predicateSource.deployedAddress, inputs), manager.shortnameMap, this.constantTable);
return manager.decide(property, substitutions);

@@ -13,0 +13,0 @@ }

import { Bytes, Address } from '@cryptoeconomicslab/primitives';
import { Coder } from '@cryptoeconomicslab/coder';
import { CompiledPredicate as TranspilerCompiledPredicate, AtomicProposition, IntermediateCompiledPredicate } from '@cryptoeconomicslab/ovm-transpiler';

@@ -15,3 +14,3 @@ import { Property } from '../types';

[key: string]: Bytes;
}, coder?: Coder): Property;
}): Property;
}

@@ -24,6 +23,6 @@ export declare const createAtomicPropositionCall: (input: AtomicProposition, def: IntermediateCompiledPredicate, context: {

};
}, coder?: Coder) => Bytes;
}) => Bytes;
export declare const createSubstitutions: (inputDefs: string[], inputs: Bytes[]) => {
[key: string]: Bytes;
};
export declare const constructInput: (anInput: Bytes, children: number[], coder?: Coder) => Bytes;
export declare const constructInput: (anInput: Bytes, children: number[]) => Bytes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const primitives_1 = require("@cryptoeconomicslab/primitives");
const db_1 = require("@cryptoeconomicslab/db");
const coder_1 = tslib_1.__importStar(require("@cryptoeconomicslab/coder"));
const coder_1 = require("@cryptoeconomicslab/coder");
const ovm_parser_1 = require("@cryptoeconomicslab/ovm-parser");

@@ -30,3 +29,3 @@ const ovm_transpiler_1 = require("@cryptoeconomicslab/ovm-transpiler");

}
decompileProperty(compiledProperty, predicateTable, constantTable = {}, coder = coder_1.default) {
decompileProperty(compiledProperty, predicateTable, constantTable = {}) {
const name = compiledProperty.inputs[0].intoString();

@@ -59,7 +58,7 @@ const findContract = (name) => {

primitives_1.Bytes.fromString(def.inputs[1]),
exports.createAtomicPropositionCall(def.inputs[2], def, context, coder)
exports.createAtomicPropositionCall(def.inputs[2], def, context)
]);
}
else {
return new types_1.Property(predicateAddress, def.inputs.map(i => exports.createAtomicPropositionCall(i, def, context, coder)));
return new types_1.Property(predicateAddress, def.inputs.map(i => exports.createAtomicPropositionCall(i, def, context)));
}

@@ -69,3 +68,3 @@ }

exports.CompiledPredicate = CompiledPredicate;
exports.createAtomicPropositionCall = (input, def, context, coder = coder_1.default) => {
exports.createAtomicPropositionCall = (input, def, context) => {
if (input.predicate.type == 'AtomicPredicateCall') {

@@ -83,9 +82,9 @@ const originalAddress = context.compiledProperty.deciderAddress;

}
return coder.encode(createChildProperty(atomicPredicateAddress, input, context.compiledProperty, context.constantTable, coder).toStruct());
return ovmContext.coder.encode(createChildProperty(atomicPredicateAddress, input, context.compiledProperty, context.constantTable).toStruct());
}
else if (input.predicate.type == 'InputPredicateCall') {
const property = coder_1.decodeStructable(types_1.Property, coder, context.compiledProperty.inputs[input.predicate.source.inputIndex]);
const property = coder_1.decodeStructable(types_1.Property, ovmContext.coder, context.compiledProperty.inputs[input.predicate.source.inputIndex]);
const extraInputBytes = input.inputs.map(i => context.compiledProperty.inputs[i.inputIndex]);
property.inputs = property.inputs.concat(extraInputBytes);
return coder.encode(property.toStruct());
return ovmContext.coder.encode(property.toStruct());
}

@@ -99,3 +98,3 @@ else if (input.predicate.type == 'VariablePredicateCall') {

};
const createChildProperty = (atomicPredicateAddress, proposition, compiledProperty, constantsTable, coder = coder_1.default) => {
const createChildProperty = (atomicPredicateAddress, proposition, compiledProperty, constantsTable) => {
return new types_1.Property(atomicPredicateAddress, proposition.inputs.map(i => {

@@ -106,3 +105,3 @@ if (i.type == 'NormalInput') {

}
return exports.constructInput(compiledProperty.inputs[i.inputIndex], i.children, coder);
return exports.constructInput(compiledProperty.inputs[i.inputIndex], i.children);
}

@@ -140,7 +139,7 @@ else if (i.type == 'VariableInput') {

};
exports.constructInput = (anInput, children, coder = coder_1.default) => {
exports.constructInput = (anInput, children) => {
if (children.length == 0) {
return anInput;
}
const property = coder_1.decodeStructable(types_1.Property, coder, anInput);
const property = coder_1.decodeStructable(types_1.Property, ovmContext.coder, anInput);
if (children[0] == -1) {

@@ -150,5 +149,5 @@ return primitives_1.Bytes.fromHexString(property.deciderAddress.data);

else {
return exports.constructInput(property.inputs[children[0]], children.slice(1), coder);
return exports.constructInput(property.inputs[children[0]], children.slice(1));
}
};
//# sourceMappingURL=CompiledPredicate.js.map

@@ -6,1 +6,2 @@ export * from './types';

export * from './load';
export * from './helpers';

@@ -9,2 +9,3 @@ "use strict";

tslib_1.__exportStar(require("./load"), exports);
tslib_1.__exportStar(require("./helpers"), exports);
//# sourceMappingURL=index.js.map
{
"name": "@cryptoeconomicslab/ovm",
"version": "0.0.3",
"version": "0.0.4",
"description": "ovm",

@@ -51,12 +51,17 @@ "author": {

"dependencies": {
"@cryptoeconomicslab/coder": "^0.0.3",
"@cryptoeconomicslab/db": "^0.0.3",
"@cryptoeconomicslab/coder": "^0.0.4",
"@cryptoeconomicslab/db": "^0.0.4",
"@cryptoeconomicslab/ovm-parser": "^0.2.3",
"@cryptoeconomicslab/ovm-transpiler": "^0.2.3",
"@cryptoeconomicslab/primitives": "^0.0.3",
"@cryptoeconomicslab/signature": "^0.0.3",
"@cryptoeconomicslab/utils": "^0.0.3",
"@cryptoeconomicslab/primitives": "^0.0.4",
"@cryptoeconomicslab/signature": "^0.0.4",
"@cryptoeconomicslab/utils": "^0.0.4",
"ethers": "^4.0.43"
},
"gitHead": "8254f670372367f6aadaf15d121dba00e7e3188d"
"gitHead": "fcecc0d45bf8021589939be27d93b385a378ec3a",
"devDependencies": {
"@cryptoeconomicslab/coder": "^0.0.3",
"@cryptoeconomicslab/context": "^0.0.4",
"@cryptoeconomicslab/level-kvs": "0.0.3"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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