CU-86dtb1g9a - Improvements on invokeFunction documentation #83
Unit Tests ❌
❌ mocha-results.json
90 tests were completed in 35s with 82 passed, 7 failed and 1 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
packages/neon-dappkit/src/NeonEventListener.spec.ts | 17✔️ | 11s | ||
packages/neon-dappkit/src/NeonInvoker.spec.ts | 9✔️ | 7❌ | 9s | |
packages/neon-dappkit/src/NeonParser.spec.ts | 47✔️ | 1✖️ | 16ms | |
packages/neon-dappkit/src/NeonSigner.spec.ts | 9✔️ | 344ms |
✔️ packages/neon-dappkit/src/NeonEventListener.spec.ts
NeonEventListener
✔️ adds an eventListener
✔️ adds eventListener that callback throws an error
✔️ adds eventListener to a smart contract that does not exist
✔️ adds eventListener to an event that does not exist
✔️ adds eventListeners on the same event
✔️ confirms a transaction
✔️ confirms Halt
✔️ confirms Halt on a fault state
✔️ confirms stack true
✔️ confirms stack true on an empty stack
✔️ does execute neoGo
✔️ exceeds the time to await for the application log
✔️ gets the notification state
✔️ removes all eventListeners of a contract
✔️ removes all eventListeners of an event
✔️ removes an eventListener
✔️ waits for the application log
❌ packages/neon-dappkit/src/NeonInvoker.spec.ts
NeonInvoker
❌ add accounts and witnesses to verify smart contracts
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
❌ can sign and invoke using different NeonInvokers/accounts
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
❌ can sign and invoke with signingCallback using different NeonInvokers/accounts
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
✔️ can throw an error if testInvoke state is FAULT
❌ can throw an error if the signed transaction doesn't match the invocation
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
❌ does calculateFee
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
❌ does invokeFunction
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
❌ does invokeFunction with signingCallback
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
✔️ does testInvoke
✔️ handles array return
✔️ handles array return (again)
✔️ handles boolean return
✔️ handles boolean return (again)
✔️ handles bytestring return
✔️ handles integer return
✔️ handles map return
✔️ packages/neon-dappkit/src/NeonParser.spec.ts
NeonParser
✔️ converts a ascii string into a base64 string
✔️ converts a base64 string into an utf-8 string
✔️ converts a base64 string to a hex and revert it
✔️ converts a base64 string to a hex string
✔️ converts a hex string into a base64 string
✔️ converts a hex string into a string
✔️ converts a hex string into an array buffer
✔️ converts a number into a hex string intToHex
✔️ converts a number into a hex string numToHexstring
✔️ converts a number into a variable length Int
✔️ converts a string into a base64 string
✔️ converts a string into a hex string
✔️ converts a string into an array buffer
✖️ converts a utf-8 string into a base64 string
✔️ converts an account input into its address
✔️ converts an account input into its scripthash
✔️ converts an ArrayBuffer into a hex string
✔️ converts an ArrayBuffer into a string
✔️ reverts a hex string
NeonParser formatRpcArgument
✔️ format Any
✔️ format array of primitive types
✔️ format boolean
✔️ format ByteArray
✔️ format Hash160
✔️ format Hash256
✔️ format map of primitive types
✔️ format numbers
✔️ format PublicKey
✔️ format string
NeonParser parseRpcResponse
✔️ parses Address
✔️ parses Array inside Map
✔️ parses BlockHash or TransactionId
✔️ parses Boolean
✔️ parses ByteString without parseConfig
✔️ parses Integer
✔️ parses invalid Address
✔️ parses invalid ScriptHash and ScriptHashLittleEndian
✔️ parses Iterator
✔️ parses Map inside Array
✔️ parses multiple types Array
✔️ parses multiple types Map
✔️ parses PublicKey
✔️ parses raw when UTF8 parsing fails
✔️ parses same internal types with Union
✔️ parses ScriptHash and ScriptHashLittleEndian
✔️ parses single type Array
✔️ parses single type Map
✔️ parses Union
✔️ packages/neon-dappkit/src/NeonSigner.spec.ts
NeonSigner
✔️ can encrypt and decrypt messages from an array that has the corresponding public key
✔️ can encrypt and decrypt messages from the corresponding public key
✔️ can NOT encrypt and decrypt messages from an array that doesn't have the corresponding public key
✔️ can NOT encrypt and decrypt messages from different public keys
✔️ can sign and verify
✔️ can sign using classic version and verify
✔️ can sign with no salt and verify
✔️ can verify
✔️ can verify when failing
Annotations
Check failure on line 0 in mocha-results.json
github-actions / Unit Tests
packages/neon-dappkit/src/NeonInvoker.spec.ts ► NeonInvoker ► add accounts and witnesses to verify smart contracts
Failed test found in:
mocha-results.json
Error:
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
Raw output
Error: Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
at RPCClient.execute (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/RpcDispatcher.js:85:1)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at RPCClient.calculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/NeoServerRpcClient.js:186:1)
at Object.smartCalculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-api/lib/api/calculateNetworkFee.js:73:1)
Check failure on line 0 in mocha-results.json
github-actions / Unit Tests
packages/neon-dappkit/src/NeonInvoker.spec.ts ► NeonInvoker ► can sign and invoke using different NeonInvokers/accounts
Failed test found in:
mocha-results.json
Error:
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
Raw output
Error: Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
at RPCClient.execute (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/RpcDispatcher.js:85:1)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at RPCClient.calculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/NeoServerRpcClient.js:186:1)
at Object.smartCalculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-api/lib/api/calculateNetworkFee.js:73:1)
Check failure on line 0 in mocha-results.json
github-actions / Unit Tests
packages/neon-dappkit/src/NeonInvoker.spec.ts ► NeonInvoker ► can sign and invoke with signingCallback using different NeonInvokers/accounts
Failed test found in:
mocha-results.json
Error:
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
Raw output
Error: Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
at RPCClient.execute (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/RpcDispatcher.js:85:1)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at RPCClient.calculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/NeoServerRpcClient.js:186:1)
at Object.smartCalculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-api/lib/api/calculateNetworkFee.js:73:1)
Check failure on line 0 in mocha-results.json
github-actions / Unit Tests
packages/neon-dappkit/src/NeonInvoker.spec.ts ► NeonInvoker ► can throw an error if the signed transaction doesn't match the invocation
Failed test found in:
mocha-results.json
Error:
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
Raw output
Error: Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
at RPCClient.execute (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/RpcDispatcher.js:85:1)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at RPCClient.calculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/NeoServerRpcClient.js:186:1)
at Object.smartCalculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-api/lib/api/calculateNetworkFee.js:73:1)
Check failure on line 0 in mocha-results.json
github-actions / Unit Tests
packages/neon-dappkit/src/NeonInvoker.spec.ts ► NeonInvoker ► does calculateFee
Failed test found in:
mocha-results.json
Error:
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
Raw output
Error: Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
at RPCClient.execute (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/RpcDispatcher.js:85:1)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at RPCClient.calculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/NeoServerRpcClient.js:186:1)
at Object.smartCalculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-api/lib/api/calculateNetworkFee.js:73:1)
Check failure on line 0 in mocha-results.json
github-actions / Unit Tests
packages/neon-dappkit/src/NeonInvoker.spec.ts ► NeonInvoker ► does invokeFunction
Failed test found in:
mocha-results.json
Error:
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
Raw output
Error: Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
at RPCClient.execute (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/RpcDispatcher.js:85:1)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at RPCClient.calculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/NeoServerRpcClient.js:186:1)
at Object.smartCalculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-api/lib/api/calculateNetworkFee.js:73:1)
Check failure on line 0 in mocha-results.json
github-actions / Unit Tests
packages/neon-dappkit/src/NeonInvoker.spec.ts ► NeonInvoker ► does invokeFunction with signingCallback
Failed test found in:
mocha-results.json
Error:
Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
Raw output
Error: Object reference not set to an instance of an object. - at Neo.Wallets.Helper.CalculateNetworkFee(Transaction tx, DataCache snapshot, ProtocolSettings settings, Func`2 accountScript, Int64 maxExecutionCost) in E:\Release\3.7.1\neo-modules\neo\src\Neo\Wallets\Helper.cs:line 101
at Neo.Plugins.RpcServer.CalculateNetworkFee(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
at RPCClient.execute (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/RpcDispatcher.js:85:1)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at RPCClient.calculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-core/lib/rpc/clients/NeoServerRpcClient.js:186:1)
at Object.smartCalculateNetworkFee (/home/runner/work/neon-dappkit/neon-dappkit/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@cityofzion/neon-js/dist/webpack:/@cityofzion/neon-api/lib/api/calculateNetworkFee.js:73:1)