Class: Confium::TC::SessionStub
- Inherits:
-
Object
- Object
- Confium::TC::SessionStub
- Defined in:
- lib/confium/tc/session_stub.rb
Instance Attribute Summary collapse
-
#party_count ⇒ Object
readonly
Returns the value of attribute party_count.
-
#round ⇒ Object
readonly
Returns the value of attribute round.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#this_party_idx ⇒ Object
readonly
Returns the value of attribute this_party_idx.
-
#threshold ⇒ Object
readonly
Returns the value of attribute threshold.
Instance Method Summary collapse
- #complete? ⇒ Boolean
-
#initialize(scheme:, threshold:, party_count:, this_party_idx:) ⇒ SessionStub
constructor
A new instance of SessionStub.
- #result ⇒ Object
-
#round_step(_incoming_messages) ⇒ Object
Stub: returns an empty RoundResult.
Constructor Details
#initialize(scheme:, threshold:, party_count:, this_party_idx:) ⇒ SessionStub
Returns a new instance of SessionStub.
17 18 19 20 21 22 23 24 |
# File 'lib/confium/tc/session_stub.rb', line 17 def initialize(scheme:, threshold:, party_count:, this_party_idx:) @scheme = scheme @threshold = threshold @party_count = party_count @this_party_idx = this_party_idx @round = 0 @complete = false end |
Instance Attribute Details
#party_count ⇒ Object (readonly)
Returns the value of attribute party_count.
15 16 17 |
# File 'lib/confium/tc/session_stub.rb', line 15 def party_count @party_count end |
#round ⇒ Object (readonly)
Returns the value of attribute round.
15 16 17 |
# File 'lib/confium/tc/session_stub.rb', line 15 def round @round end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
15 16 17 |
# File 'lib/confium/tc/session_stub.rb', line 15 def scheme @scheme end |
#this_party_idx ⇒ Object (readonly)
Returns the value of attribute this_party_idx.
15 16 17 |
# File 'lib/confium/tc/session_stub.rb', line 15 def this_party_idx @this_party_idx end |
#threshold ⇒ Object (readonly)
Returns the value of attribute threshold.
15 16 17 |
# File 'lib/confium/tc/session_stub.rb', line 15 def threshold @threshold end |
Instance Method Details
#complete? ⇒ Boolean
26 27 28 |
# File 'lib/confium/tc/session_stub.rb', line 26 def complete? @complete end |
#result ⇒ Object
38 39 40 |
# File 'lib/confium/tc/session_stub.rb', line 38 def result nil # Real implementation returns the signature/secret bytes. end |
#round_step(_incoming_messages) ⇒ Object
Stub: returns an empty RoundResult. Real implementation will call confium_tc::session::Session::round_step.
32 33 34 35 36 |
# File 'lib/confium/tc/session_stub.rb', line 32 def round_step() @round += 1 @complete = @round >= 3 # FROST is 3 rounds { outgoing: [], complete: @complete } end |