2020-11-29 04:28:01 +00:00
|
|
|
*** Settings ***
|
2021-02-08 05:05:17 +00:00
|
|
|
Variables ../../../variables/common.py
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
Library ../${RESOURCES}/neofs.py
|
|
|
|
Library ../${RESOURCES}/payment_neogo.py
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-02-20 14:05:03 +00:00
|
|
|
*** Variables ***
|
2021-04-02 14:29:41 +00:00
|
|
|
${DEPOSIT_AMOUNT} = 10
|
|
|
|
${WITHDRAW_AMOUNT} = 10
|
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.
|
|
|
|
[Tags] Withdraw NeoFS NeoCLI
|
|
|
|
[Timeout] 10 min
|
|
|
|
|
|
|
|
${WALLET} = Init wallet
|
|
|
|
Generate wallet ${WALLET}
|
|
|
|
${ADDR} = Dump Address ${WALLET}
|
|
|
|
${PRIV_KEY} = Dump PrivKey ${WALLET} ${ADDR}
|
|
|
|
|
2021-04-02 14:29:41 +00:00
|
|
|
${TX} = Transfer Mainnet Gas wallets/wallet.json ${DEF_WALLET_ADDR} ${ADDR} 15
|
2020-11-29 04:28:01 +00:00
|
|
|
Wait Until Keyword Succeeds 1 min 15 sec
|
|
|
|
... Transaction accepted in block ${TX}
|
|
|
|
Get Transaction ${TX}
|
2021-02-20 14:05:03 +00:00
|
|
|
${MAINNET_BALANCE} = Expected Mainnet Balance ${ADDR} 15
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-04-02 14:29:41 +00:00
|
|
|
${SCRIPT_HASH} = Get ScriptHash ${PRIV_KEY}
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-02-20 14:05:03 +00:00
|
|
|
|
|
|
|
${TX_DEPOSIT} = NeoFS Deposit ${WALLET} ${ADDR} ${SCRIPT_HASH} ${DEPOSIT_AMOUNT}
|
2020-11-29 04:28:01 +00:00
|
|
|
Wait Until Keyword Succeeds 1 min 15 sec
|
|
|
|
... Transaction accepted in block ${TX_DEPOSIT}
|
|
|
|
Get Transaction ${TX_DEPOSIT}
|
|
|
|
|
2021-04-02 14:29:41 +00:00
|
|
|
|
2020-11-29 04:28:01 +00:00
|
|
|
|
2021-02-20 14:05:03 +00:00
|
|
|
# Expected amount diff will be formed from deposit amount and contract fee
|
|
|
|
${EXPECTED_DIFF} = Evaluate -${DEPOSIT_AMOUNT}-${NEOFS_CONTRACT_DEPOSIT_GAS_FEE}
|
|
|
|
${DEPOSIT_BALANCE} = Expected Mainnet Balance Diff ${ADDR} ${MAINNET_BALANCE} ${EXPECTED_DIFF}
|
|
|
|
|
2020-11-29 04:28:01 +00:00
|
|
|
${NEOFS_BALANCE} = Get Balance ${PRIV_KEY}
|
|
|
|
|
2021-02-20 14:05:03 +00:00
|
|
|
${TX} = Withdraw Mainnet Gas ${WALLET} ${ADDR} ${SCRIPT_HASH} ${WITHDRAW_AMOUNT}
|
2020-11-29 04:28:01 +00:00
|
|
|
Wait Until Keyword Succeeds 1 min 15 sec
|
|
|
|
... Transaction accepted in block ${TX}
|
|
|
|
|
2021-04-02 14:29:41 +00:00
|
|
|
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
|
|
|
|
|
2020-11-29 04:28:01 +00:00
|
|
|
Get Balance ${PRIV_KEY}
|
2021-04-02 14:29:41 +00:00
|
|
|
Mainnet Balance ${ADDR}
|
|
|
|
|
2021-02-20 14:05:03 +00:00
|
|
|
Expected Balance ${PRIV_KEY} ${NEOFS_BALANCE} -${WITHDRAW_AMOUNT}
|
|
|
|
|
|
|
|
# Expected amount diff will be formed from withdrawal amount and contract fee
|
|
|
|
${EXPECTED_DIFF_W} = Evaluate ${WITHDRAW_AMOUNT}-${NEOFS_CONTRACT_WITHDRAW_GAS_FEE}
|
|
|
|
Expected Mainnet Balance Diff ${ADDR} ${DEPOSIT_BALANCE} ${EXPECTED_DIFF_W}
|
2020-12-29 19:55:33 +00:00
|
|
|
|
|
|
|
[Teardown] Cleanup
|
|
|
|
|
|
|
|
*** Keywords ***
|
|
|
|
|
|
|
|
Cleanup
|
2021-03-29 10:18:24 +00:00
|
|
|
Cleanup Files
|
2020-12-29 19:55:33 +00:00
|
|
|
Get Docker Logs withdraw
|