-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider renaming fields and changing types in the broadcast JSON output files #2987
Comments
I believe this has been done as @DaniPopes pointed out, and quickly checking recent broadcast logs it seems done. Feel free to reopen if it's not! |
Hmm when was this done? I don't see a PR linked, and I just foundryup'd and ran a script, and I see none of these changes implemented except for the address arg now including the leading 0x 😅 {
"transactions": [
{
"hash": "0xba6f75b3d3197fb86d9c22d8e21cf223dfc65d77dd1450046f6658a8dad10f1a",
"transactionType": "CREATE",
"contractName": "Counter",
"contractAddress": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
"function": null,
"arguments": [
"0x000000000000000000000000000000000000007B",
"true"
],
"transaction": {
"type": "0x02",
"from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"gas": "0x23494",
"value": "0x0",
"data": "0x608060405234801561001057600080fd5b5060405161018a38038061018a83398101604081905261002f9161003a565b505060008055610085565b6000806040838503121561004d57600080fd5b82516001600160a01b038116811461006457600080fd5b6020840151909250801515811461007a57600080fd5b809150509250929050565b60f7806100936000396000f3fe6080604052348015600f57600080fd5b5060043610603c5760003560e01c80633fb5c1cb1460415780638381f58a146053578063d09de08a14606d575b600080fd5b6051604c3660046083565b600055565b005b605b60005481565b60405190815260200160405180910390f35b6051600080549080607c83609b565b9190505550565b600060208284031215609457600080fd5b5035919050565b60006001820160ba57634e487b7160e01b600052601160045260246000fd5b506001019056fea264697066735822122072cde5e6bbd063dda2aca7fbf2547afa87257af5368206714e2af92cb926239b64736f6c63430008140033000000000000000000000000000000000000000000000000000000000000007b0000000000000000000000000000000000000000000000000000000000000001",
"nonce": "0x1",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0xba6f75b3d3197fb86d9c22d8e21cf223dfc65d77dd1450046f6658a8dad10f1a",
"transactionIndex": "0x0",
"blockHash": "0xb8238f8936f15e7dc0d86898e487cce2c828d0e343dc68870cfc6c1d693c59da",
"blockNumber": "0x2",
"from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"to": null,
"cumulativeGasUsed": "0x1b269",
"gasUsed": "0x1b269",
"contractAddress": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
"logs": [],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"effectiveGasPrice": "0xe7056143"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1686954856,
"chain": 31337,
"multi": false,
"commit": "20a75e1"
} |
ahhh my bad, i might have closed this issue by mistake instead of a similar one 😅 this one's still on the todo list |
Component
Forge
Describe the feature you would like
Right now in the broadcast logs there are two fields with names we should consider changing due to conflicts with language keywords.
function
is a keyword in JS, solidity, and likely other languages. I'd suggest renaming this tofunctionSig
since the full signature is showntype
is also a keyword in many languages. I'd suggest renaming totxType
There are also fields where the output types should be changed (I recall discussing this in the past but not sure if we're tracking anywhere so figured I'd mention it here). First, in the
transactions
array:transaction.type
should be a number, currently it's a hex stringtransaction.gas
should be a number, currently it's a hex stringlog_address
event andbroadcast
files #2975)0x
prefix but it should be included."true"
instead of a boolean oftrue
(same forfalse
)In the
receipts
array:transactionIndex
can be a number, currently it's a hex stringblockNumber
can be a number, currently it's a hex stringtransactionIndex
,logIndex
, andtransactionLogIndex
can all be numbers, currently they are hex stringscumulativeGasUsed
can be a number, currently it's a hex stringgasUsed
can be a number, currently it's a hex stringstatus
is a hex string but should be either a boolean or a number of1
or0
The above list is not comprehensive and there may be other fields that should have a more readable type.
These suggestions deviate from the ethereum JSON RPC spec in the sense that all numbers are "quantities" which means they're returned from the node as hex strings with as few leading zeros as possible. However, this makes the data less readable and harder to parse, and I don't think there's a reason why these log files need to strictly follow the spec.
Additional context
No response
The text was updated successfully, but these errors were encountered: