@neo-one/node-vm
Advanced tools
Comparing version 0.0.2 to 0.1.0
{ | ||
"name": "@neo-one/node-vm", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"keywords": [ | ||
@@ -37,5 +37,5 @@ "neo", | ||
"dependencies": { | ||
"@neo-one/client-core": "^0.0.2", | ||
"@neo-one/node-core": "^0.0.2", | ||
"@neo-one/utils": "^0.0.2", | ||
"@neo-one/client-core": "^0.1.0", | ||
"@neo-one/node-core": "^0.1.0", | ||
"@neo-one/utils": "^0.1.0", | ||
"bn.js": "^4.11.8", | ||
@@ -42,0 +42,0 @@ "lodash": "^4.17.4", |
@@ -214,2 +214,8 @@ /* @flow */ | ||
export class InvalidRemoveIndexError extends VMError { | ||
constructor(context: ExecutionContext) { | ||
super(context, 'Invalid REMOVE Index'); | ||
} | ||
} | ||
export class InvalidSetItemIndexError extends VMError { | ||
@@ -216,0 +222,0 @@ constructor(context: ExecutionContext) { |
@@ -367,3 +367,3 @@ /* @flow */ | ||
stackAlt: finalContext.stackAlt.map(item => item.toContractParameter()), | ||
gasConsumed: gas.sub(finalContext.gasLeft).add(FREE_GAS), | ||
gasConsumed: gas.sub(finalContext.gasLeft), | ||
errorMessage: | ||
@@ -370,0 +370,0 @@ errorMessage == null ? finalContext.errorMessage : errorMessage, |
@@ -37,2 +37,3 @@ /* @flow */ | ||
InvalidPickItemIndexError, | ||
InvalidRemoveIndexError, | ||
InvalidSetItemIndexError, | ||
@@ -1514,3 +1515,3 @@ LeftNegativeError, | ||
[ | ||
0xc7, | ||
0xc8, | ||
createOp({ | ||
@@ -1532,3 +1533,3 @@ name: 'APPEND', | ||
[ | ||
0xc8, | ||
0xc9, | ||
createOp({ | ||
@@ -1546,2 +1547,19 @@ name: 'REVERSE', | ||
[ | ||
0xca, | ||
createOp({ | ||
name: 'REMOVE', | ||
in: 2, | ||
invoke: ({ context, args }: OpInvokeArgs) => { | ||
const index = args[0].asBigInteger().toNumber(); | ||
const value = args[1].asArray(); | ||
if (index < 0 || index >= value.length) { | ||
throw new InvalidRemoveIndexError(context); | ||
} | ||
value.splice(index, 1); | ||
return { context }; | ||
}, | ||
}), | ||
], | ||
[ | ||
0xf0, | ||
@@ -1548,0 +1566,0 @@ createOp({ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
973596
16270
+ Added@neo-one/client-core@0.1.0(transitive)
+ Added@neo-one/node-core@0.1.0(transitive)
+ Added@neo-one/utils@0.1.0(transitive)
- Removed@neo-one/client-core@0.0.2(transitive)
- Removed@neo-one/node-core@0.0.2(transitive)
- Removed@neo-one/utils@0.0.2(transitive)
Updated@neo-one/client-core@^0.1.0
Updated@neo-one/node-core@^0.1.0
Updated@neo-one/utils@^0.1.0