Skip to content

Commit

Permalink
[FAB-4824] NodeSDK - event replay
Browse files Browse the repository at this point in the history
Add timestamp to the event registration and have
it signed along with the creator.

Change-Id: If1557400fff5b28ce9a002f181c760cbb322d28f
Signed-off-by: Bret Harrison <[email protected]>
  • Loading branch information
harrisob committed Dec 1, 2017
1 parent 88e6b90 commit f752608
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fabric-client/lib/EventHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
var utils = require('./utils.js');
var Remote = require('./Remote.js');
var BlockDecoder = require('./BlockDecoder.js');
var clientUtils = require('./client-utils.js');
var grpc = require('grpc');
var logger = utils.getLogger('EventHub.js');

Expand Down Expand Up @@ -412,6 +413,7 @@ var EventHub = class {
}

event.setCreator(user.getIdentity().serialize());
event.setTimestamp(clientUtils.buildCurrentTimestamp());
signedEvent.setEventBytes(event.toBuffer());
var sig = user.getSigningIdentity().sign(event.toBuffer());
signedEvent.setSignature(Buffer.from(sig));
Expand Down

0 comments on commit f752608

Please sign in to comment.