Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Track the trade of a commodity from one trader to another
- * @param {org.master.token.CreaMaster} cm - la transazione effettuata dalla banca
- * @transaction
- */
- async function creaMaster(cm) {
- /**
- * cm ha tre Attributi:
- * BANCA
- * QUANTITA
- * KPUBPROPRIETARIO
- */
- let regProp = await getParticipantRegistry('org.master.token.Individuo');
- let esisteProp = await regProp.exists(cm.kpubProprietario);
- if (!esisteProp) {
- throw new Error("il proprietario " + cm.kpubProprietario + " non esiste");
- }
- let prop = await regProp.get(cm.kpubProprietario);
- prop.borsellino.quantity = prop.borsellino.quantity + cm.quantity;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement