CRYPTO NEWS

Truffle test: Error: expected event argument ‘_ids’ to have value 1 but got 1

I wrote an ERC1155 Nft whith this following function:

contract Nft is ERC1155{     using Counters for Counters.Counter;     Counters.Counter private id;      event MintBatch(address indexed _to, uint256[] _ids, uint256[] _amounts);      function mintBatch(             address _to,             uint256[] memory _amounts,             address[][] memory _recipients,             uint256[][] memory _values,         ) external {            uint256 _id;            uint256[] memory _ids = new uint256[](_amounts.length);             for (uint256 i; i < _amounts.length; i++){                 id.increment();                 _id = id.current();                 _ids[i]= _id;             }                          _mintBatch(_to, _ids, _amounts, '');             emit MintBatch(_to, _ids, _amounts);          } } 

And when I run the test to check the content of the event emitted :

const { expectRevert, expectEvent, BN } = require('@openzeppelin/test-helpers'); const { web3 } = require('@openzeppelin/test-helpers/src/setup'); const { expect, should } = require('chai');  it('mintBatch: Event', async function () {         let receipt = await this.NftInstance.mintBatch(user1, [2], [[]], [[]]);                  expectEvent(receipt, "MintBatch", {             _to: user1,             _ids: [web3.utils.toBN(1)],             _amounts: [2],         });      }); 

I get the error:

expected event argument '_ids' to have value 1 but got 1 

The failed test shows me the events emitted during it and specifically this one:

    Nft.MintBatch(       _to: <indexed> <user1 address> (type: address),       _ids: [ 1 ] (type: uint256[]),       _amounts: [ 2 ] (type: uint256[])     ) 

I tried to change from web3.utils.toBN to just 1, or to define a variable with new BN(1) and it doesn’t change anything.

Thank you for reading šŸ™‚

Is this possible in Lightning Network?

Let’s say Alice is supplier and Bob is buyer, let’s say Alice and Bob has channel capacity of 2BTC. Let’s say Alice has remote balance of 1 BTC and on bob side we have 1 BTC. I wonder, if Alice wants to withdraw 0.5 BTC from her 1 BTC because she is in need of::Listen

Let’s say Alice is supplier and Bob is buyer, let’s say Alice and Bob has channel capacity of 2BTC. Let’s say Alice has remote balance of 1 BTC and on bob side we have 1 BTC. I wonder, if Alice wants to withdraw 0.5 BTC from her 1 BTC because she is in need of that 0.5 BTC. Can alice withdraw that 0.5 BTC or portion of her remote balance from her existing channel?

Crypto Hats, Crypto Shirts, Crypto Socks, Crypto Clothing

Truffle test: Error: expected event argument ‘_ids’ to have value 1 but got 1

Shopping cart
There are no products in the cart!
Continue shopping
0