Skip to content

Commit 0507b24

Browse files
authored
Merge pull request #353 from cygnusv/breakdance
Introduce additional method to post transcripts
2 parents eb9ffd4 + 2bb2b22 commit 0507b24

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

contracts/contracts/coordination/Coordinator.sol

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,18 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable
398398
return 40 + (dkgSize + 1) * BLS12381.G2_POINT_SIZE + threshold * BLS12381.G1_POINT_SIZE;
399399
}
400400

401+
/**
402+
* @dev This method will be deprecated in the future. Use `publishTranscript` instead.
403+
*/
401404
function postTranscript(uint32 ritualId, bytes calldata transcript) external {
405+
_postTranscript(ritualId, transcript);
406+
}
407+
408+
function publishTranscript(uint32 ritualId, bytes calldata transcript) external {
409+
_postTranscript(ritualId, transcript);
410+
}
411+
412+
function _postTranscript(uint32 ritualId, bytes calldata transcript) internal {
402413
uint256 initialGasLeft = gasleft();
403414

404415
Ritual storage ritual = storageRitual(ritualId);

tests/test_coordinator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,12 @@ def test_post_transcript(coordinator, nodes, initiator, erc20, fee_model, global
251251
threshold = coordinator.getThresholdForRitualSize(size)
252252
transcript = generate_transcript(size, threshold)
253253

254-
for node in nodes:
254+
for i, node in enumerate(nodes):
255255
assert coordinator.getRitualState(0) == RitualState.DKG_AWAITING_TRANSCRIPTS
256256

257-
tx = coordinator.postTranscript(0, transcript, sender=node)
257+
# Some nodes will use a different method to post the transcript to test both methods
258+
post_transcript_fn = coordinator.postTranscript if i % 2 == 0 else coordinator.publishTranscript
259+
tx = post_transcript_fn(0, transcript, sender=node)
258260

259261
events = list(coordinator.TranscriptPosted.from_receipt(tx))
260262
assert events == [

0 commit comments

Comments
 (0)