Is there any way to set storage variables in our contract when we are testing, without creating a transaction to do that?

something like contract.setDataCell() in testing func contracts.

Nov 29, 2023, 10:38 AM
I think this 👇 should work but I am not sure.

contract.init!.data = beginCell()
.store(
storeData(
{
$$type: 'Data',
owner: user.address,
}
)
)
.endCell();
Nov 29, 2023, 10:38 AM
Use createShardAccount:

https://github.com/HipoFinance/contract/blob/fa8b09e5a993751d47d37cee4c35f1c3288c7602/tests/Loan.spec.ts#L168
Nov 29, 2023, 12:46 PM
I will try that.
Thanks 🙏
Nov 29, 2023, 12:53 PM

© 2024 Draquery.com All rights reserved.