DiFronzo / blockchair

💰 Go (golang) client for the blockchair.com API
https://blockchair.vfiles.no
MIT License
11 stars 9 forks source link

[Feat.] Support for simulating a function to determine request cost #9

Open DiFronzo opened 3 years ago

DiFronzo commented 3 years ago

See this page for what is request cost. Make somthing that could simulate the run of a fucntion(s), without actually sending the request, to calculate the request cost in total or for each request.

Please share your thoughts on how it can be implemented and questions in this issue.

AshirwadPradhan commented 3 years ago

Hi, I would like to work on this issue. Let's discuss upon this as to how we can go about working on this issue !

DiFronzo commented 3 years ago

Hi @AshirwadPradhan, sorry for late response. I was thinking this might be solved by using methods, interfaces & composition. Like calling cost, err := c.GetUsage().simulate() should return a float and error (happy path for GetUsage() returns 0, nil).