- Input parameters — arrays, at least 2
- Sorting options for arrays: ascending (
true
), descending (false
), do not sort (undefined
) - Make sure that all arrays are not empty — otherwise throw an error
- Check that attached deposit is not zero — otherwise it throws an error
- Sort each array separately — depending on the input sort parameter
- Merge arrays according to their order of passing in function parameters
- Transfer funds in the amount of 1 yocto per array to the one who called the contract (predecessor)
- Return the resulting array
- Test coverage (unit, integration)
accountId=ilyar.testnet
contractName="merge-data.ilyar.testnet"
near --accountId $accountId --amount 0.25 call $contractName merge '{"data": [[102, 111], [98, 97, 114]]}'
near --accountId $accountId --amount 0.25 call $contractName merge '{"data": [[102, 111], [98, 97, 114]], "sort": true}'
near --accountId $accountId --amount 0.25 call $contractName merge '{"data": [[102, 111], [98, 97, 114]], "sort": false}'
make fix
make qa
make build
make clean
Installation act:
brew install act
Setup env vars:
echo "GITHUB_TOKEN=%GITHUB_TOKEN%" | tee .secrets
Run
act --help
accountId=ilyar.testnet
make build
near dev-deploy
contractName=$(cat neardev/dev-account)
near state $contractName
near delete $contractName $accountId
near clean
make qa
make build
export NEAR_ENV=testnet
accountId=ilyar.testnet
contractName="merge-data.$accountId"
near create-account --masterAccount $accountId $contractName
near deploy $contractName
contractName=$(cat neardev/dev-account)
near state $contractName