mirror of https://github.com/grpc/grpc-node.git
Fixed handling of long values
This commit is contained in:
parent
9c54277c6a
commit
35d83d25e1
|
@ -47,7 +47,9 @@ function deserializeCls(cls) {
|
|||
* @return {cls} The resulting object
|
||||
*/
|
||||
return function deserialize(arg_buf) {
|
||||
return cls.decode(arg_buf).toRaw();
|
||||
// Convert to a native object with binary fields as Buffers (first argument)
|
||||
// and longs as strings (second argument)
|
||||
return cls.decode(arg_buf).toRaw(false, true);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,8 @@ var common = require('../src/common.js');
|
|||
|
||||
var ProtoBuf = require('protobufjs');
|
||||
|
||||
var messages_proto = ProtoBuf.loadProtoFile(__dirname + '/test_messages.proto').build();
|
||||
var messages_proto = ProtoBuf.loadProtoFile(
|
||||
__dirname + '/test_messages.proto').build();
|
||||
|
||||
describe('Proto message serialize and deserialize', function() {
|
||||
var longSerialize = common.serializeCls(messages_proto.LongValues);
|
||||
|
|
Loading…
Reference in New Issue