@typeberry/lib 0.0.1-96e327b → 0.0.1-b834975

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +3 -9
  2. package/index.js +3 -8
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -8501,8 +8501,8 @@ declare class RecentBlocksHistory extends WithDebug {
8501
8501
  const recentBlocks = RecentBlocks.Codec.decode(decoder);
8502
8502
  return RecentBlocksHistory.create(recentBlocks);
8503
8503
  },
8504
- (_sizer) => {
8505
- return RecentBlocks.Codec.sizeHint;
8504
+ (skip) => {
8505
+ return RecentBlocks.Codec.skip(skip);
8506
8506
  },
8507
8507
  );
8508
8508
 
@@ -16320,12 +16320,6 @@ declare class Interpreter {
16320
16320
  }
16321
16321
 
16322
16322
  if (this.instructionResult.status !== null) {
16323
- // All abnormal terminations should be interpreted as TRAP and we should subtract the gas. In case of FAULT we have to do it manually at the very end.
16324
- if (this.instructionResult.status === Result.FAULT || this.instructionResult.status === Result.FAULT_ACCESS) {
16325
- // TODO [ToDr] underflow?
16326
- this.gas.sub(instructionGasMap[Instruction.TRAP]);
16327
- }
16328
-
16329
16323
  switch (this.instructionResult.status) {
16330
16324
  case Result.FAULT:
16331
16325
  this.status = Status.FAULT;
@@ -16684,7 +16678,7 @@ declare class HostCalls {
16684
16678
  this.hostCalls.traceHostCall("Invoking", index, hostCall, regs, gasBefore);
16685
16679
  const result = await hostCall.execute(gas, regs, memory);
16686
16680
  this.hostCalls.traceHostCall(
16687
- result === undefined ? "Result" : `Status(${result})`,
16681
+ result === undefined ? "Result" : `Status(${PvmExecution[result]})`,
16688
16682
  index,
16689
16683
  hostCall,
16690
16684
  regs,
package/index.js CHANGED
@@ -7924,8 +7924,8 @@ class RecentBlocksHistory extends WithDebug {
7924
7924
  static Codec = Descriptor.new("RecentBlocksHistory", RecentBlocks.Codec.sizeHint, (encoder, value) => RecentBlocks.Codec.encode(encoder, value.asCurrent()), (decoder) => {
7925
7925
  const recentBlocks = RecentBlocks.Codec.decode(decoder);
7926
7926
  return RecentBlocksHistory.create(recentBlocks);
7927
- }, (_sizer) => {
7928
- return RecentBlocks.Codec.sizeHint;
7927
+ }, (skip) => {
7928
+ return RecentBlocks.Codec.skip(skip);
7929
7929
  });
7930
7930
  static create(recentBlocks) {
7931
7931
  return new RecentBlocksHistory(recentBlocks);
@@ -15987,11 +15987,6 @@ class Interpreter {
15987
15987
  }
15988
15988
  }
15989
15989
  if (this.instructionResult.status !== null) {
15990
- // All abnormal terminations should be interpreted as TRAP and we should subtract the gas. In case of FAULT we have to do it manually at the very end.
15991
- if (this.instructionResult.status === Result.FAULT || this.instructionResult.status === Result.FAULT_ACCESS) {
15992
- // TODO [ToDr] underflow?
15993
- this.gas.sub(instructionGasMap[Instruction.TRAP]);
15994
- }
15995
15990
  switch (this.instructionResult.status) {
15996
15991
  case Result.FAULT:
15997
15992
  this.status = Status.FAULT;
@@ -16435,7 +16430,7 @@ class HostCalls {
16435
16430
  }
16436
16431
  this.hostCalls.traceHostCall("Invoking", index, hostCall, regs, gasBefore);
16437
16432
  const result = await hostCall.execute(gas, regs, memory);
16438
- this.hostCalls.traceHostCall(result === undefined ? "Result" : `Status(${result})`, index, hostCall, regs, gas.get());
16433
+ this.hostCalls.traceHostCall(result === undefined ? "Result" : `Status(${PvmExecution[result]})`, index, hostCall, regs, gas.get());
16439
16434
  if (result === PvmExecution.Halt) {
16440
16435
  status = Status.HALT;
16441
16436
  return this.getReturnValue(status, pvmInstance);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typeberry/lib",
3
- "version": "0.0.1-96e327b",
3
+ "version": "0.0.1-b834975",
4
4
  "main": "index.js",
5
5
  "author": "Fluffy Labs",
6
6
  "license": "MPL-2.0"