Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ PaymentProtocol.prototype.get = function(key) {
//protobuf supports longs, javascript naturally does not
//convert longs (see long.js, e.g. require('long')) to Numbers
if (typeof v.low !== 'undefined' && typeof v.high !== 'undefined') {
return v.toInt();
return v.toNumber();
}

if (typeof v.toBuffer !== 'undefined') {
Expand Down
7 changes: 7 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ describe('PaymentProtocol', function() {
output.message.get('amount').toInt().should.equal(20);
});

it('should be able to get and set amount >= 2^32 through "PaymentProtocol"', function () {
var paypro = new PaymentProtocol();
paypro.makeOutput();
paypro.set('amount', 4294967296);
paypro.get('amount').should.equal(4294967296);
});

});

describe('#PaymentDetails', function() {
Expand Down