Skip to content

Commit 98edd48

Browse files
committed
Fixing getCode method to return the WASM instead of trying to fetch the WAST.
1 parent d6af019 commit 98edd48

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/io/topiacoin/eosrpcadapter/RPCChain.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,17 @@ public Code getCode(String accountName) throws ChainException {
257257
Code getCodeResponse = null;
258258

259259
try {
260-
URL getBlockURL = new URL(chainURL, "/v1/chain/get_code");
260+
URL getCodeURL = new URL(chainURL, "/v1/chain/get_code");
261261

262262
Map<String, String> requestMap = new HashMap<String, String>();
263263
requestMap.put("account_name", accountName);
264+
requestMap.put("code_as_wasm", "true");
264265

265266
String requestString = _objectMapper.writeValueAsString(requestMap);
266267

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

269-
EOSRPCAdapter.EOSRPCResponse response = rpcAdapter.postRequest(getBlockURL, requestString);
270+
EOSRPCAdapter.EOSRPCResponse response = rpcAdapter.postRequest(getCodeURL, requestString);
270271

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

0 commit comments

Comments
 (0)