@open-rights-exchange/orejs
Version:
Orejs is a Javascript helper library to provide simple high-level access to the ore-protocol. Orejs uses eosJS as a wrapper to the EOS blockchain.
36 lines (31 loc) • 665 B
JavaScript
function mockAuthorization(_authorization = {}) {
return {
actor: expect.any(String),
permission: expect.any(String),
..._authorization
};
}
function mockAction(_action = {}) {
const authorization = _action.authorization;
delete _action.authorization;
return {
account: expect.any(String),
name: expect.any(String),
authorization: [mockAuthorization(authorization)],
data: expect.any(Object),
..._action
};
}
function mockOptions(_options = {}) {
return {
blocksBehind: 3,
broadcast: true,
expireSeconds: 30,
..._options
};
}
module.exports = {
mockAction,
mockAuthorization,
mockOptions
};