Skip to content

Commit

Permalink
Added codec (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiruxaspb authored Feb 28, 2024
1 parent 530ac6e commit da0eec8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/snet_cli/snet/snet_cli/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "v2.1.1"
__version__ = "v2.1.2"
4 changes: 3 additions & 1 deletion packages/snet_cli/snet_cli/commands/mpe_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from snet_cli.utils.agix2cogs import cogs2stragix
from web3._utils.encoding import pad_hex
from web3._utils.events import get_event_data
from eth_abi.codec import ABICodec

# we inherit MPEServiceCommand because we need _get_service_metadata_from_registry
class MPEChannelCommand(OrganizationCommand):
Expand Down Expand Up @@ -499,12 +500,13 @@ def _get_all_filtered_channels(self, topics_without_signature):
mpe_address = self.get_mpe_address()
event_signature = self.ident.w3.keccak(
text="ChannelOpen(uint256,uint256,address,address,address,bytes32,uint256,uint256)").hex()
codec: ABICodec = self.ident.w3.codec
topics = [event_signature] + topics_without_signature
logs = self.ident.w3.eth.get_logs(
{"fromBlock": self.args.from_block, "address": mpe_address, "topics": topics})
abi = get_contract_def("MultiPartyEscrow")
event_abi = abi_get_element_by_name(abi, "ChannelOpen")
channels_ids = [get_event_data(event_abi, l)[
channels_ids = [get_event_data(codec, event_abi, l)[
"args"]["channelId"] for l in logs]
return channels_ids

Expand Down

0 comments on commit da0eec8

Please sign in to comment.