Ethereum: Array of Structs problem and how to test in Remix – Copying of type struct ArrayTest.swapDataStruct memory[] memory to storage not yet supported

Here is a letter that explains the problem with how to prove your im deexiux and supporting your Imitation contract:

** Error understanding: Copy the Starting.

A mature of structures on his contract (Armustes show that this matrix is ​​not copied by the repository under the underlying warehouse.

This problem is strong, such as other programming languages, such as a sort of historical verification mechanism. When he expresses a matrix of structures (Ramadtrastz. However, remembering the memory sites still be assigned until the 'swapdater' function calls.

Checks with Remix

To prove your contract using Remix, you must create an instance of contract evidence and contact your tasks in a test copy. Here is an example of how to change your contract to solve this problem:

Stronger

Pragma Strengthening ^ 0.8.0;

Import "

Arawest contract {

// ... the existing code ...

Swapdatosst function () public {

Memory [] Metrix = New Memory [1];

Swapdatestregut (matrix);

}

Swapdatast function (memory data) internal {

For (Uint256 i = 0; i

Data [i] = 10;

}

}

}

In this example, we take the perpetuals of integers (memory] and the value of each element. We then call this new function. We will then call this new function.

Remix tests:

Ethereum: Array of Structs problem and how to test in Remix - Copying of type struct ArrayTest.swapDataStruct memory[] memory to storage not yet supported

To prove your contract with remix:

  • Create a new IDE passion project in Remix.

  • The contract creates Arhu torrents and a new contract (') creating a new contract ('

  • Compare the contract (For example, iltic debt covers - minfifi-notens araintest.sol).

  • Execute the contract using the remix drive -Network Anneet ‘.

Now he should be able to address his contract task in a trial copy.

Javascript

COPES {init} = Need (‘./rintest’);

moadule.exports = {

Asynk test () {

Constance Comp = Alyissa init ();

Console. // emotion [10]

}

};

``

Following these measures and composition of your IDIT contract and implement your IDIT contract to be successfully handed over to a variable structures in your contract.

About the Author

Leave a Reply

Your email address will not be published. Required fields are marked *

You may also like these