Re: (context post by jgarzik)

Participants: Jeff Garzik

Quote from: gavinandresen on July 30, 2010, 01:18:06 PM

Couple of quick suggestions:

Using the key name “class” will cause problems for, at least, JavaScript, and probably other languages where “class” is a reserved word. “type” or “variety” or some other synonym will cause fewer problems later.

Can you be more specific? All mainstream programming language seem sensibly insensitive to abitrary string contents, JS included. String content can certainly include language-reserved keywords and parsing tokens.

Quote from: gavinandresen on July 30, 2010, 01:18:06 PM

Since each entry refers to a transaction, I’d suggest adding a “tx_id” SHA256 hex-encoded transaction id. Then listtransactions would play nicely with the refundtransaction JSON-RPC extension (and maybe a future gettransactiondetails that let you get transaction parents, which block the transaction was in, and so on).

Code to get that would look something like: Code: uint256 tx_hash = transaction.GetHash(); string tx_id = tx_hash.GetHex(); mapJSONResponse.push_back(Pair(“tx_id”, tx_id));

Added, thanks for the suggestion.