How to use the fromValue function from long
Find comprehensive JavaScript long.fromValue code examples handpicked from public code repositorys.
83 84 85 86 87 88 89 90 91 92
} writeLong(value) { try { if (!Long.isLong(value)) { value = Long.fromValue(value); } } catch (err) { throw Errors.IgniteClientError.valueCastError(value, BinaryUtils.TYPE_CODE.LONG);
50
0
1
GitHub: ali-sdk/ali-mc
193 194 195 196 197 198 199 200 201 202
function isDouble(o) { return is.number(o) && !is.integer(o); } function writeLong(o) { o = Long.fromValue(o); const buf = new Buffer(8); buf.writeInt32BE(o.high, 0); buf.writeInt32BE(o.low, 4); return buf;
0
10
12
157 158 159 160 161 162 163 164 165 166
}); chaincodes.push(chaincode); } const properties = fabproto6.gossip.Properties.create({ chaincodes: chaincodes, ledger_height: Long.fromValue(ledgerHeight), }); const stateInfo = fabproto6.gossip.StateInfo.create({ properties: properties });
0
0
1
53 54 55 56 57 58 59 60 61 62
'peer3.org3.example.com:9003' ]; const chaincodes = [{name: 'example', version: 'v2'}]; const highest = Long.fromValue(200); const ledgerHeight = Long.fromValue(100); const smaller = Long.fromValue(10); const endorsement_plan_template = { plan_id: 'example', groups: {
0
0
1
+ 23 other calls in file
217 218 219 220 221 222 223 224 225
it('should return null if no block seen', () => { should.equal(eventService.getLastBlockNumber(), null); }); it('should return a long if it has been seen', () => { eventService.lastBlockNumber = Long.fromValue(1); should.equal(eventService.getLastBlockNumber().toInt(), 1); }); });
0
0
1
+ 13 other calls in file
581 582 583 584 585 586 587 588 589 590
return keep_list; } _findHighest(peers) { let highest = Long.fromValue(0); for (const peer of peers) { try { if (peer.ledgerHeight.greaterThan(highest)) { highest = peer.ledgerHeight;
0
0
1
long.default is the most popular function in long (905 examples)