IT Blog
- July 2022 (1)
- June 2022 (2)
- May 2022 (1)
- January 2022 (3)
- July 2021 (1)
- June 2021 (1)
- December 2020 (2)
- November 2020 (2)
- October 2020 (1)
- August 2020 (2)
- July 2020 (2)
- June 2020 (3)
- May 2020 (3)
Follow My Blog
Get new content delivered directly to your inbox.
- Truffle test – ReferenceError: accounts is not definedWhen you run command ‘truffle test’ and get error:“ReferenceError: accounts is not defined” To fix this, use below code line:contract(“Contract”, async (accounts) => {} and put test code between brackets e.g.:
- Error: Number can only safely store up to 53 bitsI got this error: ‘Error: Number can only safely store up to 53 bits’ when using toNumber function: Quick fix using BigInt:
- Truffle test – network errortruffle(ganache)> truffle testError: You must specify a network_id in your ‘ganache’ configuration in order to use this network. Go to config file: truffle-config.js -> uncomment ‘development’ section in ‘networks’. Change port if you have a different one in Ganache, e.g. modfiy from 8545 to 7545. Save file -> back to console -> run command: ‘truffleContinue reading “Truffle test – network error”
- Create new ERC20 token – smart contractSample smart contract to create your own token: The same code, but with a hard-coded name, symbol and initial supply: Sources:https://docs.openzeppelin.com/contracts/4.x/erc20https://solidity-by-example.org/app/erc20/https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/ERC20.sol
- Problem with disabled WiFi and Unknown USB Device (Device Descriptor Request Failed)TLDR:disable unknown USB device -> disable wifi -> hibernate -> plug off power cable -> turn on laptop –> enable wifi WiFi card: Intel(R) Wireless-AC 9560 160MHz Errors:Error (status): This device cannot start. (Code 10)Error (status): Windows has stopped this device because it has reported problems. (Code 43) When fail all methods that you tryContinue reading “Problem with disabled WiFi and Unknown USB Device (Device Descriptor Request Failed)”
- Mock IConfigurate in xUnitIf you want mock IConfiguration use following code: or copy secrets.json configuration file to output directory: projectName\bin\Debug\netcoreapp3.1 and then use following code in ContextFixture: Config json file e.g. secrets.json: