mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
35 lines
700 B
JavaScript
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;
|