@@ -125,6 +125,44 @@ func TestSubmitTxAccept(t *testing.T) {
125125 )
126126}
127127
128+ // TestSubmitTxAcceptThenDone reproduces the cardano-cli submit flow from dingo
129+ // issue #2788: submit a transaction, receive AcceptTx, then cleanly close the
130+ // protocol by sending MsgDone from the Idle state. Before the Idle->Done
131+ // transition existed, Stop() produced a protocol-state error that tore down the
132+ // node-to-client connection.
133+ func TestSubmitTxAcceptThenDone (t * testing.T ) {
134+ testTx := test .DecodeHexString ("abcdef0123456789" )
135+ conversation := append (
136+ conversationHandshakeSubmitTx ,
137+ ouroboros_mock.ConversationEntryOutput {
138+ ProtocolId : localtxsubmission .ProtocolId ,
139+ IsResponse : true ,
140+ Messages : []protocol.Message {
141+ localtxsubmission .NewMsgAcceptTx (),
142+ },
143+ },
144+ ouroboros_mock.ConversationEntryInput {
145+ ProtocolId : localtxsubmission .ProtocolId ,
146+ MessageType : localtxsubmission .MessageTypeDone ,
147+ },
148+ )
149+ runTest (
150+ t ,
151+ conversation ,
152+ func (t * testing.T , oConn * ouroboros.Connection ) {
153+ if err := oConn .LocalTxSubmission ().Client .SubmitTx (
154+ ledger .TxTypeBabbage ,
155+ testTx ,
156+ ); err != nil {
157+ t .Fatalf ("received unexpected error on SubmitTx: %s" , err )
158+ }
159+ if err := oConn .LocalTxSubmission ().Client .Stop (); err != nil {
160+ t .Fatalf ("received unexpected error on Stop: %s" , err )
161+ }
162+ },
163+ )
164+ }
165+
128166func TestSubmitTxRject (t * testing.T ) {
129167 testTx := test .DecodeHexString ("abcdef0123456789" )
130168 expectedErr := localtxsubmission.TransactionRejectedError {
0 commit comments