You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.
Describe the bug (required)
A clear and concise description of what the bug is.
The getJob() function in the SDK sometimes includes an object instead of a string for the transcoder field. As a result, the tests for getJob() which validate the schema of the returned object fail.
getJob() executes the following operations:
Calls the JobsManager contract to fetch job data
Checks if the transcoder field in the returned job data is null or empty
If the transcoder field is null or empty, calls electActiveTranscoder() to compute the transcoder address assigned to the job [1]
Sets transcoder field in the job to the returned address from electActiveTranscoder()
We currently use the ethjs library for ETH contract related interactions. It seems that ethjs returns objects for contract calls even if the there is only a single value returned (see this issue). In other areas of the SDK, the headToString() helper is used to extract the first value from the object returned by ethjs. We can probably wrap the result of electActiveTranscoder() with this helper to fix this issue.
[1] The transcoder field in a job will be populated if the transcoder called claimWork() on the JobsManager contract at least once for the job. If the transcoder never called claimWork() for a job, the transcoder field will not be populated in the contract. However, the transcoder address assigned to the job can be computed using electActiveTranscoder().
Expected behavior (required)
A clear and concise description of what you expected to happen.
Tests should pass and SDK functions should return strings for ETH addresses and not objects.
To Reproduce (required)
Steps to reproduce the behavior:
Fixeslivepeer#319
Two tweaks here — `beforeEach` instead of `before` and some tweaks
to async loops so they actually wait until the end — forEach will
return immediately and cause a false positive.
Fixes#319
Two tweaks here — `beforeEach` instead of `before` and some tweaks
to async loops so they actually wait until the end — forEach will
return immediately and cause a false positive.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: sdkRelates to packages/sdk.type: bugsomething's not working correctly
Describe the bug (required)
A clear and concise description of what the bug is.
The
getJob()
function in the SDK sometimes includes an object instead of a string for the transcoder field. As a result, the tests forgetJob()
which validate the schema of the returned object fail.getJob()
executes the following operations:transcoder
field in the returned job data is null or emptytranscoder
field is null or empty, callselectActiveTranscoder()
to compute the transcoder address assigned to the job [1]transcoder
field in the job to the returned address fromelectActiveTranscoder()
We currently use the ethjs library for ETH contract related interactions. It seems that ethjs returns objects for contract calls even if the there is only a single value returned (see this issue). In other areas of the SDK, the
headToString()
helper is used to extract the first value from the object returned by ethjs. We can probably wrap the result ofelectActiveTranscoder()
with this helper to fix this issue.[1] The
transcoder
field in a job will be populated if the transcoder calledclaimWork()
on the JobsManager contract at least once for the job. If the transcoder never calledclaimWork()
for a job, thetranscoder
field will not be populated in the contract. However, the transcoder address assigned to the job can be computed usingelectActiveTranscoder()
.Expected behavior (required)
A clear and concise description of what you expected to happen.
Tests should pass and SDK functions should return strings for ETH addresses and not objects.
To Reproduce (required)
Steps to reproduce the behavior:
yarn test
in thesdk
packageDevice (required):
Console logs (optional)
The text was updated successfully, but these errors were encountered: