Skip to content

Commit

Permalink
Merge PR #742 from 'nodech/update-ci'
Browse files Browse the repository at this point in the history
  • Loading branch information
nodech committed Jun 21, 2022
2 parents 7822f57 + f283bf2 commit 7c00f01
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 38 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/anyone-can-renew-test.js
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions test/auction-reorg-test.js
Expand Up @@ -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`.
Expand Down
4 changes: 3 additions & 1 deletion test/auction-rpc-test.js
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions test/auction-test.js
Expand Up @@ -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`.
Expand Down
12 changes: 7 additions & 5 deletions test/chain-checkpoints-test.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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 () => {
Expand Down
6 changes: 4 additions & 2 deletions test/chain-tree-compaction-test.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion test/interactive-swap-test.js
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/mempool-test.js
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/wallet-accounts-auction-test.js
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/wallet-auction-test.js
Expand Up @@ -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,
Expand Down
11 changes: 6 additions & 5 deletions test/wallet-importname-test.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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 () => {
Expand Down
6 changes: 4 additions & 2 deletions test/wallet-rescan-test.js
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 6 additions & 4 deletions test/wallet-rpc-test.js
Expand Up @@ -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);

Expand Down Expand Up @@ -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'];

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7c00f01

Please sign in to comment.