Skip to content

Commit

Permalink
fix did issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssallam committed Sep 15, 2020
1 parent 4e64026 commit b6ea46a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ocean_provider/custom_data_token.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from eth_utils import remove_0x_prefix
from ocean_lib.models.data_token import DataToken
from ocean_lib.ocean.util import from_base_18, to_base_18
from ocean_lib.web3_internal.event_filter import EventFilter
Expand Down Expand Up @@ -41,7 +42,7 @@ def verify_order_tx(self, web3, tx_id, did, service_id, amount_base, sender, rec
assert len(event_logs) == 1, \
f'Multiple order events in the same transaction !!! {event_logs}'

asset_id = did
asset_id = remove_0x_prefix(did)
if order_log.args.did.hex() != asset_id or str(order_log.args.serviceId) != str(service_id):
raise AssertionError(f'The asset id (DID) or service id in the event does '
f'not match the requested asset. \n'
Expand Down
2 changes: 1 addition & 1 deletion tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,5 +511,5 @@ def send_order(client, ddo, datatoken, service, cons_wallet, pub_wallet):
# Transfer tokens to provider account
fee_percent = 0.001
tx_id = datatoken.startOrder(receiver, num_tokens, ddo.asset_id, service.index, '0xF9f2DB837b3db03Be72252fAeD2f6E0b73E428b9', 0, cons_wallet)
datatoken.verify_order_tx(web3, tx_id, ddo.did, service.index, num_tokens, cons_wallet.address, receiver, fee_percent)
datatoken.verify_order_tx(web3, tx_id, ddo.asset_id, service.index, num_tokens, cons_wallet.address, receiver, fee_percent)
return tx_id

0 comments on commit b6ea46a

Please sign in to comment.