Skip to content

Commit

Permalink
Fix wait inclusion, use HashWithSignatures
Browse files Browse the repository at this point in the history
  • Loading branch information
kc1212 committed Jul 17, 2019
1 parent e338a66 commit fa4e7ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions byzcoin/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func (s *Service) AddTransaction(req *AddTxRequest) (*AddTxResponse, error) {
for found := false; !found; {
select {
case success := <-ch:
errMsg, exists := s.txErrorBuf.get(ctxHash)
errMsg, exists := s.txErrorBuf.get(req.Transaction.Instructions.HashWithSignatures())
if !success {
if !exists {
return nil, errors.New("transaction is in block, but got refused for unknown error")
Expand Down Expand Up @@ -2020,7 +2020,7 @@ func (s *Service) createStateChanges(sst *stagingStateTrie, scID skipchain.SkipB
func (s *Service) processOneTx(sst *stagingStateTrie, tx ClientTransaction) (newStateChanges StateChanges, newStateTrie *stagingStateTrie, err error) {
defer func() {
if err != nil {
s.txErrorBuf.add(tx.Instructions.Hash(), err.Error())
s.txErrorBuf.add(tx.Instructions.HashWithSignatures(), err.Error())
}
}()

Expand Down
2 changes: 1 addition & 1 deletion byzcoin/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ func waitInclusion(t *testing.T, client int) {
log.Lvl1("Create wrong transaction and wait")
counter++
pr, _, err, err2 = sendTransactionWithCounter(t, s, client, invalidContract, 10, counter)
require.Contains(t, err.Error(), "transaction is in block, but got refused")
require.Contains(t, err.Error(), "this invalid contract always returns an error")
require.NoError(t, err2)

// We expect to see only the refused transaction in the block in pr.
Expand Down

0 comments on commit fa4e7ae

Please sign in to comment.