frostfs-testcases/robot/testsuites/integration/payment/withdraw.robot

61 lines
3.2 KiB
Text
Raw Normal View History

2020-11-29 04:28:01 +00:00
*** Settings ***
Variables ../../../variables/common.py
2020-11-29 04:28:01 +00:00
Library ../${RESOURCES}/neofs.py
Library ../${RESOURCES}/payment_neogo.py
2020-11-29 04:28:01 +00:00
*** Variables ***
${DEPOSIT_AMOUNT} = 10
${WITHDRAW_AMOUNT} = 10
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}
${TX} = Transfer Mainnet Gas wallets/wallet.json NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx ${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}
${MAINNET_BALANCE} = Expected Mainnet Balance ${ADDR} 15
2020-11-29 04:28:01 +00:00
${SCRIPT_HASH} = Get ScripHash ${PRIV_KEY}
${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}
Sleep 1 min
# 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}
${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}
Sleep 1 min
Get Balance ${PRIV_KEY}
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}
[Teardown] Cleanup
*** Keywords ***
Cleanup
Get Docker Logs withdraw