2020-11-29 04:28:01 +00:00
|
|
|
*** Settings ***
|
2021-12-09 10:58:51 +00:00
|
|
|
Variables common.py
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-09-27 20:41:21 +00:00
|
|
|
Library payment_neogo.py
|
2022-07-04 19:49:14 +00:00
|
|
|
Library utility_keywords.py
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-09-27 20:41:21 +00:00
|
|
|
Resource setup_teardown.robot
|
2021-06-01 12:07:31 +00:00
|
|
|
|
2021-02-20 14:05:03 +00:00
|
|
|
*** Variables ***
|
2021-05-07 12:14:37 +00:00
|
|
|
${DEPOSIT_AMOUNT} = ${10}
|
|
|
|
${WITHDRAW_AMOUNT} = ${10}
|
|
|
|
${TRANSFER_AMOUNT} = ${15}
|
2021-02-20 14:05:03 +00:00
|
|
|
|
2020-11-29 04:28:01 +00:00
|
|
|
*** Test cases ***
|
2020-11-29 04:30:45 +00:00
|
|
|
NeoFS Deposit and Withdraw
|
2020-11-29 04:28:01 +00:00
|
|
|
[Documentation] Testcase to validate NeoFS Withdraw operation.
|
|
|
|
[Timeout] 10 min
|
|
|
|
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2022-07-04 19:49:14 +00:00
|
|
|
${WALLET} ${ADDR} ${_} = Generate Wallet
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-05-07 12:14:37 +00:00
|
|
|
##########################################################
|
|
|
|
# Transferring GAS from initial wallet to our test wallet
|
|
|
|
##########################################################
|
2022-06-13 20:33:09 +00:00
|
|
|
Transfer Mainnet Gas ${WALLET} ${TRANSFER_AMOUNT}
|
|
|
|
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
|
|
|
|
Should Be Equal As Numbers ${MAINNET_BALANCE} ${TRANSFER_AMOUNT}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-05-07 12:14:37 +00:00
|
|
|
############################
|
|
|
|
# Making deposit into NeoFS
|
|
|
|
############################
|
2022-06-13 20:33:09 +00:00
|
|
|
NeoFS Deposit ${WALLET} ${DEPOSIT_AMOUNT}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-05-07 12:14:37 +00:00
|
|
|
${MAINNET_BALANCE} = Get Mainnet Balance ${ADDR}
|
|
|
|
${EXPECTED_BALANCE} = Evaluate ${TRANSFER_AMOUNT}-${DEPOSIT_AMOUNT}
|
2022-06-13 20:33:09 +00:00
|
|
|
Should Be True ${MAINNET_BALANCE} < ${EXPECTED_BALANCE}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
${NEOFS_BALANCE} = Get NeoFS Balance ${WALLET}
|
|
|
|
Should Be Equal As Numbers ${NEOFS_BALANCE} ${DEPOSIT_AMOUNT}
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-05-07 12:14:37 +00:00
|
|
|
# TODO: try to withdraw more than was deposited
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-05-07 12:14:37 +00:00
|
|
|
###########################
|
|
|
|
# Withdrawing deposit back
|
|
|
|
###########################
|
2022-06-24 10:36:02 +00:00
|
|
|
Withdraw Mainnet Gas ${WALLET} ${WITHDRAW_AMOUNT}
|
2021-04-02 14:29:41 +00:00
|
|
|
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
|
|
|
|
|
2022-06-13 20:33:09 +00:00
|
|
|
${NEOFS_BALANCE} = Get NeoFS Balance ${WALLET}
|
|
|
|
${EXPECTED_BALANCE} = Evaluate ${DEPOSIT_AMOUNT} - ${WITHDRAW_AMOUNT}
|
|
|
|
Should Be Equal As numbers ${NEOFS_BALANCE} ${EXPECTED_BALANCE}
|
2021-02-20 14:05:03 +00:00
|
|
|
|
2022-06-24 10:36:02 +00:00
|
|
|
${MAINNET_BALANCE_AFTER} = Get Mainnet Balance ${ADDR}
|
|
|
|
${MAINNET_BALANCE_DIFF} = Evaluate ${MAINNET_BALANCE_AFTER} - ${MAINNET_BALANCE}
|
|
|
|
Should Be True ${MAINNET_BALANCE_DIFF} < ${WITHDRAW_AMOUNT}
|
2021-04-26 10:30:40 +00:00
|
|
|
|