Compare commits

...

10 Commits

Author SHA1 Message Date
Sky Young
f1ef06879e
Merge pull request #1 from oipwg/update-fcoin
Update fcoin to 1.1.0
2019-07-25 10:40:50 -06:00
Sky Young
c44229feed Update fcoin version to 1.1.0 2019-07-25 10:38:21 -06:00
Sky Young
e334370777 Use new class based function checking instead of prototypal checking 2019-07-25 09:01:30 -06:00
Sky Young
d1034b3a82 Use proper Transaction import 2019-07-25 08:48:41 -06:00
Sky Young
1b1ef05ada Add fcoin to package.json 2019-07-24 12:57:00 -06:00
Sky Young
dae4c318c2 Properly deserialize Block using fcoin 2019-07-24 12:56:36 -06:00
Sky Young
a062769cc4 Update flocore-lib 2019-07-23 11:10:25 -06:00
Sky Young
f3cdb94450 Update fcoin 2019-07-19 15:09:09 -06:00
Sky Young
25adf9f18f Update version 2018-05-18 17:54:22 -07:00
Sky Young
14f3c30ad3 'bitcore-lib' -> 'flocore-lib' 2018-05-15 14:58:33 -07:00
6 changed files with 595 additions and 10024 deletions

View File

@ -1,4 +1,4 @@
var bitcore = require('bitcore-lib');
var bitcore = require('flocore-lib');
bitcore.P2P = require('./lib');
module.exports = bitcore.P2P;

View File

@ -1,6 +1,7 @@
'use strict';
var bitcore = require('flocore-lib');
var fcoin = require('fcoin');
var Inventory = require('../inventory');
function builder(options) {
@ -15,9 +16,9 @@ function builder(options) {
options.network = bitcore.Networks.defaultNetwork;
}
options.Block = options.Block || bitcore.Block;
options.Block = options.Block || fcoin.Block;
options.BlockHeader = options.BlockHeader || bitcore.BlockHeader;
options.Transaction = options.Transaction || bitcore.Transaction;
options.Transaction = options.Transaction || fcoin.TX;
options.MerkleBlock = options.MerkleBlock || bitcore.MerkleBlock;
options.protocolVersion = options.protocolVersion || 70001;

View File

@ -26,7 +26,7 @@ function BlockMessage(arg, options) {
inherits(BlockMessage, Message);
BlockMessage.prototype.setPayload = function(payload) {
if (this.Block.prototype.fromRaw) {
if (typeof this.Block.fromRaw === 'function') {
this.block = this.Block.fromRaw(payload);
} else {
this.block = this.Block.fromBuffer(payload);
@ -34,7 +34,7 @@ BlockMessage.prototype.setPayload = function(payload) {
};
BlockMessage.prototype.getPayload = function() {
if (this.Block.prototype.toRaw) {
if (typeof this.Block.fromRaw === 'function') {
return this.block.toRaw();
}
return this.block.toBuffer();

View File

@ -3,7 +3,6 @@
var Message = require('../message');
var inherits = require('util').inherits;
var bitcore = require('flocore-lib');
var bcoin = require('fcoin');
var $ = bitcore.util.preconditions;
var _ = bitcore.deps._;
@ -29,8 +28,8 @@ function TransactionMessage(arg, options) {
inherits(TransactionMessage, Message);
TransactionMessage.prototype.setPayload = function(payload) {
if (this.Transaction.prototype.fromRaw) {
this.transaction = bcoin.tx.fromRaw(payload);
if (typeof this.Transaction.fromRaw === 'function') {
this.transaction = this.Transaction.fromRaw(payload);
} else if (this.Transaction.prototype.fromBuffer) {
this.transaction = new this.Transaction().fromBuffer(payload);
} else {
@ -39,7 +38,7 @@ TransactionMessage.prototype.setPayload = function(payload) {
};
TransactionMessage.prototype.getPayload = function() {
if (this.Transaction.prototype.toRaw) {
if (typeof this.Transaction.fromRaw === 'function') {
return this.transaction.toRaw();
}
return this.transaction.toBuffer();

10595
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "flocore-p2p",
"version": "5.0.0-beta.3",
"version": "5.0.0-beta.8",
"description": "Interface to the Flo P2P network for flocore",
"main": "index.js",
"scripts": {
@ -18,10 +18,10 @@
"url": "https://github.com/bitpay/bitcore-p2p.git"
},
"dependencies": {
"flocore-lib": "0.15.0",
"fcoin": "1.0.0-beta.17",
"bloom-filter": "^0.2.0",
"buffers": "bitpay/node-buffers#v0.1.2-bitpay",
"fcoin": "^1.1.0",
"flocore-lib": "^0.15.2",
"socks5-client": "^0.3.6"
},
"devDependencies": {