All files / src rightsregistry.js

37.5% Statements 3/8
0% Branches 0/1
0% Functions 0/1
37.5% Lines 3/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 209x   9x                           9x      
const { ChainAction, composeAction } = require('./compose');
 
const RIGHT_CONTRACT_NAME = 'rights.ore';
 
function setRightsInRegistry(oreAccountName, rightData, broadcast = true) {
  // Enables the rights issuers add & modify rights, seperately from instruments
  // upsertright(account_name issuer, string &right_name, vector<ore_types::endpoint_url> urls, vector<account_name> issuer_whitelist)
  const { right_name, urls, issuer_whitelist } = rightData;
 
  const args = { contractName: RIGHT_CONTRACT_NAME, issuer_whitelist, oreAccountName, right_name, urls };
  const action = composeAction(ChainAction.Ore_UpsertRight, args);
  const actions = [action];
 
  return this.transact(actions, broadcast);
}
 
module.exports = {
  setRightsInRegistry
};