| 227 | } |
| 228 | |
| 229 | void CheckScriptAccount() |
| 230 | { |
| 231 | // 检查脚本账户创建的合法性 |
| 232 | BOOST_CHECK_EQUAL(CreateScriptAndCheck(),true); |
| 233 | |
| 234 | //// 给脚本账户打钱 |
| 235 | string accountId = "010000000100"; |
| 236 | int param = 13; |
| 237 | string temp = ""; |
| 238 | temp += tinyformat::format("%02x%s",param,accountId); |
| 239 | Value resut =CallContractTx("010000000100", "dsGb9GyDGYnnHdjSvRfYbj9ox2zPbtgtpo", temp,10,100000000,10000); |
| 240 | BOOST_CHECK(GetHashFromCreatedTx(resut,temp)); |
| 241 | |
| 242 | BOOST_CHECK(SetAddrGenerteBlock("dggsWmQ7jH46dgtA5dEZ9bhFSAK1LASALw")); |
| 243 | Value temp1 = GetAccountInfo("010000000100"); |
| 244 | temp1 = GetAccountInfo("dsGb9GyDGYnnHdjSvRfYbj9ox2zPbtgtpo"); |
| 245 | BOOST_CHECK_EQUAL(GetValue(temp1,"Balance"),99999999899990000); |
| 246 | |
| 247 | |
| 248 | /// 脚本账户给普通账户打钱 |
| 249 | param = 14; |
| 250 | temp = ""; |
| 251 | temp += tinyformat::format("%02x%s",param,accountId); |
| 252 | resut =CallContractTx("010000000100", "dsGb9GyDGYnnHdjSvRfYbj9ox2zPbtgtpo", temp,10,100000000); |
| 253 | BOOST_CHECK(GetHashFromCreatedTx(resut,temp)); |
| 254 | |
| 255 | BOOST_CHECK(SetAddrGenerteBlock("dps9hqUmBAVGVg7ijLGPcD9CJz9HHiTw6H")); |
| 256 | temp1 = GetAccountInfo("010000000100"); |
| 257 | BOOST_CHECK_EQUAL(GetValue(temp1,"Balance"),0); |
| 258 | temp1 = GetAccountInfo("dsGb9GyDGYnnHdjSvRfYbj9ox2zPbtgtpo"); |
| 259 | BOOST_CHECK_EQUAL(GetValue(temp1,"Balance"),99999999800000000); |
| 260 | |
| 261 | //测试不能从其他脚本打钱到本APP脚本账户中 |
| 262 | accountId = "020000000100"; |
| 263 | param = 19; |
| 264 | temp = ""; |
| 265 | temp += tinyformat::format("%02x%s",param,accountId); |
| 266 | resut =CallContractTx("010000000100", "dsGb9GyDGYnnHdjSvRfYbj9ox2zPbtgtpo", temp,10); |
| 267 | BOOST_CHECK(!GetHashFromCreatedTx(resut,temp)); |
| 268 | |
| 269 | } |
| 270 | |
| 271 | bool CheckScriptDB(int nheigh,string srcipt,string hash,int flag) |
| 272 | { |
nothing calls this directly
no test coverage detected