mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
Change-Id: I235cb62df492b7713bb1c355b7457f679903bd34 Signed-off-by: Anthony O'Dowd <a_o-dowd@uk.ibm.com>
33 lines
No EOL
649 B
JavaScript
33 lines
No EOL
649 B
JavaScript
/*
|
|
SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
// Utility class for collections of ledger states -- a state list
|
|
const StateList = require('./../ledger-api/statelist.js');
|
|
|
|
const CommercialPaper = require('./paper.js');
|
|
|
|
class PaperList extends StateList {
|
|
|
|
constructor(ctx) {
|
|
super(ctx, 'org.papernet.commercialpaperlist');
|
|
this.use(CommercialPaper);
|
|
}
|
|
|
|
async addPaper(paper) {
|
|
return this.addState(paper);
|
|
}
|
|
|
|
async getPaper(paperKey) {
|
|
return this.getState(paperKey);
|
|
}
|
|
|
|
async updatePaper(paper) {
|
|
return this.updateState(paper);
|
|
}
|
|
}
|
|
|
|
|
|
module.exports = PaperList; |