-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement Balance method and corresponding tests #12
Conversation
client_test.go
Outdated
@@ -53,3 +53,9 @@ func TestSubmitPDF(t *testing.T) { | |||
assert.NoError(t, err) | |||
assert.NotNil(t, txRes) | |||
} | |||
|
|||
func TestBalance(t *testing.T) { | |||
//t.Skip() |
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.
//t.Skip() |
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.
Just a note: #4 needs to be merged to enable tests.
client_test.go
Outdated
|
||
func TestBalance(t *testing.T) { | ||
//t.Skip() | ||
_, err := NewClient("http://localhost:26658", WithTimeout(30*time.Second)) |
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.
Does the timeout really need to be that long?
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.
Probably not. I used 30 seconds value because of SubmitPFD
tests (it waits for celestia block).
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.
Thanks a lot for your submission!
I left suggestions to rename balanceRequest
as it's not a request.
I'll merge this PR after #4 is done, so tests can run automatically in CI.
client_test.go
Outdated
@@ -53,3 +53,9 @@ func TestSubmitPDF(t *testing.T) { | |||
assert.NoError(t, err) | |||
assert.NotNil(t, txRes) | |||
} | |||
|
|||
func TestBalance(t *testing.T) { | |||
//t.Skip() |
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.
Just a note: #4 needs to be merged to enable tests.
client_test.go
Outdated
|
||
func TestBalance(t *testing.T) { | ||
//t.Skip() | ||
_, err := NewClient("http://localhost:26658", WithTimeout(30*time.Second)) |
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.
Probably not. I used 30 seconds value because of SubmitPFD
tests (it waits for celestia block).
client.go
Outdated
@@ -35,8 +35,23 @@ func (c *Client) Header(ctx context.Context, height uint64) /* Header */ error { | |||
} | |||
|
|||
func (c *Client) Balance(ctx context.Context) error { | |||
_ = balanceEndpoint | |||
return errors.New("method Balance not implemented") | |||
var result balanceRequest |
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.
var result balanceRequest | |
var result balanceResponse |
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.
Fixed balance type
@Regis-Caelum please rebase or merge with |
merged the changes with main |
Signed-off-by: Regis-Caelum [email protected]
Issues/PR
Fix Issue #8
Changes
struct
according to celestia documentation on balance response.Changes can be viewed in the files client.go, client_test.go, and type.go.