Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b4b4a30
ci added
Dec 10, 2018
3e4aa30
ci added
Dec 10, 2018
71c231f
ci added
Dec 10, 2018
7612a7f
ci added
Dec 10, 2018
6d43137
instrument update
Dec 10, 2018
76e65cf
instrument update
Dec 10, 2018
14d7cbb
instrument update
Dec 10, 2018
24db720
instrument update
Dec 10, 2018
ab51f96
eosio.cdt added
Dec 11, 2018
362e186
instrument updates
Dec 11, 2018
a72753f
instrument updates
Dec 11, 2018
6f6bc5c
instrument test updates
Dec 11, 2018
2122bc0
instrument test updates
Dec 11, 2018
5db51a9
repo clean
Dec 11, 2018
1b238ea
Add cancel deferred transaction in the checkRight instrument if minte…
Jan 4, 2019
d874246
Merge pull request #23 from API-market/108-cancel-deffered-fix
surabhil Jan 22, 2019
349ec8c
Revert "Merge pull request #23 from API-market/108-cancel-deffered-fix"
surabhil Jan 22, 2019
c4e2933
Merge branch 'dev' into 108-cancel-deffered-fix
surabhil Jan 22, 2019
dd0fa28
Merge pull request #25 from API-market/108-cancel-deffered-fix
surabhil Jan 22, 2019
996e864
rebase contracts
surabhil Jan 22, 2019
a3e74bc
add latest version of contracts
surabhil Jan 22, 2019
2ecd692
Merge branch 'master' into dev
surabhil Jan 22, 2019
92b4dab
intr test update
Jan 22, 2019
6474710
intr test update
Jan 22, 2019
af5c18e
intr test update
Jan 22, 2019
0d89982
Merge branch 'dev' into ci-test-integration
surabhil Jan 22, 2019
e4cebfb
Merge pull request #28 from API-market/ci-test-integration
surabhil Jan 22, 2019
b35ce46
Merge pull request #29 from API-market/dev
surabhil Jan 22, 2019
29ed8f6
Merge pull request #30 from API-market/staging
surabhil Jan 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions contracts/ore.instrument/ore.instrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ ACTION instrument::checkright(name minter, name issuer, string rightname, uint64
bool minter_owns_right = rightitr.owner == minter;
if (!minter_owns_right)
{
auto position_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), minter);

auto position_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), minter);
//if minter is not in whitelist, cancel the entire mint transaction
if (position_in_whitelist == rightitr.issuer_whitelist.end())
{
Expand All @@ -245,13 +244,12 @@ ACTION instrument::checkright(name minter, name issuer, string rightname, uint64
cancel_deferred(deferred_transaction_id);
}
msg = "Attempt to create instrument with right: " + rightname + " by minter: " + minter.to_string() + " who isn't whitelisted or owner of right";
eosio_assert(position_in_whitelist != rightitr.issuer_whitelist.end(), msg.c_str());
eosio_assert(false, msg.c_str());
}
}

// check if the issuer of the instrument is the owner of the right
bool issuer_owns_right = rightitr.owner == issuer;

if (!issuer_owns_right)
{
auto issuer_in_whitelist = std::find(rightitr.issuer_whitelist.begin(), rightitr.issuer_whitelist.end(), issuer);
Expand All @@ -263,7 +261,7 @@ ACTION instrument::checkright(name minter, name issuer, string rightname, uint64
cancel_deferred(deferred_transaction_id);
}
msg = "Attempt to create instrument with right: " + rightname + " by issuer: " + issuer.to_string() + " who isn't whitelisted or owner of right";
eosio_assert(issuer_in_whitelist != rightitr.issuer_whitelist.end(), msg.c_str());
eosio_assert(false, msg.c_str());
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions contracts/ore.rights_registry/--url
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 411 (Length Required)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>411.</b> <ins>That’s an error.</ins>
<p>POST requests require a <code>Content-length</code> header. <ins>That’s all we know.</ins>
5 changes: 3 additions & 2 deletions tests/instrument.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
from eosfactory.eosf import *
import time

verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG])

Expand Down Expand Up @@ -296,7 +297,7 @@ def test_06(self):
COMMENT('''
Update Instrument:
''')

time.sleep(3)
instr.push_action(
"createinst",
{
Expand All @@ -306,7 +307,7 @@ def test_06(self):
"instrument": {
"issuer": app,
"instrument_class": "sample_class",
"description": "different_description",
"description": "sample_description",
"instrument_template": "",
"security_type": "",
"parameter_rules": [],
Expand Down
4 changes: 2 additions & 2 deletions tests/rights_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ def test_02(self):
},
permission=(app, Permission.ACTIVE))

with self.assertRaises(Error): #You are not the issuer of the existing right. Update canceled.
with self.assertRaises(Error): #You are not the issuer of the existing contract. Update canceled.
right.push_action(
"upsertright",
{
"owner": right,
"owner": app,
"right_name": "apimarket.manager.licenseApi",
"urls": [{
"base_right": "",
Expand Down