

#import trade test addr, 1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH
[[SimpleCase]]
id = "import1"
command = "account import_key -k 0xfdf2bbff853ecff2e7b86b2a8b45726c6538ca7d1403dc94e50131ef379bdca0 -l trade_test"


[[TokenPreCreateCase]]
id = "tokenPre"
command = "send token precreate -f 0.01 -i testToken -n testToken -s TS -a 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -t 100000 -p 1 -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
dep = ["transForPrecreate", "import1"]

[[TokenFinishCreateCase]]
id = "tokenFinish"
command = "send token finish -a 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -f 0.01 -s TS -k 0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc"
dep = ["tokenPre"]


#send to token for precreate
[[TransferCase]]
id = "transForPrecreate"
command = "send bty transfer -a 10 -t 12hpJBHybh1mSyCijQ2MQJPk7z7kZ7jnQa -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
to = "12hpJBHybh1mSyCijQ2MQJPk7z7kZ7jnQa"
amount = "10"
checkItem = ["balance"]

[[TransferCase]]
id = "transForFee"
command = "send bty transfer -a 100 -t 1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
to = "1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
amount = "100"
checkItem = ["balance"]
dep = ["import1"]


#prepare bty for trade sell and buy
[[TransferCase]]
id = "btyToTrade"
command = "send bty transfer -a 7 -t 1BXvgjmBw1aBgmGn1hjfGyRkmN3krWpFP4 -k 1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
from = "1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
to = "1BXvgjmBw1aBgmGn1hjfGyRkmN3krWpFP4"
amount = "7"
checkItem = ["balance"]
dep = ["transForFee"]

[[TransferCase]]
id = "tokenToTrade"
command = "send token transfer -a 50 -s TS -t 1BXvgjmBw1aBgmGn1hjfGyRkmN3krWpFP4 -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
to = "1BXvgjmBw1aBgmGn1hjfGyRkmN3krWpFP4"
amount = "50"
checkItem = ["balance"]
dep = ["tokenFinish", "btyToTrade"]


#token sell case
[[SellCase]]
id = "tokenSell1"
command = "send trade sell -f 0.01 -m 100 -p 0.01 -t 10 -s TS -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
amount = "10"
checkItem = ["balance", "frozen"]
dep = ["tokenToTrade"]


[[SellCase]]
id = "tokenSell2"
command = "send trade sell -f 0.01 -m 100 -p 0.01 -t 1 -s TS -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
amount = "1"
checkItem = ["balance", "frozen"]
dep = ["tokenToTrade"]


[[SellCase]]
id = "tokenSell3"
command = "send trade sell -f 0.01 -m 100 -p 0.01 -t 10 -s TS -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
amount = "10"
checkItem = ["balance", "frozen"]
dep = ["tokenToTrade"]


#no balance
[[SellCase]]
id = "failSell"
command = "send trade sell -f 0.01 -m 100 -p 0.01 -t 100 -s TS -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
amount = "100"
checkItem = ["balance", "frozen"]
fail = true


#因trade购买需要指定sellID, DependBuyCase自动获取由dep指定SellCase的sellID
[[DependBuyCase]]
id = "tokenBuy"
command = "send trade buy -c 100 -f 0.01 -k 1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
from = "1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
to = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
btyAmount = "1"
tokenAmount = "1"
checkItem = ["balance", "frozen"]
dep = ["tokenSell1"]
repeat = 5



#不满足最少份数
[[DependBuyCase]]
id = "failBuy1"
command = "send trade buy -c 90 -f 0.01 -k 1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
from = "1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
to = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
btyAmount = "0.9"
tokenAmount = "0.9"
checkItem = ["balance", "frozen"]
dep = ["tokenSell1"]
fail = true


#剩余正在sell的不够
[[DependBuyCase]]
id = "failBuy2"
command = "send trade buy -c 200 -f 0.01 -k 1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
from = "1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
to = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
btyAmount = "2"
tokenAmount = "2"
checkItem = ["balance", "frozen"]
dep = ["tokenSell2"]
fail = true





#bty余额不足
[[DependBuyCase]]
id = "failBuy3"
command = "send trade buy -c 800 -f 0.01 -k 1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
from = "1Luh4AziYyaC5zP3hUXtXFZS873xAxm6rH"
to = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
btyAmount = "8"
tokenAmount = "8"
checkItem = ["balance", "frozen"]
dep = ["tokenSell3"]
fail = true

