Decrease gas for ft_transfer_call for not exceeding the gas limit
Fix check that the token is not registered
Fix arguments for ftTransferCallToNearCallback
Fix arguments for withdraw call
Remove redundant check of balance
Fix the string to Uint function. The AuroraSdk.promiseResult(0).output can return "100" not just 100.
Before running tests don't forget about git submodule. I add this https://github.com/aurora-is-near/aurora-contracts-sdk.git repo as a submodule for using some Sol libs such as AuroraSdk.sol. Let me know if you can do it a better way.
Tests in file integration-tests/src/lib.rs:
test_ft_transfer_to_silo -- transfer mock_tokens from engine to silo and back
test_withdraw -- the transfer is failed because of silo account is not registered and withdraw method executed
check_access_control -- checks that account without access can't run token registration and callback functions
error_on_withdraw_to_near -- create a mock token where for user registration we need to deposit 10 NEAR tokens, register tokens in our contract, but really it is not registered, try to transfer these tokens and it fails during operation token.withdrawToNear(bytes(getNearAccountId()), amount); . Try to withdraw user tokens back. This test fails due to an issue in our contract.
SiloToSilo.sol
:AuroraSdk.promiseResult(0).output
can return"100"
not just100
.AuroraSdk.sol
. Let me know if you can do it a better way.integration-tests/src/lib.rs
:test_ft_transfer_to_silo
-- transfer mock_tokens from engine to silo and backtest_withdraw
-- the transfer is failed because of silo account is not registered and withdraw method executedcheck_access_control
-- checks that account without access can't run token registration and callback functionserror_on_withdraw_to_near
-- create a mock token where for user registration we need to deposit 10 NEAR tokens, register tokens in our contract, but really it is not registered, try to transfer these tokens and it fails during operationtoken.withdrawToNear(bytes(getNearAccountId()), amount);
. Try to withdraw user tokens back. This test fails due to an issue in our contract.