-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add types.go #10
Add types.go #10
Conversation
@@ -26,10 +30,13 @@ func (c *Chain) GetBlockHash(blockNumber int) string { | |||
return response.Result.(string) | |||
} | |||
|
|||
func (c *Chain) GetBlockByNumber(blockNumber int) interface{} { | |||
func (c *Chain) GetBlockByNumber(blockNumber int) Block { | |||
const method = "chain_getBlockByNumber" | |||
response := c.rpcClient.call(callInterface{method: method, id: ""}, blockNumber) |
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.
How about pass the block to the callInterface function?
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.
Do you mean blockNumber
?
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.
Sorry I mean passing the block
variable to call
function as an argument.
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 see. I think that's a good idea.
I'll adjust this after merging #5