Skip to content

Commit

Permalink
[FAB-7727]: Rename filtered transaction protos
Browse files Browse the repository at this point in the history
Following up comments provided in CR-16795, this commit takes care to
rename FilteredProposalResponse to FilteredTransactionActions to align
it with definitions of original Transaction message.

Change-Id: I4c10356107af96c8a0629b2fe3fcaa91cdaebffc
Signed-off-by: Artem Barger <[email protected]>
  • Loading branch information
C0rWin committed Jan 14, 2018
1 parent 967b5ef commit d56abab
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 105 deletions.
10 changes: 5 additions & 5 deletions core/peer/deliverevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ func (block *blockEvent) toFilteredBlock() (*peer.FilteredBlock, error) {
return filteredBlock, nil
}

func (ta transactionActions) toFilteredActions() (*peer.FilteredTransaction_ProposalResponse, error) {
proposalResponse := &peer.FilteredProposalResponse{}
func (ta transactionActions) toFilteredActions() (*peer.FilteredTransaction_TransactionActions, error) {
transactionActions := &peer.FilteredTransactionActions{}
for _, action := range ta {
chaincodeActionPayload, err := utils.GetChaincodeActionPayload(action.Payload)
if err != nil {
Expand Down Expand Up @@ -238,11 +238,11 @@ func (ta transactionActions) toFilteredActions() (*peer.FilteredTransaction_Prop
EventName: ccEvent.EventName,
},
}
proposalResponse.ChaincodeActions = append(proposalResponse.ChaincodeActions, filteredAction)
transactionActions.ChaincodeActions = append(transactionActions.ChaincodeActions, filteredAction)
}
}
return &peer.FilteredTransaction_ProposalResponse{
ProposalResponse: proposalResponse,
return &peer.FilteredTransaction_TransactionActions{
TransactionActions: transactionActions,
}, nil
}

Expand Down
6 changes: 3 additions & 3 deletions core/peer/deliverevents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ func TestEventsServer_DeliverFiltered(t *testing.T) {
test.Equal(test.txID, tx.Txid)
test.Equal(peer.TxValidationCode_VALID, tx.TxValidationCode)
test.Equal(common.HeaderType_ENDORSER_TRANSACTION, tx.Type)
proposalResponse := tx.GetProposalResponse()
test.NotNil(proposalResponse)
chaincodeActions := proposalResponse.ChaincodeActions
transactionActions := tx.GetTransactionActions()
test.NotNil(transactionActions)
chaincodeActions := transactionActions.ChaincodeActions
test.Equal(1, len(chaincodeActions))
test.Equal(test.eventName, chaincodeActions[0].CcEvent.EventName)
test.Equal(test.txID, chaincodeActions[0].CcEvent.TxId)
Expand Down
6 changes: 3 additions & 3 deletions events/producer/eventhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func CreateBlockEvents(block *common.Block) (bevent *pb.Event, fbevent *pb.Event
}

filteredTx := &pb.FilteredTransaction{Txid: chdr.TxId, TxValidationCode: txsFltr.Flag(txIndex), Type: headerType}
proposalResponse := &pb.FilteredProposalResponse{}
transactionActions := &pb.FilteredTransactionActions{}
for _, action := range tx.Actions {
chaincodeActionPayload, err := utils.GetChaincodeActionPayload(action.Payload)
if err != nil {
Expand Down Expand Up @@ -97,7 +97,7 @@ func CreateBlockEvents(block *common.Block) (bevent *pb.Event, fbevent *pb.Event
filteredCcEvent.Payload = nil
chaincodeAction.CcEvent = filteredCcEvent
}
proposalResponse.ChaincodeActions = append(proposalResponse.ChaincodeActions, chaincodeAction)
transactionActions.ChaincodeActions = append(transactionActions.ChaincodeActions, chaincodeAction)

// Drop read write set from transaction before sending block event
// Performance issue with chaincode deploy txs and causes nodejs grpc
Expand All @@ -114,7 +114,7 @@ func CreateBlockEvents(block *common.Block) (bevent *pb.Event, fbevent *pb.Event
return nil, nil, "", fmt.Errorf("error marshalling tx action payload for block event: %s", err)
}
}
filteredTx.Data = &pb.FilteredTransaction_ProposalResponse{ProposalResponse: proposalResponse}
filteredTx.Data = &pb.FilteredTransaction_TransactionActions{TransactionActions: transactionActions}
filteredTxArray = append(filteredTxArray, filteredTx)

payload.Data, err = utils.GetBytesTransaction(tx)
Expand Down
2 changes: 1 addition & 1 deletion protos/peer/admin.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d56abab

Please sign in to comment.