Skip to content

Commit 3cae3f6

Browse files
authored
approval: no need to process RWSet #1165 (#1166)
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent bfb78f0 commit 3cae3f6

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

token/core/common/backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (b *Backend) HasBeenSignedBy(id driver.Identity, verifier driver.Verifier)
3939
sigma := b.Sigs[b.Cursor]
4040
b.Cursor++
4141

42-
b.Logger.Infof("verify signature [%s][%s][%s]", id, logging.Base64(sigma), utils.Hashable(b.Message))
42+
b.Logger.Debugf("verify signature [%s][%s][%s]", id, logging.Base64(sigma), utils.Hashable(b.Message))
4343

4444
return sigma, verifier.Verify(b.Message, sigma)
4545
}

token/services/network/fabric/endorsement/approval.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ type RequestApprovalView struct {
3838
}
3939

4040
func (r *RequestApprovalView) Call(context view.Context) (interface{}, error) {
41+
logger.DebugfContext(context.Context(), "request approval...")
42+
4143
_, tx, err := endorser.NewTransaction(
4244
context,
4345
fabric2.WithCreator(r.TxID.Creator),
@@ -72,25 +74,24 @@ func (r *RequestApprovalView) Call(context view.Context) (interface{}, error) {
7274
}
7375
}
7476

75-
logger.DebugfContext(context.Context(), "Request Endorsement on tx [%s] to [%v]...", tx.ID(), r.Endorsers)
77+
logger.DebugfContext(context.Context(), "request endorsement on tx [%s] to [%v]...", tx.ID(), r.Endorsers)
7678
_, err = context.RunView(endorser.NewParallelCollectEndorsementsOnProposalView(
7779
tx,
7880
r.Endorsers...,
7981
).WithTimeout(2 * time.Minute))
8082
if err != nil {
8183
return nil, errors.WithMessagef(err, "failed to collect endorsements")
8284
}
83-
logger.DebugfContext(context.Context(), "Request Endorsement on tx [%s] to [%v]...done", tx.ID(), r.Endorsers)
85+
logger.DebugfContext(context.Context(), "request endorsement done")
8486

85-
rws, err := tx.RWSet()
87+
// Return envelope
88+
env, err := tx.Envelope()
8689
if err != nil {
87-
return nil, errors.WithMessagef(err, "failed to get rws")
90+
return nil, errors.WithMessagef(err, "failed to retrieve envelope for endorsement")
8891
}
89-
rws.Done()
90-
logger.DebugfContext(context.Context(), "[%s] found [%d] nss [%v]", tx.ID(), len(rws.Namespaces()), rws.Namespaces())
92+
logger.DebugfContext(context.Context(), "envelope ready")
9193

92-
// Return envelope
93-
return tx.Envelope()
94+
return env, nil
9495
}
9596

9697
type Translator interface {

0 commit comments

Comments
 (0)