Skip to content

Commit

Permalink
Updated to handle cmdline logging and default gas (Consensys#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jframe authored and rain-on committed Mar 12, 2019
1 parent 33ef337 commit 7bdfa5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void parse(

commandLine = new CommandLine(this);
commandLine.setCaseInsensitiveEnumValuesAllowed(true);
commandLine.registerConverter(Level.class, Level::valueOf);

// Must manually show the usage/version info, as per the design of picocli
// (https://picocli.info/#_printing_help_automatically)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,17 @@ public static RawTransaction fromTransactionJson(final JsonObject transaction) {
if (txnParams.getString("data") != null) {
dataString = txnParams.getString("data");
}

// TODO(tmm): This should be configurable, but currently matches Geth.
String gasValue = "90000";
if (txnParams.getString("gas") != null) {
gasValue = txnParams.getString("gas").substring(2);
}

return RawTransaction.createTransaction(
new BigInteger(txnParams.getString("nonce").substring(2), 16),
new BigInteger(txnParams.getString("gasPrice").substring(2), 16),
new BigInteger(txnParams.getString("gas").substring(2), 16),
new BigInteger(gasValue, 16),
txnParams.getString("to"),
new BigInteger(txnParams.getString("value").substring(2), 16),
dataString);
Expand Down

0 comments on commit 7bdfa5d

Please sign in to comment.