fabric-samples/commercial-paper/organization/digibank/contract/lib/paperlist.js
Anthony O'Dowd e67fcf14a3 FAB-12322 Update commercial-paper sample
Change-Id: I235cb62df492b7713bb1c355b7457f679903bd34
Signed-off-by: Anthony O'Dowd <a_o-dowd@uk.ibm.com>
2018-11-14 17:53:12 +00:00

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;