Class: Confium::TC::SessionStub

Inherits:
Object
  • Object
show all
Defined in:
lib/confium/tc/session_stub.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_countObject (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

#roundObject (readonly)

Returns the value of attribute round.



15
16
17
# File 'lib/confium/tc/session_stub.rb', line 15

def round
  @round
end

#schemeObject (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_idxObject (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

#thresholdObject (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

Returns:

  • (Boolean)


26
27
28
# File 'lib/confium/tc/session_stub.rb', line 26

def complete?
  @complete
end

#resultObject



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(_incoming_messages)
  @round += 1
  @complete = @round >= 3  # FROST is 3 rounds
  { outgoing: [], complete: @complete }
end