ether-camp / ethereum-harmony

DEPRECATED! Ethereum Independent Peer
GNU General Public License v3.0
253 stars 89 forks source link

why ethereum.getRepository().getCode(address) always return nothing? #113

Closed lxiaodao closed 6 years ago

lxiaodao commented 6 years ago

When add contract into system,always return error.The source code is below?

   final byte[] codeBytes = ethereum.getRepository().getCode(address);
        if (codeBytes == null || codeBytes.length == 0) {
            throw validationError("Account with address '%s' hasn't any code. Please ensure blockchain is fully synced.", hexAddress);
        }

The address create by ethereum-harmony has not the code. Is it not usefully??

zilm13 commented 6 years ago

@lxiaodao How did you deploy contract?

lxiaodao commented 6 years ago

Thanks.Using rpc,I have resolve the problem.

  ca.from = cowAcct;
                ca.gas= hxgas;
                ca.data = rpcResult.code;
                //3.部署合约
             String txhash=this.jsonRpc.eth_sendTransaction(ca);

The test class CreateContractSample in ethereumj-core is not good enough in my private ethereum blockchain.