Zeth - Zerocash on Ethereum
0.8
Reference implementation of the Zeth protocol by Clearmatics
mpc
coordinator
icontributionhandler.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
3
# Copyright (c) 2015-2022 Clearmatics Technologies Ltd
4
#
5
# SPDX-License-Identifier: LGPL-3.0+
6
7
"""
8
IContributionHandler interface
9
"""
10
11
# pylint: disable=unnecessary-pass
12
13
from
abc
import
(ABC, abstractmethod)
14
15
16
class
IContributionHandler
(ABC):
17
"""
18
Interface that must be implemented by handlers processing contributions
19
"""
20
21
@abstractmethod
22
def
get_current_challenge_file
(self, contributor_idx: int) -> str:
23
"""
24
Return the location of the current challenge to serve.
25
"""
26
pass
27
28
@abstractmethod
29
def
process_contribution
(
30
self, contribution_idx: int, file_name: str) -> bool:
31
"""
32
Process the given uploaded file as a contribution. If any errors are
33
found, throw an exception with an appropriate message, or return false.
34
"""
35
pass
36
37
@abstractmethod
38
def
on_completed
(self) -> None:
39
"""
40
All contributions have been received and the MPC is complete.
41
"""
42
pass
coordinator.icontributionhandler.IContributionHandler
Definition:
icontributionhandler.py:16
coordinator.icontributionhandler.IContributionHandler.process_contribution
bool process_contribution(self, int contribution_idx, str file_name)
Definition:
icontributionhandler.py:29
coordinator.icontributionhandler.IContributionHandler.on_completed
None on_completed(self)
Definition:
icontributionhandler.py:38
coordinator.icontributionhandler.IContributionHandler.get_current_challenge_file
str get_current_challenge_file(self, int contributor_idx)
Definition:
icontributionhandler.py:22
Generated on Mon Nov 28 2022 10:29:03 for Zeth - Zerocash on Ethereum by
1.8.17