EIP712 Filtering count checking

This commit is contained in:
Alexandre Paillier
2022-08-19 18:31:00 +02:00
parent 93b0bb08f7
commit ed479128fd
12 changed files with 139 additions and 67 deletions

View File

@@ -151,13 +151,19 @@ class EthereumCmdBuilder:
data += sig
return data
def eip712_filtering_send_contract_name(self, name: str, sig: bytes) -> bytes:
def eip712_filtering_message_info(self, name: str, filters_count: int, sig: bytes) -> bytes:
data = bytearray()
data.append(len(name))
data += self._string_to_bytes(name)
data.append(filters_count)
data.append(len(sig))
data += sig
return self._serialize(InsType.EIP712_SEND_FILTERING,
P1Type.COMPLETE_SEND,
P2Type.FILTERING_CONTRACT_NAME,
self._eip712_filtering_send_name(name, sig))
data)
def eip712_filtering_send_field_name(self, name: str, sig: bytes) -> bytes:
def eip712_filtering_show_field(self, name: str, sig: bytes) -> bytes:
return self._serialize(InsType.EIP712_SEND_FILTERING,
P1Type.COMPLETE_SEND,
P2Type.FILTERING_FIELD_NAME,