* 创建合约交易 */
| 154 | * 创建合约交易 |
| 155 | */ |
| 156 | bool CallContractTx() { |
| 157 | map<string, string>::iterator iterSrcAddr = GetRandAddress(); |
| 158 | string srcAddr(iterSrcAddr->second); |
| 159 | |
| 160 | unsigned char cType; |
| 161 | RAND_bytes(&cType, sizeof(cType)); |
| 162 | int iIndex = cType % 2; |
| 163 | iIndex +=20; |
| 164 | string contact =strprintf("%02x",iIndex); |
| 165 | |
| 166 | int nfee = GetRandomFee() + 100000; |
| 167 | uint64_t llmoney = GetRandomMoney() * COIN; |
| 168 | Value value = SysTestBase::CallContractTx(regScriptId,srcAddr, contact,0,nfee, llmoney); |
| 169 | string txid = ""; |
| 170 | BOOST_CHECK(GetHashFromCreatedTx(value,txid)); |
| 171 | |
| 172 | vTransactionHash.push_back(txid); |
| 173 | if (mempool.mapTx.count(uint256(uint256S(txid))) > 0) { |
| 174 | std::shared_ptr<CBaseTx> tx = mempool.mapTx[uint256(uint256S(txid))].GetTransaction(); |
| 175 | vTransactions.push_back(tx); |
| 176 | } |
| 177 | vSendFee.push_back(make_pair(txid, nfee)); |
| 178 | return true; |
| 179 | } |
| 180 | |
| 181 | bool CreateRegScriptTx(bool fFlag, string &hash,string regAddress="") { |
| 182 | if(regAddress=="") { |
nothing calls this directly
no test coverage detected