Skip to content

Commit

Permalink
test: OPEN outputs no longer inserted as coins into txdb
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Aug 14, 2020
1 parent 4075ae8 commit 8edaea6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
15 changes: 4 additions & 11 deletions test/wallet-importname-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,8 @@ describe('Wallet Import Name', function() {
assert(ns4 === null);
});

it('should not re-import an existing name', async () => {
await assert.rejects(
alice.importName(name),
{message: 'Name already exists.'}
);
it('should ignore re-importing existing name', async () => {
await alice.importName(name);
});

it('should bid on names from Alice\'s wallet', async () => {
Expand Down Expand Up @@ -223,13 +220,9 @@ describe('Wallet Import Name', function() {
assert(!bid.own);
});

it('should not re-import name', async () => {
it('should ignore re-importing name', async () => {
await wclient.execute('selectwallet', ['charlie']);

await assert.rejects(
wclient.execute('importname', [name, 0]),
{message: 'Name already exists.'}
);
await wclient.execute('importname', [name, 0]);
});
});
});
22 changes: 11 additions & 11 deletions test/wallet-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ describe('Wallet', function() {
// Check
let bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 2);
assert.strictEqual(bal.coin, 2);
assert.strictEqual(bal.coin, 1); // OPENs are sent to a null address
assert.strictEqual(bal.confirmed, 10e6);
assert.strictEqual(bal.unconfirmed, 10e6 - fee);
assert.strictEqual(bal.ulocked, 0);
Expand All @@ -1979,7 +1979,7 @@ describe('Wallet', function() {
// Check
bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 2);
assert.strictEqual(bal.coin, 2);
assert.strictEqual(bal.coin, 1);
assert.strictEqual(bal.confirmed, 10e6 - (1 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (1 * fee));
assert.strictEqual(bal.ulocked, 0);
Expand All @@ -1995,7 +1995,7 @@ describe('Wallet', function() {
// Check
let bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 3);
assert.strictEqual(bal.coin, 3);
assert.strictEqual(bal.coin, 2);
assert.strictEqual(bal.confirmed, 10e6 - (1 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (2 * fee));
assert.strictEqual(bal.ulocked, lockup);
Expand All @@ -2012,7 +2012,7 @@ describe('Wallet', function() {
// Check
bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 3);
assert.strictEqual(bal.coin, 3);
assert.strictEqual(bal.coin, 2);
assert.strictEqual(bal.confirmed, 10e6 - (2 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (2 * fee));
assert.strictEqual(bal.ulocked, lockup);
Expand All @@ -2028,7 +2028,7 @@ describe('Wallet', function() {
// Check
let bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 4);
assert.strictEqual(bal.coin, 4);
assert.strictEqual(bal.coin, 3);
assert.strictEqual(bal.confirmed, 10e6 - (2 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (3 * fee));
assert.strictEqual(bal.ulocked, value);
Expand All @@ -2045,7 +2045,7 @@ describe('Wallet', function() {
// Check
bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 4);
assert.strictEqual(bal.coin, 4);
assert.strictEqual(bal.coin, 3);
assert.strictEqual(bal.confirmed, 10e6 - (3 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (3 * fee));
assert.strictEqual(bal.ulocked, value);
Expand Down Expand Up @@ -2126,7 +2126,7 @@ describe('Wallet', function() {
// Check
bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 2);
assert.strictEqual(bal.coin, 2);
assert.strictEqual(bal.coin, 1);
assert.strictEqual(bal.confirmed, 10e6 - (1 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (1 * fee));
assert.strictEqual(bal.ulocked, 0);
Expand All @@ -2142,7 +2142,7 @@ describe('Wallet', function() {
// Check
let bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 2);
assert.strictEqual(bal.coin, 2);
assert.strictEqual(bal.coin, 1);
assert.strictEqual(bal.confirmed, 10e6 - (1 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (1 * fee));
assert.strictEqual(bal.ulocked, 0);
Expand All @@ -2159,7 +2159,7 @@ describe('Wallet', function() {
// Check
bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 3);
assert.strictEqual(bal.coin, 3);
assert.strictEqual(bal.coin, 2);
assert.strictEqual(bal.confirmed, 10e6 - (2 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (2 * fee));
assert.strictEqual(bal.ulocked, lockup);
Expand All @@ -2175,7 +2175,7 @@ describe('Wallet', function() {
// Check
let bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 3);
assert.strictEqual(bal.coin, 3);
assert.strictEqual(bal.coin, 2);
assert.strictEqual(bal.confirmed, 10e6 - (2 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (2 * fee));
assert.strictEqual(bal.ulocked, lockup);
Expand All @@ -2192,7 +2192,7 @@ describe('Wallet', function() {
// Check
bal = await wallet.getBalance();
assert.strictEqual(bal.tx, 4);
assert.strictEqual(bal.coin, 4);
assert.strictEqual(bal.coin, 3);
assert.strictEqual(bal.confirmed, 10e6 - (3 * fee));
assert.strictEqual(bal.unconfirmed, 10e6 - (3 * fee));
assert.strictEqual(bal.ulocked, value);
Expand Down

0 comments on commit 8edaea6

Please sign in to comment.