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

@cryptoeconomicslab/plasma

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cryptoeconomicslab/plasma - npm Package Compare versions

Comparing version 0.4.2-alpha.1 to 0.5.0

lib/types/ExitChallenge.d.ts

3

lib/config.d.ts
export interface PlasmaContractConfig {
adjudicationContract: string;
disputeManager: string;
checkpointDispute: string;
exitDispute: string;
commitment: string;

@@ -4,0 +7,0 @@ payoutContracts: {

export * from './types';
export * from './config';
export * from './verifier';

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

tslib_1.__exportStar(require("./types"), exports);
tslib_1.__exportStar(require("./verifier"), exports);
//# sourceMappingURL=index.js.map

7

lib/types/Block.d.ts

@@ -1,3 +0,3 @@

import { BigNumber, Struct, Integer } from '@cryptoeconomicslab/primitives';
import { DoubleLayerTree, DoubleLayerInclusionProof } from '@cryptoeconomicslab/merkle-tree';
import { BigNumber, Struct, FixedBytes, Integer } from '@cryptoeconomicslab/primitives';
import { DoubleLayerTree, DoubleLayerTreeLeaf, DoubleLayerInclusionProof } from '@cryptoeconomicslab/merkle-tree';
import StateUpdate from './StateUpdate';

@@ -17,3 +17,4 @@ export default class Block {

getTree(): DoubleLayerTree;
private generateLeaf;
getRoot(): FixedBytes;
static generateLeaf(stateUpdate: StateUpdate): DoubleLayerTreeLeaf;
private generateTree;

@@ -20,0 +21,0 @@ verifyInclusion(stateUpdate: StateUpdate, inclusionProof: DoubleLayerInclusionProof): boolean;

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

}
generateLeaf(stateUpdate) {
getRoot() {
return this.getTree().getRoot();
}
static generateLeaf(stateUpdate) {
return new merkle_tree_1.DoubleLayerTreeLeaf(stateUpdate.depositContractAddress, stateUpdate.range.start, primitives_1.FixedBytes.from(32, hash_1.Keccak256.hash(ovmContext.coder.encode(stateUpdate.stateObject.toStruct())).data));

@@ -43,3 +46,3 @@ }

});
const leaves = stateUpdates.map(this.generateLeaf);
const leaves = stateUpdates.map(Block.generateLeaf);
return new merkle_tree_1.DoubleLayerTree(leaves);

@@ -49,4 +52,4 @@ }

const tree = this.getTree();
const leaf = this.generateLeaf(stateUpdate);
if (tree.findIndex(leaf.data) === null) {
const leaf = Block.generateLeaf(stateUpdate);
if (tree.findIndexByInterval(leaf.start) === null) {
return false;

@@ -58,5 +61,5 @@ }

getInclusionProof(stateUpdate) {
const leaf = this.generateLeaf(stateUpdate);
const leaf = Block.generateLeaf(stateUpdate);
const tree = this.getTree();
const i = tree.findIndex(leaf.data);
const i = tree.findIndexByInterval(leaf.start);
if (i === null)

@@ -74,3 +77,3 @@ return null;

const key = b.toHexString();
map.set(key, stateUpdatesList.data[i].data.map((s) => this.StateUpdate.fromProperty(primitives_1.Property.fromStruct(s))));
map.set(key, stateUpdatesList.data[i].data.map((s) => StateUpdate_1.default.fromStruct(s)));
});

@@ -85,5 +88,5 @@ const mainchainBlockNumber = s.data[3].value;

const stateUpdates = this.stateUpdatesMap.get(addr) || [];
const list = stateUpdates.map(s => s.property.toStruct());
const list = stateUpdates.map(s => s.toStruct());
return primitives_1.List.from({
default: primitives_1.Property.getParamType
default: StateUpdate_1.default.getParamType
}, list);

@@ -104,4 +107,4 @@ });

