Skip to content

Commit

Permalink
Merge pull request #2237 from blockstack/next
Browse files Browse the repository at this point in the history
Release Xenon
  • Loading branch information
lgalabru authored Dec 30, 2020
2 parents 2595ba1 + 8f662ef commit 4054d04
Show file tree
Hide file tree
Showing 67 changed files with 2,337 additions and 1,054 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ features = ["std"]
[dev-dependencies]
assert-json-diff = "1.0.0"
criterion = "0.3"
stx_genesis = { package = "stx-genesis", path = "./stx-genesis/."}

[features]
default = ["developer-mode"]
Expand Down
1 change: 1 addition & 0 deletions bns-test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
},
},
moduleFileExtensions: ['js', 'ts', 'd.ts'],
testTimeout: 2000000
// setupFiles: ['./tests/global-setup.ts'],
// setupFilesAfterEnv: ['./tests/setup.ts'],
};
2 changes: 1 addition & 1 deletion bns-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint": "tslint -p tsconfig.json 'src/**/*.ts' 'test/**/*.ts'",
"lint-fix": "tslint --fix -p tsconfig.json 'src/**/*.ts' 'test/**/*.ts'",
"test": "jest",
"test:watch": "jest --watch --coverage=false --runInBand"
"test:watch": "jest --watch --coverage=false"
},
"engines": {
"node": ">=10"
Expand Down
18 changes: 9 additions & 9 deletions bns-test/src/bns-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class BNSClient extends Client {
}

// (name-import (namespace (buff 20))
// (name (buff 16))
// (name (buff 48))
// (zonefile-hash (buff 20)))
async nameImport(namespace: string,
name: string,
Expand Down Expand Up @@ -168,7 +168,7 @@ export class BNSClient extends Client {
}

// (name-register (namespace (buff 20))
// (name (buff 16))
// (name (buff 48))
// (salt (buff 20))
// (zonefile-hash (buff 20)))
async nameRegister(namespace: string,
Expand All @@ -190,7 +190,7 @@ export class BNSClient extends Client {
}

// (name-update (namespace (buff 20))
// (name (buff 16))
// (name (buff 48))
// (zonefile-hash (buff 20)))
async nameUpdate(namespace: string,
name: string,
Expand All @@ -210,7 +210,7 @@ export class BNSClient extends Client {
}

// (name-transfer (namespace (buff 20))
// (name (buff 16))
// (name (buff 48))
// (new-owner principal)
// (zonefile-hash (optional (buff 20))))
async nameTransfer(namespace: string,
Expand All @@ -235,7 +235,7 @@ export class BNSClient extends Client {
}

// (name-revoke (namespace (buff 20))
// (name (buff 16)))
// (name (buff 48)))
async nameRevoke(namespace: string,
name: string,
params: {
Expand All @@ -253,7 +253,7 @@ export class BNSClient extends Client {
}

// (name-renewal (namespace (buff 20))
// (name (buff 16))
// (name (buff 48))
// (stx-to-burn uint)
// (new-owner (optional principal))
// (zonefile-hash (optional (buff 20))))
Expand Down Expand Up @@ -281,7 +281,7 @@ export class BNSClient extends Client {
}

// (get-name-zonefile (namespace (buff 20))
// (name (buff 16)))
// (name (buff 48)))
async getNameZonefile(namespace: string,
name: string,
params: {
Expand All @@ -299,7 +299,7 @@ export class BNSClient extends Client {
}

// (can-name-be-registered (namespace (buff 20))
// (name (buff 16))
// (name (buff 48))
async canNameBeRegistered(namespace: string,
name: string): Promise<Receipt> {
const args = [`0x${this.toHexString(namespace)}`, `0x${this.toHexString(name)}`];
Expand All @@ -315,7 +315,7 @@ export class BNSClient extends Client {
}

// (get-name-price (namespace (buff 20))
// (name (buff 16))
// (name (buff 48))
async getNamePrice(namespace: string,
name: string): Promise<Receipt> {
const args = [`0x${this.toHexString(namespace)}`, `0x${this.toHexString(name)}`];
Expand Down
8 changes: 4 additions & 4 deletions bns-test/test/name_import.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe("BNS Test Suite - NAME_IMPORT", () => {
sender: cases[0].namespaceOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('Returned: u12');
expect(receipt.result).include('Returned: u146');

receipt = await bns.namespaceReveal(
cases[0].namespace,
Expand Down Expand Up @@ -222,7 +222,7 @@ describe("BNS Test Suite - NAME_IMPORT", () => {
expect(receipt.success).eq(true);


// Charlie trying to register 'alpha.blockstack' should fail
// Charlie trying to register 'alpha.blockstack' should succeed
receipt = await bns.namePreorder(
cases[0].namespace,
"alpha",
Expand All @@ -231,7 +231,7 @@ describe("BNS Test Suite - NAME_IMPORT", () => {
sender: charlie
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u29');
expect(receipt.result).include('u163');

receipt = await bns.nameRegister(
cases[0].namespace,
Expand Down Expand Up @@ -280,7 +280,7 @@ describe("BNS Test Suite - NAME_IMPORT", () => {
expect(receipt.success).eq(false);

// Resolving an imported name should fail after expiration
await bns.mineBlocks(100);
await bns.mineBlocks(5100);

receipt = await bns.getNameZonefile(
cases[0].namespace,
Expand Down
8 changes: 4 additions & 4 deletions bns-test/test/name_preorder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe("BNS Test Suite - NAME_PREORDER", () => {
sender: cases[0].nameOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u33');
expect(receipt.result).include('u167');

// should fail if the same order is being re-submitted by Bob
receipt = await bns.namePreorder(
Expand All @@ -142,11 +142,11 @@ describe("BNS Test Suite - NAME_PREORDER", () => {
sender: alice
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u35');
expect(receipt.result).include('u169');


// should succeed once claimability TTL expired
await mineBlocks(bns, 10);
await mineBlocks(bns, 154);
receipt = await bns.namePreorder(
cases[0].namespace,
"bob",
Expand All @@ -155,7 +155,7 @@ describe("BNS Test Suite - NAME_PREORDER", () => {
sender: cases[0].nameOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u46');
expect(receipt.result).include('u324');
});
});
});
3 changes: 1 addition & 2 deletions bns-test/test/name_prices.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,13 @@ import {
await bns.deployContract();
});


it("Testing name prices", async () => {
// Given a launched namespace 'blockstack', owned by Alice
var receipt = await bns.namespacePreorder(cases[0].namespace, cases[0].salt, cases[0].value, {
sender: cases[0].namespaceOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u12');
expect(receipt.result).include('u146');

receipt = await bns.namespaceReveal(
cases[0].namespace,
Expand Down
22 changes: 11 additions & 11 deletions bns-test/test/name_register.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
sender: cases[1].namespaceOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u33');
expect(receipt.result).include('u167');

receipt = await bns.namespaceReveal(
cases[1].namespace,
Expand All @@ -132,7 +132,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
100, {
sender: bob
});
expect(receipt.result).include('u35');
expect(receipt.result).include('u169');
expect(receipt.success).eq(true);

receipt = await bns.nameRegister(
Expand All @@ -152,7 +152,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
sender: cases[0].namespaceOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u37');
expect(receipt.result).include('u171');

receipt = await bns.namespaceReveal(
cases[0].namespace,
Expand Down Expand Up @@ -194,7 +194,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
sender: bob
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u42');
expect(receipt.result).include('u176');

// should fail
receipt = await bns.nameRegister(
Expand All @@ -216,7 +216,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
sender: cases[0].nameOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u44');
expect(receipt.result).include('u178');

// Bob registering the name 'Bob.blockstack' should fail
receipt = await bns.nameRegister(
Expand All @@ -238,7 +238,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
sender: cases[0].nameOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u46');
expect(receipt.result).include('u180');

// Bob registering the name 'bob.blockstack'
// should succeed
Expand Down Expand Up @@ -282,7 +282,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
sender: charlie
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u50');
expect(receipt.result).include('u184');

receipt = await bns.nameRegister(
cases[0].namespace,
Expand All @@ -309,7 +309,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
sender: cases[0].nameOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u53');
expect(receipt.result).include('u187');

receipt = await bns.nameRegister(
cases[0].namespace,
Expand All @@ -323,7 +323,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {


// should succeed once 'bob.blockstack' is expired
await mineBlocks(bns, cases[0].renewalRule);
await mineBlocks(bns, cases[0].renewalRule + 5000);

receipt = await bns.namePreorder(
cases[0].namespace,
Expand All @@ -333,7 +333,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
sender: cases[0].nameOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u65');
expect(receipt.result).include('u5199');

receipt = await bns.getNameZonefile(
cases[0].namespace,
Expand Down Expand Up @@ -370,7 +370,7 @@ describe("BNS Test Suite - NAME_REGISTER", () => {
sender: charlie
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u69');
expect(receipt.result).include('u5203');

receipt = await bns.nameRegister(
cases[0].namespace,
Expand Down
4 changes: 2 additions & 2 deletions bns-test/test/name_renewal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ describe("BNS Test Suite - NAME_RENEWAL", () => {

// When Bob is renewing 'bob.blockstack' at block #56 (expired)
// should fail renewing
await mineBlocks(bns, 16);
await mineBlocks(bns, 16 + 5000);

receipt = await bns.getNameZonefile(
cases[0].namespace,
Expand Down Expand Up @@ -307,7 +307,7 @@ describe("BNS Test Suite - NAME_RENEWAL", () => {
sender: dave
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u56');
expect(receipt.result).include('u5190');
block_height += 1;

receipt = await bns.nameRegister(
Expand Down
6 changes: 3 additions & 3 deletions bns-test/test/name_revoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe("BNS Test Suite - NAME_REVOKE", () => {
sender: bob
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u24');
expect(receipt.result).include('u158');

receipt = await bns.nameRegister(
cases[0].namespace,
Expand Down Expand Up @@ -267,7 +267,7 @@ describe("BNS Test Suite - NAME_REVOKE", () => {
sender: bob
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u28');
expect(receipt.result).include('u162');

receipt = await bns.nameRegister(
cases[0].namespace,
Expand Down Expand Up @@ -326,7 +326,7 @@ describe("BNS Test Suite - NAME_REVOKE", () => {
sender: alice
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u34');
expect(receipt.result).include('u168');

receipt = await bns.nameRegister(
cases[0].namespace,
Expand Down
8 changes: 4 additions & 4 deletions bns-test/test/name_transfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe("BNS Test Suite - NAME_TRANSFER", () => {
sender: cases[0].nameOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u16');
expect(receipt.result).include('u150');
block_height += 1;

receipt = await bns.nameRegister(
Expand All @@ -164,7 +164,7 @@ describe("BNS Test Suite - NAME_TRANSFER", () => {
sender: charlie
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u18');
expect(receipt.result).include('u152');
block_height += 1;

receipt = await bns.nameRegister(
Expand Down Expand Up @@ -280,7 +280,7 @@ describe("BNS Test Suite - NAME_TRANSFER", () => {
"charlie", {
sender: cases[0].nameOwner
});
expect(receipt.result).include('0x00');
expect(receipt.result).include('(zonefile-hash 0x)');
expect(receipt.success).eq(true);

// Bob should not be able to update 'charlie.blockstack'
Expand Down Expand Up @@ -321,7 +321,7 @@ describe("BNS Test Suite - NAME_TRANSFER", () => {
"bob", {
sender: cases[0].nameOwner
});
expect(receipt.result).include('0x00');
expect(receipt.result).include('(zonefile-hash 0x))');
expect(receipt.success).eq(true);

// Bob should be able to update its zonefile
Expand Down
2 changes: 1 addition & 1 deletion bns-test/test/name_update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe("BNS Test Suite - NAME_UPDATE", () => {
sender: cases[0].nameOwner
});
expect(receipt.success).eq(true);
expect(receipt.result).include('u20');
expect(receipt.result).include('u154');

receipt = await bns.nameRegister(
cases[0].namespace,
Expand Down
Loading

0 comments on commit 4054d04

Please sign in to comment.