diff --git a/src/wormhole/_code.py b/src/wormhole/_code.py index edcac03..e026460 100644 --- a/src/wormhole/_code.py +++ b/src/wormhole/_code.py @@ -56,8 +56,8 @@ class Code(object): def do_set_code(self, code): nameplate = code.split("-", 2)[0] self._N.set_nameplate(nameplate) - self._K.got_code(code) self._B.got_code(code) + self._K.got_code(code) @m.output() def do_start_input(self): @@ -67,8 +67,8 @@ class Code(object): self._N.set_nameplate(nameplate) @m.output() def do_finish_input(self, code): - self._K.got_code(code) self._B.got_code(code) + self._K.got_code(code) @m.output() def do_start_allocate(self, length, wordlist): @@ -77,8 +77,8 @@ class Code(object): def do_finish_allocate(self, nameplate, code): assert code.startswith(nameplate+"-"), (nameplate, code) self._N.set_nameplate(nameplate) - self._K.got_code(code) self._B.got_code(code) + self._K.got_code(code) S0_idle.upon(set_code, enter=S4_known, outputs=[do_set_code]) S0_idle.upon(input_code, enter=S1_inputting_nameplate, diff --git a/src/wormhole/test/test_machines.py b/src/wormhole/test/test_machines.py index 0054833..c7b0332 100644 --- a/src/wormhole/test/test_machines.py +++ b/src/wormhole/test/test_machines.py @@ -273,8 +273,8 @@ class Code(unittest.TestCase): c, b, a, n, k, i, events = self.build() c.set_code(u"1-code") self.assertEqual(events, [("n.set_nameplate", u"1"), - ("k.got_code", u"1-code"), ("b.got_code", u"1-code"), + ("k.got_code", u"1-code"), ]) def test_allocate_code(self): @@ -285,8 +285,8 @@ class Code(unittest.TestCase): events[:] = [] c.allocated("1", "1-code") self.assertEqual(events, [("n.set_nameplate", u"1"), - ("k.got_code", u"1-code"), ("b.got_code", u"1-code"), + ("k.got_code", u"1-code"), ]) def test_input_code(self): @@ -299,8 +299,8 @@ class Code(unittest.TestCase): ]) events[:] = [] c.finished_input("1-code") - self.assertEqual(events, [("k.got_code", u"1-code"), - ("b.got_code", u"1-code"), + self.assertEqual(events, [("b.got_code", u"1-code"), + ("k.got_code", u"1-code"), ]) class Input(unittest.TestCase):