default: () => primitives_1.List.default({
default: primitives_1.Property.getParamType
}, primitives_1.Property.getParamType())
default: StateUpdate_1.default.getParamType
}, StateUpdate_1.default.getParamType())
}, stateUpdatesList)

@@ -130,5 +133,5 @@ },

default: () => primitives_1.List.default({
default: primitives_1.Property.getParamType
}, primitives_1.Property.getParamType())
}, primitives_1.List.from({ default: primitives_1.Property.getParamType }, []))
default: StateUpdate_1.default.getParamType
}, StateUpdate_1.default.getParamType())
}, primitives_1.List.from({ default: StateUpdate_1.default.getParamType }, []))
},

@@ -135,0 +138,0 @@ {

@@ -1,13 +0,10 @@

import { Address, Bytes, Struct, Property } from '@cryptoeconomicslab/primitives';
import { Struct, BigNumber } from '@cryptoeconomicslab/primitives';
import { StateUpdate } from '.';
export default class Checkpoint {
deciderAddress: Address;
stateUpdate: Property;
constructor(deciderAddress: Address, stateUpdate: Property);
static default(): Checkpoint;
static getParamType(): Struct;
readonly stateUpdate: StateUpdate;
readonly claimedBlockNumber: BigNumber;
constructor(stateUpdate: StateUpdate, claimedBlockNumber: BigNumber);
static fromStruct(struct: Struct): Checkpoint;
static fromProperty(property: Property): Checkpoint;
get property(): Property;
toStruct(): Struct;
getId(): Bytes;
static getParamType(): Struct;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const primitives_1 = require("@cryptoeconomicslab/primitives");
const coder_1 = require("@cryptoeconomicslab/coder");
const _1 = require(".");
class Checkpoint {
constructor(deciderAddress, stateUpdate) {
this.deciderAddress = deciderAddress;
constructor(stateUpdate, claimedBlockNumber) {
this.stateUpdate = stateUpdate;
this.claimedBlockNumber = claimedBlockNumber;
}
static default() {
return new Checkpoint(primitives_1.Address.default(), new primitives_1.Property(primitives_1.Address.default(), []));
static fromStruct(struct) {
return new Checkpoint(_1.StateUpdate.fromStruct(struct.data[0].value), struct.data[1].value);
}
static getParamType() {
toStruct() {
return new primitives_1.Struct([
{ key: 'deciderAddress', value: primitives_1.Address.default() },
{ key: 'stateUpdate', value: primitives_1.Property.getParamType() }
{ key: 'stateUpdate', value: this.stateUpdate.toStruct() },
{ key: 'claimedBlockNumber', value: this.claimedBlockNumber }
]);
}
static fromStruct(struct) {
return new Checkpoint(struct.data[0].value, primitives_1.Property.fromStruct(struct.data[1].value));
}
static fromProperty(property) {
return new Checkpoint(property.deciderAddress, coder_1.decodeStructable(primitives_1.Property, ovmContext.coder, property.inputs[0]));
}
get property() {
const { coder } = ovmContext;
return new primitives_1.Property(this.deciderAddress, [
coder.encode(this.stateUpdate.toStruct())
]);
}
toStruct() {
static getParamType() {
return new primitives_1.Struct([
{ key: 'deciderAddress', value: this.deciderAddress },
{ key: 'stateUpdate', value: this.stateUpdate.toStruct() }
{ key: 'stateUpdate', value: _1.StateUpdate.getParamType() },
{ key: 'claimedBlockNumber', value: primitives_1.BigNumber.default() }
]);
}
getId() {
return primitives_1.Bytes.default();
}
}
exports.default = Checkpoint;
//# sourceMappingURL=Checkpoint.js.map

@@ -1,7 +0,8 @@

import { Address, Property } from '@cryptoeconomicslab/primitives';
import { Address } from '@cryptoeconomicslab/primitives';
import StateUpdate from './StateUpdate';
export default class DepositTransaction {
readonly depositContractAddress: Address;
readonly stateUpdate: Property;
constructor(depositContractAddress: Address, stateUpdate: Property);
readonly stateUpdate: StateUpdate;
constructor(depositContractAddress: Address, stateUpdate: StateUpdate);
toString(): string;
}

@@ -1,14 +0,10 @@

import StateUpdate from './StateUpdate';
import { DoubleLayerInclusionProof } from '@cryptoeconomicslab/merkle-tree';
import { Bytes, Address, Range, Property } from '@cryptoeconomicslab/primitives';
import IExit from './IExit';
export default class Exit implements IExit {
readonly exitPredicateAddress: Address;
import { Struct, BigNumber } from '@cryptoeconomicslab/primitives';
import { StateUpdate } from '.';
export default class Exit {
readonly stateUpdate: StateUpdate;
readonly inclusionProof: DoubleLayerInclusionProof;
readonly id: Bytes;
constructor(exitPredicateAddress: Address, stateUpdate: StateUpdate, inclusionProof: DoubleLayerInclusionProof, id: Bytes);
get property(): Property;
static fromProperty(property: Property): Exit;
get range(): Range;
readonly claimedBlockNumber: BigNumber;
constructor(stateUpdate: StateUpdate, claimedBlockNumber: BigNumber);
static fromStruct(struct: Struct): Exit;
toStruct(): Struct;
static getParamType(): Struct;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const StateUpdate_1 = tslib_1.__importDefault(require("./StateUpdate"));
const merkle_tree_1 = require("@cryptoeconomicslab/merkle-tree");
const primitives_1 = require("@cryptoeconomicslab/primitives");
const coder_1 = require("@cryptoeconomicslab/coder");
const hash_1 = require("@cryptoeconomicslab/hash");
const _1 = require(".");
class Exit {
constructor(exitPredicateAddress, stateUpdate, inclusionProof, id) {
this.exitPredicateAddress = exitPredicateAddress;
constructor(stateUpdate, claimedBlockNumber) {
this.stateUpdate = stateUpdate;
this.inclusionProof = inclusionProof;
this.id = id;
this.claimedBlockNumber = claimedBlockNumber;
}
get property() {
const { encode } = ovmContext.coder;
return new primitives_1.Property(this.exitPredicateAddress, [
encode(this.stateUpdate.property.toStruct()),
encode(this.inclusionProof.toStruct())
static fromStruct(struct) {
return new Exit(_1.StateUpdate.fromStruct(struct.data[0].value), struct.data[1].value);
}
toStruct() {
return new primitives_1.Struct([
{ key: 'stateUpdate', value: this.stateUpdate.toStruct() },
{ key: 'claimedBlockNumber', value: this.claimedBlockNumber }
]);
}
static fromProperty(property) {
const { coder } = ovmContext;
const stateUpdate = StateUpdate_1.default.fromProperty(coder_1.decodeStructable(primitives_1.Property, coder, property.inputs[0]));
const inclusionProof = coder_1.decodeStructable(merkle_tree_1.DoubleLayerInclusionProof, coder, property.inputs[1]);
const id = hash_1.Keccak256.hash(coder.encode(property.toStruct()));
return new Exit(property.deciderAddress, stateUpdate, inclusionProof, id);
static getParamType() {
return new primitives_1.Struct([
{ key: 'stateUpdate', value: _1.StateUpdate.getParamType() },
{ key: 'claimedBlockNumber', value: primitives_1.BigNumber.default() }
]);
}
get range() {
return this.stateUpdate.range;
}
}
exports.default = Exit;
//# sourceMappingURL=Exit.js.map

@@ -6,7 +6,9 @@ import StateUpdate from './StateUpdate';

import TransactionReceipt, { STATUS as TRANSACTION_STATUS } from './TransactionReceipt';
import UnsignedTransaction from './UnsignedTransaction';
import SignedTransaction from './SignedTransaction';
import IncludedTransaction from './IncludedTransaction';
import DepositTransaction from './DepositTransaction';
import Checkpoint from './Checkpoint';
import Exit from './Exit';
import ExitDeposit from './ExitDeposit';
import IExit from './IExit';
export { StateUpdate, StateUpdateRecord, Block, Transaction, DepositTransaction, TransactionReceipt, TRANSACTION_STATUS, Checkpoint, IExit, Exit, ExitDeposit };
export * from './ExitChallenge';
export { StateUpdate, StateUpdateRecord, Block, DepositTransaction, TransactionReceipt, TRANSACTION_STATUS, Checkpoint, Exit, Transaction, UnsignedTransaction, SignedTransaction, IncludedTransaction };

@@ -10,7 +10,11 @@ "use strict";

exports.Block = Block_1.default;
const Transaction_1 = tslib_1.__importDefault(require("./Transaction"));
exports.Transaction = Transaction_1.default;
const TransactionReceipt_1 = tslib_1.__importStar(require("./TransactionReceipt"));
exports.TransactionReceipt = TransactionReceipt_1.default;
exports.TRANSACTION_STATUS = TransactionReceipt_1.STATUS;
const UnsignedTransaction_1 = tslib_1.__importDefault(require("./UnsignedTransaction"));
exports.UnsignedTransaction = UnsignedTransaction_1.default;
const SignedTransaction_1 = tslib_1.__importDefault(require("./SignedTransaction"));
exports.SignedTransaction = SignedTransaction_1.default;
const IncludedTransaction_1 = tslib_1.__importDefault(require("./IncludedTransaction"));
exports.IncludedTransaction = IncludedTransaction_1.default;
const DepositTransaction_1 = tslib_1.__importDefault(require("./DepositTransaction"));

@@ -22,4 +26,3 @@ exports.DepositTransaction = DepositTransaction_1.default;

exports.Exit = Exit_1.default;
const ExitDeposit_1 = tslib_1.__importDefault(require("./ExitDeposit"));
exports.ExitDeposit = ExitDeposit_1.default;
tslib_1.__exportStar(require("./ExitChallenge"), exports);
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import { Address, Bytes, BigNumber, Range, Property } from '@cryptoeconomicslab/primitives';
import { Address, Bytes, BigNumber, Range, Property, Struct } from '@cryptoeconomicslab/primitives';
import { RangeRecord } from '@cryptoeconomicslab/db';

@@ -6,3 +6,2 @@ import StateUpdateRecord from './StateUpdateRecord';

export default class StateUpdate {
deciderAddress: Address;
depositContractAddress: Address;

@@ -12,6 +11,4 @@ range: Range;

stateObject: Property;
constructor(deciderAddress: Address, depositContractAddress: Address, range: Range, blockNumber: BigNumber, stateObject: Property);
constructor(depositContractAddress: Address, range: Range, blockNumber: BigNumber, stateObject: Property);
get amount(): JSBI;
get predicateAddress(): Address;
get property(): Property;
update({ depositContractAddress, range, blockNumber, stateObject }: {

@@ -23,3 +20,2 @@ depositContractAddress?: Address;

}): void;
static fromProperty(property: Property): StateUpdate;
static fromRangeRecord(r: RangeRecord): StateUpdate;

@@ -29,2 +25,6 @@ static fromRecord(record: StateUpdateRecord, range: Range): StateUpdate;

toRecord(): StateUpdateRecord;
toString(): string;
static getParamType(): Struct;
static fromStruct(struct: Struct): StateUpdate;
toStruct(): Struct;
}

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

class StateUpdate {
constructor(deciderAddress, depositContractAddress, range, blockNumber, stateObject) {
this.deciderAddress = deciderAddress;
constructor(depositContractAddress, range, blockNumber, stateObject) {
this.depositContractAddress = depositContractAddress;

@@ -21,14 +20,2 @@ this.range = range;

}
get predicateAddress() {
return this.property.deciderAddress;
}
get property() {
const { coder } = ovmContext;
return new primitives_1.Property(this.deciderAddress, [
coder.encode(this.depositContractAddress),
coder.encode(this.range.toStruct()),
coder.encode(this.blockNumber),
coder.encode(this.stateObject.toStruct())
]);
}
update({ depositContractAddress, range, blockNumber, stateObject }) {

@@ -48,5 +35,2 @@ if (depositContractAddress) {

}
static fromProperty(property) {
return new StateUpdate(property.deciderAddress, ovmContext.coder.decode(primitives_1.Address.default(), property.inputs[0]), coder_1.decodeStructable(primitives_1.Range, ovmContext.coder, property.inputs[1]), ovmContext.coder.decode(primitives_1.BigNumber.default(), property.inputs[2]), coder_1.decodeStructable(primitives_1.Property, ovmContext.coder, property.inputs[3]));
}
static fromRangeRecord(r) {

@@ -56,19 +40,38 @@ return StateUpdate.fromRecord(coder_1.decodeStructable(StateUpdateRecord_1.default, ovmContext.coder, r.value), new primitives_1.Range(r.start, r.end));

static fromRecord(record, range) {
const inputs = [
record.depositContractAddress,
range.toStruct(),
record.blockNumber,
record.stateObject.toStruct()
].map(ovmContext.coder.encode);
const property = new primitives_1.Property(record.predicateAddress, inputs);
return StateUpdate.fromProperty(property);
return new StateUpdate(record.depositContractAddress, range, record.blockNumber, record.stateObject);
}
get hash() {
return hash_1.Keccak256.hash(ovmContext.coder.encode(this.property.toStruct()));
return hash_1.Keccak256.hash(ovmContext.coder.encode(this.toStruct()));
}
toRecord() {
return new StateUpdateRecord_1.default(this.deciderAddress, this.depositContractAddress, this.blockNumber, this.stateObject);
return new StateUpdateRecord_1.default(this.depositContractAddress, this.blockNumber, this.stateObject);
}
toString() {
return `StateUpdate(depositContractAddress: ${this.depositContractAddress.toString()}, blockNumber: ${this.blockNumber.toString()}, range: ${this.range.toString()}, so: ${this.stateObject.deciderAddress.data})`;
}
static getParamType() {
return new primitives_1.Struct([
{ key: 'depositContractAddress', value: primitives_1.Address.default() },
{ key: 'range', value: primitives_1.Range.getParamType() },
{ key: 'blockNumber', value: primitives_1.BigNumber.default() },
{ key: 'stateObject', value: primitives_1.Property.getParamType() }
]);
}
static fromStruct(struct) {
const depositContractAddress = struct.data[0].value;
const range = struct.data[1].value;
const blockNumber = struct.data[2].value;
const stateObject = struct.data[3].value;
return new StateUpdate(depositContractAddress, primitives_1.Range.fromStruct(range), blockNumber, primitives_1.Property.fromStruct(stateObject));
}
toStruct() {
return new primitives_1.Struct([
{ key: 'depositContractAddress', value: this.depositContractAddress },
{ key: 'range', value: this.range.toStruct() },
{ key: 'blockNumber', value: this.blockNumber },
{ key: 'stateObject', value: this.stateObject.toStruct() }
]);
}
}
exports.default = StateUpdate;
//# sourceMappingURL=StateUpdate.js.map
import { Address, Struct, BigNumber, Property } from '@cryptoeconomicslab/primitives';
export default class StateUpdateRecord {
readonly predicateAddress: Address;
readonly depositContractAddress: Address;
readonly blockNumber: BigNumber;
readonly stateObject: Property;
constructor(predicateAddress: Address, depositContractAddress: Address, blockNumber: BigNumber, stateObject: Property);
constructor(depositContractAddress: Address, blockNumber: BigNumber, stateObject: Property);
static default(): StateUpdateRecord;

@@ -9,0 +8,0 @@ static getParamType(): Struct;

@@ -5,4 +5,3 @@ "use strict";

class StateUpdateRecord {
constructor(predicateAddress, depositContractAddress, blockNumber, stateObject) {
this.predicateAddress = predicateAddress;
constructor(depositContractAddress, blockNumber, stateObject) {
this.depositContractAddress = depositContractAddress;

@@ -13,7 +12,6 @@ this.blockNumber = blockNumber;

static default() {
return new StateUpdateRecord(primitives_1.Address.default(), primitives_1.Address.default(), primitives_1.BigNumber.default(), new primitives_1.Property(primitives_1.Address.default(), []));
return new StateUpdateRecord(primitives_1.Address.default(), primitives_1.BigNumber.default(), new primitives_1.Property(primitives_1.Address.default(), []));
}
static getParamType() {
return new primitives_1.Struct([
{ key: 'predicateAddress', value: primitives_1.Address.default() },
{ key: 'depositContractAddress', value: primitives_1.Address.default() },

@@ -25,7 +23,6 @@ { key: 'blockNumber', value: primitives_1.BigNumber.default() },

static fromStruct(struct) {
return new StateUpdateRecord(struct.data[0].value, struct.data[1].value, struct.data[2].value, primitives_1.Property.fromStruct(struct.data[3].value));
return new StateUpdateRecord(struct.data[0].value, struct.data[1].value, primitives_1.Property.fromStruct(struct.data[2].value));
}
toStruct() {
return new primitives_1.Struct([
{ key: 'predicateAddress', value: this.predicateAddress },
{ key: 'depositContractAddress', value: this.depositContractAddress },

@@ -32,0 +29,0 @@ { key: 'blockNumber', value: this.blockNumber },

@@ -1,3 +0,3 @@

import { Address, Range, BigNumber, Bytes, Struct, Property } from '@cryptoeconomicslab/primitives';
export default class Transaction {
import { Address, Bytes, Range, BigNumber, Struct, Property } from '@cryptoeconomicslab/primitives';
export default interface Transaction {
depositContractAddress: Address;

@@ -8,12 +8,5 @@ range: Range;

from: Address;
signature: Bytes;
constructor(depositContractAddress: Address, range: Range, maxBlockNumber: BigNumber, stateObject: Property, from: Address, signature?: Bytes);
static default(): Transaction;
static getParamTypes(): Struct;
static fromStruct(struct: Struct): Transaction;
static fromProperty(property: Property): Transaction;
message: Bytes;
toStruct(): Struct;
get body(): Struct;
getHash(): Bytes;
toProperty(deciderAddress: Address): Property;
toString(): string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const primitives_1 = require("@cryptoeconomicslab/primitives");
const hash_1 = require("@cryptoeconomicslab/hash");
class Transaction {
constructor(depositContractAddress, range, maxBlockNumber, stateObject, from, signature = primitives_1.Bytes.default()) {
this.depositContractAddress = depositContractAddress;
this.range = range;
this.maxBlockNumber = maxBlockNumber;
this.stateObject = stateObject;
this.from = from;
this.signature = signature;
}
static default() {
return new Transaction(primitives_1.Address.default(), new primitives_1.Range(primitives_1.BigNumber.default(), primitives_1.BigNumber.default()), primitives_1.BigNumber.default(), new primitives_1.Property(primitives_1.Address.default(), []), primitives_1.Address.default(), primitives_1.Bytes.default());
}
static getParamTypes() {
return new primitives_1.Struct([
{ key: 'depositContractAddress', value: primitives_1.Address.default() },
{ key: 'range', value: primitives_1.Range.getParamType() },
{ key: 'maxBlockNumber', value: primitives_1.BigNumber.default() },
{ key: 'stateObject', value: primitives_1.Property.getParamType() },
{ key: 'from', value: primitives_1.Address.default() },
{ key: 'signature', value: primitives_1.Bytes.default() }
]);
}
static fromStruct(struct) {
const depositContractAddress = struct.data[0].value;
const range = struct.data[1].value;
const maxBlockNumber = struct.data[2].value;
const stateObject = struct.data[3].value;
const from = struct.data[4].value;
const signature = struct.data[5].value;
return new Transaction(depositContractAddress, primitives_1.Range.fromStruct(range), maxBlockNumber, primitives_1.Property.fromStruct(stateObject), from, signature);
}
static fromProperty(property) {
const depositContractAddress = ovmContext.coder.decode(primitives_1.Address.default(), property.inputs[0]);
const range = primitives_1.Range.fromStruct(ovmContext.coder.decode(primitives_1.Range.getParamType(), property.inputs[1]));
const maxBlockNumber = ovmContext.coder.decode(primitives_1.BigNumber.default(), property.inputs[2]);
const stateObject = primitives_1.Property.fromStruct(ovmContext.coder.decode(primitives_1.Property.getParamType(), property.inputs[3]));
return new Transaction(depositContractAddress, range, maxBlockNumber, stateObject, primitives_1.Address.default(), primitives_1.Bytes.default());
}
toStruct() {
return new primitives_1.Struct([
{ key: 'depositContractAddress', value: this.depositContractAddress },
{ key: 'range', value: this.range.toStruct() },
{ key: 'maxBlockNumber', value: this.maxBlockNumber },
{ key: 'stateObject', value: this.stateObject.toStruct() },
{ key: 'from', value: this.from },
{ key: 'signature', value: this.signature }
]);
}
get body() {
return new primitives_1.Struct([
{ key: 'depositContractAddress', value: this.depositContractAddress },
{ key: 'range', value: this.range.toStruct() },
{ key: 'maxBlockNumber', value: this.maxBlockNumber },
{ key: 'stateObject', value: this.stateObject.toStruct() },
{ key: 'from', value: this.from }
]);
}
getHash() {
return hash_1.Keccak256.hash(ovmContext.coder.encode(this.body));
}
toProperty(deciderAddress) {
return new primitives_1.Property(deciderAddress, [
ovmContext.coder.encode(this.depositContractAddress),
ovmContext.coder.encode(this.range.toStruct()),
ovmContext.coder.encode(this.maxBlockNumber),
ovmContext.coder.encode(this.stateObject.toStruct())
]);
}
}
exports.default = Transaction;
//# sourceMappingURL=Transaction.js.map
{
"name": "@cryptoeconomicslab/plasma",
"version": "0.4.2-alpha.1",
"version": "0.5.0",
"description": "plasma module",

@@ -40,12 +40,14 @@ "author": {

"dependencies": {
"@cryptoeconomicslab/db": "^0.4.1",
"@cryptoeconomicslab/hash": "^0.4.1",
"@cryptoeconomicslab/merkle-tree": "^0.4.1",
"@cryptoeconomicslab/db": "^0.5.0",
"@cryptoeconomicslab/hash": "^0.5.0",
"@cryptoeconomicslab/merkle-tree": "^0.5.0",
"@cryptoeconomicslab/wallet": "^0.5.0",
"jsbi": "^3.1.2"
},
"devDependencies": {
"@cryptoeconomicslab/coder": "^0.4.1",
"@cryptoeconomicslab/context": "^0.4.1",
"@cryptoeconomicslab/primitives": "^0.4.1",
"@cryptoeconomicslab/utils": "^0.4.1"
"@cryptoeconomicslab/coder": "^0.5.0",
"@cryptoeconomicslab/context": "^0.5.0",
"@cryptoeconomicslab/eth-coder": "^0.5.0",
"@cryptoeconomicslab/primitives": "^0.5.0",
"@cryptoeconomicslab/utils": "^0.5.0"
},

@@ -55,3 +57,3 @@ "peerDependencies": {

},
"gitHead": "4c8cde191b4d33119dd23863c1390d52e3215167"
"gitHead": "83bf87b438d3bc2161d92af731c0cc54da78c77f"
}

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