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.5.2-alpha.3 to 0.6.0-alpha.0

5

lib/types/IncludedTransaction.d.ts

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

import { Address, Range, BigNumber, Bytes, Struct, Property } from '@cryptoeconomicslab/primitives';
import { Address, Range, BigNumber, Bytes, Struct, Property, FixedBytes } from '@cryptoeconomicslab/primitives';
import { Transaction, UnsignedTransaction, SignedTransaction } from './';

@@ -8,6 +8,7 @@ export default class IncludedTransaction implements Transaction {

readonly stateObject: Property;
readonly chunkId: FixedBytes;
readonly from: Address;
readonly signature: Bytes;
readonly includedBlockNumber: BigNumber;
constructor(depositContractAddress: Address, range: Range, maxBlockNumber: BigNumber, stateObject: Property, from: Address, signature: Bytes, includedBlockNumber: BigNumber);
constructor(depositContractAddress: Address, range: Range, maxBlockNumber: BigNumber, stateObject: Property, chunkId: FixedBytes, from: Address, signature: Bytes, includedBlockNumber: BigNumber);
static default(): IncludedTransaction;

@@ -14,0 +15,0 @@ static getParamType(): Struct;

24

lib/types/IncludedTransaction.js

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

class IncludedTransaction {
constructor(depositContractAddress, range, maxBlockNumber, stateObject, from, signature, includedBlockNumber) {
constructor(depositContractAddress, range, maxBlockNumber, stateObject, chunkId, from, signature, includedBlockNumber) {
this.depositContractAddress = depositContractAddress;

@@ -12,2 +12,3 @@ this.range = range;

this.stateObject = stateObject;
this.chunkId = chunkId;
this.from = from;

@@ -18,3 +19,3 @@ this.signature = signature;

static default() {
return new IncludedTransaction(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(), primitives_1.BigNumber.default());
return new IncludedTransaction(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.FixedBytes.default(32), primitives_1.Address.default(), primitives_1.Bytes.default(), primitives_1.BigNumber.default());
}

@@ -27,2 +28,3 @@ static getParamType() {

{ key: 'stateObject', value: primitives_1.Property.getParamType() },
{ key: 'chunkId', value: primitives_1.FixedBytes.default(32) },
{ key: 'from', value: primitives_1.Address.default() },

@@ -34,3 +36,3 @@ { key: 'signature', value: primitives_1.Bytes.default() },

static fromSignedTransaction(tx, includedBlockNumber) {
return new IncludedTransaction(tx.depositContractAddress, tx.range, tx.maxBlockNumber, tx.stateObject, tx.from, tx.signature, includedBlockNumber);
return new IncludedTransaction(tx.depositContractAddress, tx.range, tx.maxBlockNumber, tx.stateObject, tx.chunkId, tx.from, tx.signature, includedBlockNumber);
}

@@ -42,6 +44,7 @@ static fromStruct(struct) {

const stateObject = struct.data[3].value;
const from = struct.data[4].value;
const signature = struct.data[5].value;
const includedBlockNumber = struct.data[6].value;
return new IncludedTransaction(depositContractAddress, primitives_1.Range.fromStruct(range), maxBlockNumber, primitives_1.Property.fromStruct(stateObject), from, signature, includedBlockNumber);
const chunkId = struct.data[4].value;
const from = struct.data[5].value;
const signature = struct.data[6].value;
const includedBlockNumber = struct.data[7].value;
return new IncludedTransaction(depositContractAddress, primitives_1.Range.fromStruct(range), maxBlockNumber, primitives_1.Property.fromStruct(stateObject), chunkId, from, signature, includedBlockNumber);
}

@@ -54,2 +57,3 @@ toStruct() {

{ key: 'stateObject', value: this.stateObject.toStruct() },
{ key: 'chunkId', value: this.chunkId },
{ key: 'from', value: this.from },

@@ -61,9 +65,9 @@ { key: 'signature', value: this.signature },

toUnsigned() {
return new _1.UnsignedTransaction(this.depositContractAddress, this.range, this.maxBlockNumber, this.stateObject, this.from);
return new _1.UnsignedTransaction(this.depositContractAddress, this.range, this.maxBlockNumber, this.stateObject, this.chunkId, this.from);
}
toSigned() {
return new _1.SignedTransaction(this.depositContractAddress, this.range, this.maxBlockNumber, this.stateObject, this.from, this.signature);
return new _1.SignedTransaction(this.depositContractAddress, this.range, this.maxBlockNumber, this.stateObject, this.chunkId, this.from, this.signature);
}
toString() {
return `IncludedTransaction(depositContractAddress: ${this.depositContractAddress.raw}, maxBlockNumber: ${this.maxBlockNumber.raw}, range: ${this.range.toString()}, so: ${this.stateObject.deciderAddress.data}, from: ${this.from.raw}, included)`;
return `IncludedTransaction(depositContractAddress: ${this.depositContractAddress.raw}, maxBlockNumber: ${this.maxBlockNumber.raw}, range: ${this.range.toString()}, so: ${this.stateObject.deciderAddress.data}, chunkId: ${this.chunkId.toHexString()}, from: ${this.from.raw}, included)`;
}

@@ -70,0 +74,0 @@ getHash() {

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

import { Address, Range, BigNumber, Bytes, Struct, Property } from '@cryptoeconomicslab/primitives';
import { Address, Range, BigNumber, Bytes, Struct, Property, FixedBytes } from '@cryptoeconomicslab/primitives';
import { Transaction, UnsignedTransaction } from './';

@@ -8,5 +8,6 @@ export default class SignedTransaction implements Transaction {

readonly stateObject: Property;
readonly chunkId: FixedBytes;
readonly from: Address;
readonly signature: Bytes;
constructor(depositContractAddress: Address, range: Range, maxBlockNumber: BigNumber, stateObject: Property, from: Address, signature: Bytes);
constructor(depositContractAddress: Address, range: Range, maxBlockNumber: BigNumber, stateObject: Property, chunkId: FixedBytes, from: Address, signature: Bytes);
static default(): SignedTransaction;

@@ -13,0 +14,0 @@ static getParamType(): Struct;

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

class SignedTransaction {
constructor(depositContractAddress, range, maxBlockNumber, stateObject, from, signature) {
constructor(depositContractAddress, range, maxBlockNumber, stateObject, chunkId, from, signature) {
this.depositContractAddress = depositContractAddress;

@@ -12,2 +12,3 @@ this.range = range;

this.stateObject = stateObject;
this.chunkId = chunkId;
this.from = from;

@@ -17,3 +18,3 @@ this.signature = signature;

static default() {
return new SignedTransaction(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());
return new SignedTransaction(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.FixedBytes.default(32), primitives_1.Address.default(), primitives_1.Bytes.default());
}

@@ -26,2 +27,3 @@ static getParamType() {

{ key: 'stateObject', value: primitives_1.Property.getParamType() },
{ key: 'chunkId', value: primitives_1.FixedBytes.default(32) },
{ key: 'from', value: primitives_1.Address.default() },

@@ -36,5 +38,6 @@ { key: 'signature', value: primitives_1.Bytes.default() }

const stateObject = struct.data[3].value;
const from = struct.data[4].value;
const signature = struct.data[5].value;
return new SignedTransaction(depositContractAddress, primitives_1.Range.fromStruct(range), maxBlockNumber, primitives_1.Property.fromStruct(stateObject), from, signature);
const chunkId = struct.data[4].value;
const from = struct.data[5].value;
const signature = struct.data[6].value;
return new SignedTransaction(depositContractAddress, primitives_1.Range.fromStruct(range), maxBlockNumber, primitives_1.Property.fromStruct(stateObject), chunkId, from, signature);
}

@@ -47,2 +50,3 @@ toStruct() {

{ key: 'stateObject', value: this.stateObject.toStruct() },
{ key: 'chunkId', value: this.chunkId },
{ key: 'from', value: this.from },

@@ -53,6 +57,6 @@ { key: 'signature', value: this.signature }

toUnsigned() {
return new _1.UnsignedTransaction(this.depositContractAddress, this.range, this.maxBlockNumber, this.stateObject, this.from);
return new _1.UnsignedTransaction(this.depositContractAddress, this.range, this.maxBlockNumber, this.stateObject, this.chunkId, this.from);
}
toString() {
return `SignedTransaction(depositContractAddress: ${this.depositContractAddress.raw}, maxBlockNumber: ${this.maxBlockNumber.raw}, range: ${this.range.toString()}, so: ${this.stateObject.deciderAddress.data}, from: ${this.from.raw}, signed)`;
return `SignedTransaction(depositContractAddress: ${this.depositContractAddress.raw}, maxBlockNumber: ${this.maxBlockNumber.raw}, range: ${this.range.toString()}, so: ${this.stateObject.deciderAddress.data}, chunkId: ${this.chunkId.toHexString()}, from: ${this.from.raw}, signed)`;
}

@@ -59,0 +63,0 @@ getHash() {

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

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

@@ -10,5 +10,6 @@ import StateUpdateRecord from './StateUpdateRecord';

stateObject: Property;
constructor(depositContractAddress: Address, range: Range, blockNumber: BigNumber, stateObject: Property);
chunkId: FixedBytes;
constructor(depositContractAddress: Address, range: Range, blockNumber: BigNumber, stateObject: Property, chunkId: FixedBytes);
get amount(): JSBI;
update({ depositContractAddress, range, blockNumber, stateObject }: {
update({ depositContractAddress, range, blockNumber, stateObject, chunkId }: {
depositContractAddress?: Address;

@@ -18,2 +19,3 @@ range?: Range;

stateObject?: Property;
chunkId?: FixedBytes;
}): void;

@@ -20,0 +22,0 @@ static fromRangeRecord(r: RangeRecord): StateUpdate;

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

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

@@ -16,2 +16,3 @@ this.range = range;

this.stateObject = stateObject;
this.chunkId = chunkId;
}

@@ -21,3 +22,3 @@ get amount() {

}
update({ depositContractAddress, range, blockNumber, stateObject }) {
update({ depositContractAddress, range, blockNumber, stateObject, chunkId }) {
if (depositContractAddress) {

@@ -35,2 +36,5 @@ this.depositContractAddress = depositContractAddress;

}
if (chunkId) {
this.chunkId = chunkId;
}
}

@@ -41,3 +45,3 @@ static fromRangeRecord(r) {

static fromRecord(record, range) {
return new StateUpdate(record.depositContractAddress, range, record.blockNumber, record.stateObject);
return new StateUpdate(record.depositContractAddress, range, record.blockNumber, record.stateObject, record.chunkId);
}

@@ -48,6 +52,6 @@ get hash() {

toRecord() {
return new StateUpdateRecord_1.default(this.depositContractAddress, this.blockNumber, this.stateObject);
return new StateUpdateRecord_1.default(this.depositContractAddress, this.blockNumber, this.stateObject, this.chunkId);
}
toString() {
return `StateUpdate(depositContractAddress: ${this.depositContractAddress.toString()}, blockNumber: ${this.blockNumber.toString()}, range: ${this.range.toString()}, so: ${this.stateObject.deciderAddress.data})`;
return `StateUpdate(depositContractAddress: ${this.depositContractAddress.toString()}, blockNumber: ${this.blockNumber.toString()}, range: ${this.range.toString()}, so: ${this.stateObject.deciderAddress.data}, chunkId: ${this.chunkId.toHexString()})`;
}

@@ -59,3 +63,4 @@ static getParamType() {

{ key: 'blockNumber', value: primitives_1.BigNumber.default() },
{ key: 'stateObject', value: primitives_1.Property.getParamType() }
{ key: 'stateObject', value: primitives_1.Property.getParamType() },
{ key: 'chunkId', value: primitives_1.FixedBytes.default(32) }
]);

@@ -68,3 +73,4 @@ }

const stateObject = struct.data[3].value;
return new StateUpdate(depositContractAddress, primitives_1.Range.fromStruct(range), blockNumber, primitives_1.Property.fromStruct(stateObject));
const chunkId = struct.data[4].value;
return new StateUpdate(depositContractAddress, primitives_1.Range.fromStruct(range), blockNumber, primitives_1.Property.fromStruct(stateObject), chunkId);
}

@@ -76,3 +82,4 @@ toStruct() {

{ key: 'blockNumber', value: this.blockNumber },
{ key: 'stateObject', value: this.stateObject.toStruct() }
{ key: 'stateObject', value: this.stateObject.toStruct() },
{ key: 'chunkId', value: this.chunkId }
]);

@@ -79,0 +86,0 @@ }

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

import { Address, Struct, BigNumber, Property } from '@cryptoeconomicslab/primitives';
import { Address, Struct, BigNumber, Property, FixedBytes } from '@cryptoeconomicslab/primitives';
export default class StateUpdateRecord {

@@ -6,3 +6,4 @@ readonly depositContractAddress: Address;

readonly stateObject: Property;
constructor(depositContractAddress: Address, blockNumber: BigNumber, stateObject: Property);
readonly chunkId: FixedBytes;
constructor(depositContractAddress: Address, blockNumber: BigNumber, stateObject: Property, chunkId: FixedBytes);
static default(): StateUpdateRecord;

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

@@ -5,9 +5,10 @@ "use strict";

class StateUpdateRecord {
constructor(depositContractAddress, blockNumber, stateObject) {
constructor(depositContractAddress, blockNumber, stateObject, chunkId) {
this.depositContractAddress = depositContractAddress;
this.blockNumber = blockNumber;
this.stateObject = stateObject;
this.chunkId = chunkId;
}
static default() {
return new StateUpdateRecord(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(), []), primitives_1.FixedBytes.default(32));
}

@@ -18,7 +19,8 @@ static getParamType() {

{ key: 'blockNumber', value: primitives_1.BigNumber.default() },
{ key: 'stateObject', value: primitives_1.Property.getParamType() }
{ key: 'stateObject', value: primitives_1.Property.getParamType() },
{ key: 'chunkId', value: primitives_1.FixedBytes.default(32) }
]);
}
static fromStruct(struct) {
return new StateUpdateRecord(struct.data[0].value, struct.data[1].value, primitives_1.Property.fromStruct(struct.data[2].value));
return new StateUpdateRecord(struct.data[0].value, struct.data[1].value, primitives_1.Property.fromStruct(struct.data[2].value), struct.data[3].value);
}

@@ -29,3 +31,4 @@ toStruct() {

{ key: 'blockNumber', value: this.blockNumber },
{ key: 'stateObject', value: this.stateObject.toStruct() }
{ key: 'stateObject', value: this.stateObject.toStruct() },
{ key: 'chunkId', value: this.chunkId }
]);

@@ -32,0 +35,0 @@ }

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

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

@@ -9,4 +9,5 @@ depositContractAddress: Address;

message: Bytes;
chunkId: FixedBytes;
toStruct(): Struct;
toString(): string;
}

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

import { Address, Range, BigNumber, Bytes, Struct, Property } from '@cryptoeconomicslab/primitives';
import { Address, Range, BigNumber, Bytes, Struct, Property, FixedBytes } from '@cryptoeconomicslab/primitives';
import { Wallet } from '@cryptoeconomicslab/wallet';

@@ -9,4 +9,5 @@ import { Transaction, SignedTransaction } from './';

readonly stateObject: Property;
readonly chunkId: FixedBytes;
readonly from: Address;
constructor(depositContractAddress: Address, range: Range, maxBlockNumber: BigNumber, stateObject: Property, from: Address);
constructor(depositContractAddress: Address, range: Range, maxBlockNumber: BigNumber, stateObject: Property, chunkId: FixedBytes, from: Address);
static default(): UnsignedTransaction;

@@ -13,0 +14,0 @@ static getParamType(): Struct;

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

class UnsignedTransaction {
constructor(depositContractAddress, range, maxBlockNumber, stateObject, from) {
constructor(depositContractAddress, range, maxBlockNumber, stateObject, chunkId, from) {
this.depositContractAddress = depositContractAddress;

@@ -13,6 +13,7 @@ this.range = range;

this.stateObject = stateObject;
this.chunkId = chunkId;
this.from = from;
}
static default() {
return new UnsignedTransaction(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());
return new UnsignedTransaction(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.FixedBytes.default(32), primitives_1.Address.default());
}

@@ -25,2 +26,3 @@ static getParamType() {

{ key: 'stateObject', value: primitives_1.Property.getParamType() },
{ key: 'chunkId', value: primitives_1.FixedBytes.default(32) },
{ key: 'from', value: primitives_1.Address.default() }

@@ -34,4 +36,5 @@ ]);

const stateObject = struct.data[3].value;
const from = struct.data[4].value;
return new UnsignedTransaction(depositContractAddress, primitives_1.Range.fromStruct(range), maxBlockNumber, primitives_1.Property.fromStruct(stateObject), from);
const chunkId = struct.data[4].value;
const from = struct.data[5].value;
return new UnsignedTransaction(depositContractAddress, primitives_1.Range.fromStruct(range), maxBlockNumber, primitives_1.Property.fromStruct(stateObject), chunkId, from);
}

@@ -44,2 +47,3 @@ toStruct() {

{ key: 'stateObject', value: this.stateObject.toStruct() },
{ key: 'chunkId', value: this.chunkId },
{ key: 'from', value: this.from }

@@ -50,3 +54,3 @@ ]);

const signature = await signer.signMessage(ovmContext.coder.encode(this.toStruct()));
return new _1.SignedTransaction(this.depositContractAddress, this.range, this.maxBlockNumber, this.stateObject, this.from, signature);
return new _1.SignedTransaction(this.depositContractAddress, this.range, this.maxBlockNumber, this.stateObject, this.chunkId, this.from, signature);
}

@@ -57,3 +61,3 @@ getHash() {

toString() {
return `UnsignedTransaction(depositContractAddress: ${this.depositContractAddress.raw}, maxBlockNumber: ${this.maxBlockNumber.raw}, range: ${this.range.toString()}, so: ${this.stateObject.deciderAddress.data}, from: ${this.from.raw})`;
return `UnsignedTransaction(depositContractAddress: ${this.depositContractAddress.raw}, maxBlockNumber: ${this.maxBlockNumber.raw}, range: ${this.range.toString()}, so: ${this.stateObject.deciderAddress.data}, chunkId: ${this.chunkId.toHexString()}, from: ${this.from.raw})`;
}

@@ -60,0 +64,0 @@ get message() {

{
"name": "@cryptoeconomicslab/plasma",
"version": "0.5.2-alpha.3",
"version": "0.6.0-alpha.0",
"description": "plasma module",

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

"dependencies": {
"@cryptoeconomicslab/db": "^0.5.2-alpha.3",
"@cryptoeconomicslab/hash": "^0.5.2-alpha.3",
"@cryptoeconomicslab/merkle-tree": "^0.5.2-alpha.3",
"@cryptoeconomicslab/wallet": "^0.5.2-alpha.3",
"@cryptoeconomicslab/db": "^0.6.0-alpha.0",
"@cryptoeconomicslab/hash": "^0.6.0-alpha.0",
"@cryptoeconomicslab/merkle-tree": "^0.6.0-alpha.0",
"@cryptoeconomicslab/wallet": "^0.6.0-alpha.0",
"jsbi": "^3.1.2"
},
"devDependencies": {
"@cryptoeconomicslab/coder": "^0.5.2-alpha.3",
"@cryptoeconomicslab/context": "^0.5.2-alpha.3",
"@cryptoeconomicslab/eth-coder": "^0.5.2-alpha.3",
"@cryptoeconomicslab/primitives": "^0.5.2-alpha.3",
"@cryptoeconomicslab/utils": "^0.5.2-alpha.3"
"@cryptoeconomicslab/coder": "^0.6.0-alpha.0",
"@cryptoeconomicslab/context": "^0.6.0-alpha.0",
"@cryptoeconomicslab/eth-coder": "^0.6.0-alpha.0",
"@cryptoeconomicslab/primitives": "^0.6.0-alpha.0",
"@cryptoeconomicslab/utils": "^0.6.0-alpha.0"
},

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

},
"gitHead": "2d85760bd75bfa8814c49e4ccbea2b2473ed8ae9"
"gitHead": "a83ebf28afa03e6d392bc5837aad3639be588c8b"
}

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