Example #1
0
    def extract_params(self, request: RPCRequest) -> ContentKey:
        raw_params = extract_params(request)

        validate_params_length(raw_params, 1)

        content_key_hex = raw_params[0]
        content_key = ContentKey(
            validate_and_convert_hexstr(content_key_hex)[0])

        return content_key
Example #2
0
    def extract_params(self, request: RPCRequest) -> Tuple[ContentKey, bytes]:
        raw_params = extract_params(request)

        validate_params_length(raw_params, 2)

        content_key_hex, content_hex = raw_params

        content_key = ContentKey(
            validate_and_convert_hexstr(content_key_hex)[0])
        content = validate_and_convert_hexstr(content_hex)[0]

        return content_key, content