Skip to content
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

Merged
merged 3 commits into from
Oct 8, 2019
Merged

Add types.go #10

merged 3 commits into from
Oct 8, 2019

Conversation

cubismic
Copy link
Member

@cubismic cubismic commented Sep 23, 2019

I'll adjust this after merging #5

@cubismic cubismic requested a review from majecty September 23, 2019 22:05
@cubismic cubismic changed the title Assign Block type Add types.go Sep 25, 2019
@@ -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)
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean blockNumber?

Copy link
Contributor

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.

Copy link
Member Author

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.

@majecty majecty merged commit ddaf7b0 into CodeChain-io:master Oct 8, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants