N3developertoolkit / neo-test

Neo N3 smart contract unit test framework
MIT License
6 stars 2 forks source link

Neo.Test.Runner #17

Closed devhawk closed 2 years ago

devhawk commented 2 years ago

a new .net tool that executes contracts against a Neo.VM instance for unit test purposes. Runs the specified .neo-invoke file

example command:

> neo-test-runner register-sample-domain.neo-invoke.json --account bob --checkpoint contract-deployed.neoxp-checkpoint --express default.neo-express --storages registrar --nef-file src/bin/sc/registrar.nef

example output:

{
  "state": "HALT",
  "exception": null,
  "gasconsumed": "0.0869496",
  "logs": [],
  "notifications": [],
  "stack": [
    {
      "type": "Boolean",
      "value": true
    }
  ],
  "storages": [
    {
      "name": "registrar",
      "hash": "0xc6cf77e89ff11499717c7f2c83416e2c0273b2d6",
      "values": [
        {
          "key": "UmVnaXN0cmFy",
          "value": "iAKhsjONfqImOHWgs72sXPvwO4U="
        },
        {
          "key": "ZG9tYWluT3duZXJzc2FtcGxlLmRvbWFpbg==",
          "value": "o2rCWQljs56nfcn8JzEaqt4Ql08="
        }
      ]
    }
  ],
  "code-coverage": {
    "contract-hash": "0xc6cf77e89ff11499717c7f2c83416e2c0273b2d6",
    "debug-info-hash": "0xf69e5188632deb3a9273519efc86cb68da8d42b8",
    "hit-map": {
      "3": 0,
      "4": 0,
      "14": 0,
      "22": 0,
      "23": 0,
      "51": 0,
      "53": 0,
      "59": 0,
      "63": 1,
      "215": 1,
      "216": 1,
      "230": 1,
      "247": 1,
      "248": 1,
      "258": 1,
      "267": 0,
      "268": 0,
      "300": 0,
      "308": 0,
      "310": 1,
      "322": 0,
      "323": 0,
      "349": 0,
      "357": 0,
      "359": 1,
      "369": 1,
      "377": 1,
      "387": 1,
      "425": 0,
      "426": 0,
      "436": 0,
      "444": 0,
      "445": 0,
      "473": 0,
      "481": 0,
      "483": 0,
      "495": 0,
      "496": 0,
      "540": 0,
      "548": 0,
      "550": 0,
      "562": 0,
      "563": 0,
      "602": 0,
      "610": 0,
      "612": 0,
      "622": 0,
      "630": 0,
      "634": 0,
      "635": 0,
      "645": 0,
      "653": 0,
      "654": 0,
      "682": 0,
      "690": 0,
      "692": 0,
      "704": 0,
      "705": 0,
      "749": 0,
      "757": 0,
      "759": 0,
      "768": 0,
      "776": 0,
      "780": 0,
      "815": 0,
      "816": 0,
      "822": 0,
      "828": 0,
      "834": 0,
      "858": 0,
      "874": 0,
      "875": 0,
      "881": 0,
      "903": 0,
      "914": 0,
      "915": 0,
      "965": 0,
      "967": 0,
      "973": 0
    },
    "branch-map": {
      "14": "0-0",
      "63": "0-1",
      "258": "1-0",
      "310": "1-0",
      "436": "0-0",
      "483": "0-0",
      "550": "0-0",
      "645": "0-0",
      "692": "0-0",
      "816": "0-0",
      "903": "0-0"
    }
  }
}