MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / CallContractTx

Method CallContractTx

src/tests/pressure_tests.cpp:156–179  ·  view source on GitHub ↗

* 创建合约交易 */

Source from the content-addressed store, hash-verified

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=="") {

Callers

nothing calls this directly

Calls 7

GetRandAddressFunction · 0.85
CallContractTxFunction · 0.85
uint256SFunction · 0.85
push_backMethod · 0.80
GetTransactionMethod · 0.80
uint256Class · 0.50
countMethod · 0.45

Tested by

no test coverage detected