Merge PR #742 from 'nodech/update-ci'
This commit is contained in:
commit
7c00f01998
15 changed files with 51 additions and 38 deletions
18
package-lock.json
generated
18
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "hsd",
|
||||
"version": "3.0.1",
|
||||
"version": "4.99.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "hsd",
|
||||
"version": "3.0.1",
|
||||
"version": "4.99.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bcfg": "~0.1.7",
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
"goosig": "~0.10.0",
|
||||
"hs-client": "~0.0.11",
|
||||
"n64": "~0.2.10",
|
||||
"urkel": "~1.0.1"
|
||||
"urkel": "~1.0.2"
|
||||
},
|
||||
"bin": {
|
||||
"hs-seeder": "bin/hs-seeder",
|
||||
|
|
@ -461,9 +461,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/urkel": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/urkel/-/urkel-1.0.1.tgz",
|
||||
"integrity": "sha512-/ul3w/hvvGzppHqdpDAcEFe8kS1hi6ty5h7oQalIlVLwPNUJ/tz/h7KtIyNRC0+u7ANryq2Aw96N8snq+VYEOg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/urkel/-/urkel-1.0.2.tgz",
|
||||
"integrity": "sha512-Y5UXbgBr6pczrD08N0SYJkWjtdtTTpmZsOvuftdrEHLnTjuxwSNjKsXYLQkICTptvnHAJ2OjI6XdAxtYTyOHew==",
|
||||
"dependencies": {
|
||||
"bfile": "~0.2.1",
|
||||
"bmutex": "~0.1.6",
|
||||
|
|
@ -748,9 +748,9 @@
|
|||
}
|
||||
},
|
||||
"urkel": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/urkel/-/urkel-1.0.1.tgz",
|
||||
"integrity": "sha512-/ul3w/hvvGzppHqdpDAcEFe8kS1hi6ty5h7oQalIlVLwPNUJ/tz/h7KtIyNRC0+u7ANryq2Aw96N8snq+VYEOg==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/urkel/-/urkel-1.0.2.tgz",
|
||||
"integrity": "sha512-Y5UXbgBr6pczrD08N0SYJkWjtdtTTpmZsOvuftdrEHLnTjuxwSNjKsXYLQkICTptvnHAJ2OjI6XdAxtYTyOHew==",
|
||||
"requires": {
|
||||
"bfile": "~0.2.1",
|
||||
"bmutex": "~0.1.6",
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
"goosig": "~0.10.0",
|
||||
"hs-client": "~0.0.11",
|
||||
"n64": "~0.2.10",
|
||||
"urkel": "~1.0.1"
|
||||
"urkel": "~1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bmocha": "^2.1.5"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ const {wdb} = node.require('walletdb');
|
|||
let alice, aliceReceive;
|
||||
let bob, bobReceive;
|
||||
|
||||
const name = rules.grindName(5, 1, network);
|
||||
const name = rules.grindName(10, 1, network);
|
||||
const nameHash = rules.hashName(name);
|
||||
let heightBeforeOpen, heightBeforeRegister, heightBeforeFinalize;
|
||||
let coin;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,9 @@ const ownership = require('../lib/covenants/ownership');
|
|||
|
||||
const network = Network.get('regtest');
|
||||
const {treeInterval} = network.names;
|
||||
const NAME1 = rules.grindName(10, 20, network);
|
||||
const NAME2 = rules.grindName(10, 20, network);
|
||||
const GNAME_SIZE = 10;
|
||||
const NAME1 = rules.grindName(GNAME_SIZE, 20, network);
|
||||
const NAME2 = rules.grindName(GNAME_SIZE, 20, network);
|
||||
|
||||
const workers = new WorkerPool({
|
||||
// Must be disabled for `ownership.ignore`.
|
||||
|
|
|
|||
|
|
@ -136,11 +136,13 @@ class TestUtil {
|
|||
}
|
||||
}
|
||||
|
||||
const GNAME_SIZE = 10;
|
||||
|
||||
describe('Auction RPCs', function() {
|
||||
this.timeout(60000);
|
||||
|
||||
const util = new TestUtil();
|
||||
const name = rules.grindName(2, 0, Network.get('regtest'));
|
||||
const name = rules.grindName(GNAME_SIZE, 0, Network.get('regtest'));
|
||||
let winner, loser;
|
||||
const winnerBid = {
|
||||
bid: 5,
|
||||
|
|
|
|||
|
|
@ -11,8 +11,9 @@ const rules = require('../lib/covenants/rules');
|
|||
const ownership = require('../lib/covenants/ownership');
|
||||
|
||||
const network = Network.get('regtest');
|
||||
const NAME1 = rules.grindName(10, 20, network);
|
||||
const NAME2 = rules.grindName(10, 20, network);
|
||||
const GNAME_SIZE = 10;
|
||||
const NAME1 = rules.grindName(GNAME_SIZE, 20, network);
|
||||
const NAME2 = rules.grindName(GNAME_SIZE, 20, network);
|
||||
|
||||
const workers = new WorkerPool({
|
||||
// Must be disabled for `ownership.ignore`.
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ const wallet = new MemWallet({
|
|||
network
|
||||
});
|
||||
|
||||
const GNAME_SIZE = 10;
|
||||
|
||||
wallet.getNameStatus = async (nameHash) => {
|
||||
assert(Buffer.isBuffer(nameHash));
|
||||
const height = chainGenerator.height + 1;
|
||||
|
|
@ -155,11 +157,11 @@ describe('Checkpoints', function() {
|
|||
|
||||
it('should win names in auction', async () => {
|
||||
// Only one bid, 0-value name
|
||||
const name1 = rules.grindName(5, chainGenerator.height - 5, network);
|
||||
const name1 = rules.grindName(GNAME_SIZE, chainGenerator.height - 5, network);
|
||||
// Two bids, name will have a value
|
||||
const name2 = rules.grindName(5, chainGenerator.height - 5, network);
|
||||
const name2 = rules.grindName(GNAME_SIZE, chainGenerator.height - 5, network);
|
||||
// Two bids, but wallet will not REGISTER
|
||||
const name3 = rules.grindName(5, chainGenerator.height - 5, network);
|
||||
const name3 = rules.grindName(GNAME_SIZE, chainGenerator.height - 5, network);
|
||||
|
||||
const open1 = await wallet.sendOpen(name1);
|
||||
const open2 = await wallet.sendOpen(name2);
|
||||
|
|
@ -218,7 +220,7 @@ describe('Checkpoints', function() {
|
|||
});
|
||||
|
||||
it('should bid in multiple blocks', async () => {
|
||||
const name = rules.grindName(5, chainGenerator.height - 5, network);
|
||||
const name = rules.grindName(GNAME_SIZE, chainGenerator.height - 5, network);
|
||||
|
||||
const open = await wallet.sendOpen(name);
|
||||
|
||||
|
|
@ -366,7 +368,7 @@ describe('Checkpoints', function() {
|
|||
let invalidBlockEntry;
|
||||
|
||||
before(async () => {
|
||||
name = rules.grindName(5, chainGenerator.height - 5, network);
|
||||
name = rules.grindName(GNAME_SIZE, chainGenerator.height - 5, network);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ const {
|
|||
revealPeriod
|
||||
} = network.names;
|
||||
|
||||
const GNAME_SIZE = 10;
|
||||
|
||||
describe('Tree Compacting', function() {
|
||||
const oldKeepBlocks = network.block.keepBlocks;
|
||||
const oldpruneAfterHeight = network.block.pruneAfterHeight;
|
||||
|
|
@ -182,7 +184,7 @@ describe('Tree Compacting', function() {
|
|||
});
|
||||
|
||||
it('should win an auction and register', async () => {
|
||||
name = rules.grindName(3, chain.height, network);
|
||||
name = rules.grindName(GNAME_SIZE, chain.height, network);
|
||||
nameHash = rules.hashName(name);
|
||||
send(await wallet.sendOpen(name), mempool);
|
||||
await mineBlocks(treeInterval + 1, mempool);
|
||||
|
|
@ -1079,7 +1081,7 @@ describe('Tree Compacting', function() {
|
|||
// This ensures that every single block results in a different
|
||||
// tree and treeRoot without any auctions.
|
||||
if (open) {
|
||||
const name = rules.grindName(4, chain.height - 1, network);
|
||||
const name = rules.grindName(GNAME_SIZE, chain.height - 1, network);
|
||||
const tx = await wallet.sendOpen(name);
|
||||
job.pushTX(tx.toTX());
|
||||
job.refresh();
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ let alice, bob, aliceReceive, bobReceive;
|
|||
let aliceOriginalBalance, bobOriginalBalance, bobFee;
|
||||
|
||||
// These are data that will be communicated between Alice and Bob
|
||||
const name = rules.grindName(5, 1, network);
|
||||
const name = rules.grindName(10, 1, network);
|
||||
const nameHash = rules.hashName(name);
|
||||
const price = 1234567; // 1.234567 HNS
|
||||
let blob;
|
||||
|
|
|
|||
|
|
@ -848,7 +848,7 @@ describe('Mempool', function() {
|
|||
const addr = chaincoins.createReceive().getAddress();
|
||||
open.addOutput(addr, 90000);
|
||||
|
||||
const name = rules.grindName(5, 0, mempool.network);
|
||||
const name = rules.grindName(10, 0, mempool.network);
|
||||
const rawName = Buffer.from(name, 'ascii');
|
||||
const nameHash = rules.hashName(rawName);
|
||||
open.outputs[0].covenant.type = types.OPEN;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ const wclient = new WalletClient({
|
|||
|
||||
const {wdb} = node.require('walletdb');
|
||||
|
||||
const name = rules.grindName(5, 1, network);
|
||||
const name = rules.grindName(10, 1, network);
|
||||
let wallet, alice, bob, aliceReceive, bobReceive;
|
||||
|
||||
async function mineBlocks(n, addr) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ const rules = require('../lib/covenants/rules');
|
|||
const Address = require('../lib/primitives/address');
|
||||
|
||||
const network = Network.get('regtest');
|
||||
const NAME1 = rules.grindName(5, 2, network);
|
||||
const NAME1 = rules.grindName(10, 2, network);
|
||||
const {
|
||||
treeInterval,
|
||||
biddingPeriod,
|
||||
|
|
|
|||
|
|
@ -30,9 +30,10 @@ const wclient = new WalletClient({
|
|||
|
||||
const {wdb} = node.require('walletdb');
|
||||
|
||||
const name = rules.grindName(5, 1, network);
|
||||
const GNAME_SIZE = 10;
|
||||
const name = rules.grindName(GNAME_SIZE, 1, network);
|
||||
const nameHash = rules.hashName(name);
|
||||
const wrongName = rules.grindName(5, 1, network);
|
||||
const wrongName = rules.grindName(GNAME_SIZE, 1, network);
|
||||
const wrongNameHash = rules.hashName(wrongName);
|
||||
|
||||
let alice, bob, aliceReceive, bobReceive;
|
||||
|
|
@ -232,9 +233,9 @@ describe('Wallet Import Name', function() {
|
|||
});
|
||||
|
||||
describe('import multiple / overlapping names', function() {
|
||||
const name1 = rules.grindName(4, 1, network);
|
||||
const name2 = rules.grindName(5, 1, network);
|
||||
const name3 = rules.grindName(6, 1, network);
|
||||
const name1 = rules.grindName(GNAME_SIZE, 1, network);
|
||||
const name2 = rules.grindName(GNAME_SIZE, 1, network);
|
||||
const name3 = rules.grindName(GNAME_SIZE, 1, network);
|
||||
let startHeight;
|
||||
|
||||
it('should open and bid from Alice\'s wallet', async () => {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ const {
|
|||
transferLockup
|
||||
} = network.names;
|
||||
|
||||
const GNAME_SIZE = 10;
|
||||
|
||||
describe('Wallet rescan with namestate transitions', function() {
|
||||
describe('Only sends OPEN', function() {
|
||||
// Bob runs a full node with wallet plugin
|
||||
|
|
@ -49,7 +51,7 @@ describe('Wallet rescan with namestate transitions', function() {
|
|||
return node.chain.db.getNameStatus(nameHash, height, hardened);
|
||||
};
|
||||
|
||||
const NAME = rules.grindName(4, 4, network);
|
||||
const NAME = rules.grindName(GNAME_SIZE, 4, network);
|
||||
|
||||
// Hash of the FINALIZE transaction
|
||||
let aliceFinalizeHash;
|
||||
|
|
@ -303,7 +305,7 @@ describe('Wallet rescan with namestate transitions', function() {
|
|||
return node.chain.db.getNameStatus(nameHash, height, hardened);
|
||||
};
|
||||
|
||||
const NAME = rules.grindName(4, 4, network);
|
||||
const NAME = rules.grindName(GNAME_SIZE, 4, network);
|
||||
|
||||
// Block that confirmed the bids
|
||||
let bidBlockHash;
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ const wclient = new WalletClient({
|
|||
|
||||
const {wdb} = node.require('walletdb');
|
||||
|
||||
const GNAME_SIZE = 10;
|
||||
|
||||
describe('Wallet RPC Methods', function() {
|
||||
this.timeout(15000);
|
||||
|
||||
|
|
@ -364,8 +366,8 @@ describe('Wallet RPC Methods', function() {
|
|||
});
|
||||
|
||||
describe('signmessagewithname & verifymessagewithname', () => {
|
||||
const name = rules.grindName(5, 1, network);
|
||||
const nonWalletName = rules.grindName(5, 1, network);
|
||||
const name = rules.grindName(GNAME_SIZE, 1, network);
|
||||
const nonWalletName = rules.grindName(GNAME_SIZE, 1, network);
|
||||
const message = 'Decentralized naming and certificate authority';
|
||||
const invalidNames = ['', null, '\'null\'', 'localhost'];
|
||||
|
||||
|
|
@ -596,8 +598,8 @@ describe('Wallet RPC Methods', function() {
|
|||
});
|
||||
|
||||
it('should do an auction', async () => {
|
||||
const NAME1 = rules.grindName(5, 2, network);
|
||||
const NAME2 = rules.grindName(6, 3, network);
|
||||
const NAME1 = rules.grindName(GNAME_SIZE, 2, network);
|
||||
const NAME2 = rules.grindName(GNAME_SIZE, 3, network);
|
||||
const addr = await wclient.execute('getnewaddress', []);
|
||||
await nclient.execute('generatetoaddress', [10, addr]);
|
||||
await forValue(wdb, 'height', node.chain.height);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue