fabric-samples/commercial-paper/organization/digibank/contract/lib/paperlist.js
Arnaud J Le Hors 2e3683c419
Add missing Copyright in some files (#163)
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2020-05-19 15:50:48 +01:00

35 lines
700 B
JavaScript

/*
* Copyright IBM Corp. All Rights Reserved.
*
* 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;