Skip to content

smart contract data: reset on encountering errors #32

Description

@laciferin2024

Reproducer

https://github.com/metafountain/minafountain/blob/38231e5c56eaa9b854f144e7b4ae70c6a5073df8/packages/chain/test/runtime/modules/Sudoku.test.ts#L100

pnpm env:inmemory dev
cd packages/chains 

pnpm run test Sudoku

My Debug


> chain@1.0.0 test /home/ubuntu/mc/packages/chain
> node --experimental-vm-modules ./node_modules/jest/bin/jest.js "Sudoku"

  console.log
    sudoku:  [
      [
        0, 5, 4, 7, 9,
        3, 8, 0, 2
      ],
      [
        0, 2, 0, 0, 0,
        0, 9, 5, 3
      ],
      [
        3, 1, 9, 0, 2,
        5, 7, 0, 0
      ],
      [
        0, 3, 8, 1, 0,
        0, 2, 4, 9
      ],
      [
        0, 6, 0, 0, 0,
        0, 3, 7, 0
      ],
      [
        0, 0, 0, 0, 0,
        9, 0, 8, 0
      ],
      [
        1, 0, 0, 3, 6,
        0, 4, 0, 0
      ],
      [
        7, 8, 0, 0, 4,
        0, 0, 9, 6
      ],
      [
        0, 4, 0, 9, 0,
        8, 0, 3, 7
      ]
    ]

      at test/runtime/modules/Sudoku.test.ts:24:9

  console.log
    solution: 6,5,4,7,9,3,8,1,2,8,2,7,6,1,4,9,5,3,3,1,9,8,2,5,7,6,4,5,3,8,1,7,6,2,4,9,9,6,1,4,8,2,3,7,5,4,7,2,5,3,9,6,8,1,1,9,5,3,6,7,4,2,8,7,8,3,2,4,1,5,9,6,2,4,6,9,5,8,1,3,7

      at test/runtime/modules/Sudoku.test.ts:25:9

(node:581455) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:581455) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
  console.log
    sudokuhash 22004436885088329933660952136453429729140642005655392203861934592288253629184

      at checkStatus (test/runtime/modules/Sudoku.test.ts:62:13)

  console.log
    solution: 6,5,4,7,9,3,8,1,2,8,2,7,6,1,4,9,5,3,3,1,9,8,2,5,7,6,4,5,3,8,1,7,6,2,4,9,9,6,1,4,8,2,3,7,5,4,7,2,5,3,9,6,8,1,1,9,5,3,6,7,4,2,8,7,8,3,2,4,1,5,9,6,2,4,6,9,5,8,1,3,7

      at test/runtime/modules/Sudoku.test.ts:25:9

(node:581455) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:581455) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
  console.log
    sudokuhash 22004436885088329933660952136453429729140642005655392203861934592288253629184

      at checkStatus (test/runtime/modules/Sudoku.test.ts:62:13)

  console.log
    status: is Solved= false

      at checkStatus (test/runtime/modules/Sudoku.test.ts:64:13)

  console.log
    failed as expected

      at Object.<anonymous> (test/runtime/modules/Sudoku.test.ts:82:15)

  console.log
    sudokuhash 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions