-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v1.1-dev' into fix/create-some-id-transitions
- Loading branch information
Showing
10 changed files
with
111 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...lient/lib/methods/platform/getTotalCreditsInPlatform/GetTotalCreditsInPlatformResponse.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const AbstractResponse = require('../response/AbstractResponse'); | ||
const InvalidResponseError = require('../response/errors/InvalidResponseError'); | ||
|
||
class GetTotalCreditsInPlatformResponse extends AbstractResponse { | ||
/** | ||
* @param {number} totalCreditsInPlatform | ||
* @param {Metadata} metadata | ||
* @param {Proof} [proof] | ||
*/ | ||
constructor(totalCreditsInPlatform, metadata, proof = undefined) { | ||
super(metadata, proof); | ||
|
||
this.totalCreditsInPlatform = totalCreditsInPlatform; | ||
} | ||
|
||
/** | ||
* @returns {number} | ||
*/ | ||
getTotalCreditsInPlatform() { | ||
return this.totalCreditsInPlatform; | ||
} | ||
|
||
/** | ||
* @param proto | ||
* @returns {GetTotalCreditsInPlatformResponse} | ||
*/ | ||
static createFromProto(proto) { | ||
// eslint-disable-next-line | ||
const totalCreditsInPlatform = proto.getV0().getCredits(); | ||
const { metadata, proof } = AbstractResponse.createMetadataAndProofFromProto( | ||
proto, | ||
); | ||
|
||
if ((typeof totalCreditsInPlatform === 'undefined' || totalCreditsInPlatform === null) && !proof) { | ||
throw new InvalidResponseError('Total Credits on Platform data is not defined'); | ||
} | ||
|
||
return new GetTotalCreditsInPlatformResponse( | ||
totalCreditsInPlatform, | ||
metadata, | ||
proof, | ||
); | ||
} | ||
} | ||
|
||
module.exports = GetTotalCreditsInPlatformResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
...lient/lib/methods/platform/getTotalCreditsOnPlatform/GetTotalCreditsOnPlatformResponse.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters