Skip to content

Commit

Permalink
Fixing getCode method to return the WASM instead of trying to fetch t…
Browse files Browse the repository at this point in the history
…he WAST.
  • Loading branch information
jchaager committed Jun 21, 2019
1 parent d6af019 commit 98edd48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/io/topiacoin/eosrpcadapter/RPCChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,17 @@ public Code getCode(String accountName) throws ChainException {
Code getCodeResponse = null;

try {
URL getBlockURL = new URL(chainURL, "/v1/chain/get_code");
URL getCodeURL = new URL(chainURL, "/v1/chain/get_code");

Map<String, String> requestMap = new HashMap<String, String>();
requestMap.put("account_name", accountName);
requestMap.put("code_as_wasm", "true");

String requestString = _objectMapper.writeValueAsString(requestMap);

_log.debug("Get Code Request: " + requestString);

EOSRPCAdapter.EOSRPCResponse response = rpcAdapter.postRequest(getBlockURL, requestString);
EOSRPCAdapter.EOSRPCResponse response = rpcAdapter.postRequest(getCodeURL, requestString);

_log.debug("Get Code Response: " + response);

Expand Down

0 comments on commit 98edd48

Please sign in to comment.