-
Notifications
You must be signed in to change notification settings - Fork 27
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
Revisions rpc #30
Revisions rpc #30
Conversation
Makfile: add make rules for local test purposes pkg/eth/rpc_types: refactor GetBlockByHashRequest.UnmarshalJSON() pkg/transformer/eth_getBlockByHash: small refactor ProxyETHGetBlockByHash.request(); add todos to discuss .gitignore: add api.rest
…refactor at ProxyETHGetBlockByHash.request()
…ption at Transformer.[Transform(),getProxy()]
…tTxReceiverAddress()
…lockByHash.request()
…tBlockByNumber.Request()
…ardTransactionByHash()
…ponseBodyToResult() (cherry picked from commit 94004967c981fd34876b1f4f82cbd3e72ec9b3c0)
…b and todo at getTransactionByHash()
b4d6298
to
2c17ab3
Compare
pkg/eth/rpc_types.go
Outdated
@@ -199,55 +200,87 @@ func (r *GetLogsRequest) UnmarshalJSON(data []byte) error { | |||
|
|||
// ========== GetTransactionByHash ============= // | |||
type ( | |||
// Presents transacrion hash value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transaction* spelling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue is resolved, see commit by hash: ac5dbdf
Nonce: "0x0", | ||
|
||
// TODO: researching | ||
// ? Do we need those values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might at a later date when it comes to recovery by signature.
// TODO: researching | ||
// ? May be don't need this | ||
// ! Probably, needs huge quantity requests to calc by hands | ||
Nonce: "0x0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay! In this case, we assume that this value will always be "0x0" to keep the correct value format as the graph-node requires. Issue is resolved, see commit by hash: aa08162
// TODO: discuss, consider values | ||
// - gas limit is needed for `eth_getBlockByHash` request (return as a func result?) | ||
// ? ethTx.GasPrice | ||
ethTx.GasPrice = "0x0" // temporary solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gas Price is generally 0x40. But I believe this should be returnable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue is resolved, see commit by hash: cd94946
ethTx.To = utils.AddHexPrefix(qtumTxContractInfo.To) | ||
ethTx.Gas = utils.AddHexPrefix(qtumTxContractInfo.GasUsed) | ||
// TODO: discuss, consider values | ||
// - gas limit is needed for `eth_getBlockByHash` request (return as a func result?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe that's the case. You should be fine with this as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue is resolved, see commit by hash: cd94946
finalOp := script[len(script)-1] | ||
// TODO: discuss | ||
// ? There are `witness` transactions, that is not acquireable nither via `gettransaction`, nor `getrawtransaction` | ||
func getRewardTransactionByHash(p *qtum.Qtum, hash string) (*eth.GetTransactionByHashResponse, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this function exist exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function was implemented in order to serve reward transactions, such as coinbase transactions, because those transactions cannot be acquired via gettransaction method, but via getrawtransaction method.
Also implementation of this function helps keep the code a more readable and detailed by splitting the flows, despite some possible duplicates at the moment. However we may, unwrap the code of this function to keep the logic of all cases in one place.
In addition, Qtum may be improved in the future and some changes will be made to this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that works.
// ! Genesis block cannot be retreived | ||
return big.NewInt(0), nil | ||
|
||
case "pending": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't really have the concept of pending when it comes to events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any developments on the way in Qtum for this concept? We think that it could become an issue in the future, if it is not included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not. If you have concerns please detail them.
…action nonce at getTransactionByHash() & getRewardTransactionByHash()
…ransaction gas price at getTransactionByHash()
… value check at getTransactionByHash()
…onByHash() - sometimes 'receive' category is not present at vouts
Hey guys. Reviewing this. Just need to get the .mod and .sum conflicts resolved and we should be good to go here. Diego has retested and I think these changes get us closer rather than further from our goal. |
The conflicts are resolved. Apologies for the delay. |
Revisions:
run-janus
,run-qtum
,follow-qtum-logs
,open-qtum-bash
,stop-qtum
,restart-qtum
rules. - go.mod / go.sum:V
,R
,S
fields at GetTransactionByHashResponse{};at ProxyETHNetVersion.request() - TODO added. - pkg/transformer/eth_newFilter.go:
earliest
andpending
switch cases;