| 353 | return scriptid; |
| 354 | } |
| 355 | void testdb() |
| 356 | { |
| 357 | string phash = ""; |
| 358 | string scriptid = CreatWriteTx(phash); |
| 359 | int height = chainActive.Height(); |
| 360 | int circle = 4; |
| 361 | while(circle--) |
| 362 | { |
| 363 | BOOST_CHECK(GenerateOneBlock()); |
| 364 | } |
| 365 | |
| 366 | int count = 15; |
| 367 | while(count > 1) |
| 368 | { |
| 369 | //// second tx |
| 370 | uint256 hash(uint256S(phash.c_str())); |
| 371 | int param =16; |
| 372 | string temp = ""; |
| 373 | temp += tinyformat::format("%02x%s%02x",param,HexStr(hash),height); |
| 374 | // cout<<"cont:"<<temp<<endl; |
| 375 | CreateTx(temp,"e21rEzVwkPFQYfgxcg7xLp7DKeYrW4Fpoz"); |
| 376 | |
| 377 | vector<unsigned char> key; |
| 378 | const char *key1="2_error"; |
| 379 | key.insert(key.begin(),key1, key1 + strlen(key1) +1); |
| 380 | BOOST_CHECK(!GetContractData(scriptid,key)); |
| 381 | |
| 382 | CheckScriptDB((height),scriptid,phash,false); |
| 383 | count--; |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | void testdeletmodifydb() |
| 388 | { |