Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/v0.20-dev' into v0.20-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Jul 7, 2021
2 parents 382a7aa + 263c8f4 commit af04a59
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 73 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#DRIVE_BRANCH=update-dpp
#DAPI_BRANCH=update-dpp
#DASHMATE_BRANCH=update-dpp
#SDK_BRANCH=update-dpp
#DASHMATE_BRANCH=update-sdk
#SDK_BRANCH=
4 changes: 3 additions & 1 deletion lib/test/createClientWithFundedWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ async function createClientWithFundedWallet(HDPrivateKey = undefined) {

const faucetClient = createFaucetClient();

const walletOptions = {};
const walletOptions = {
waitForInstantLockTimeout: 120000,
};

if (HDPrivateKey) {
walletOptions.HDPrivateKey = HDPrivateKey;
Expand Down
123 changes: 62 additions & 61 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"dependencies": {
"@dashevo/dashcore-lib": "~0.19.25",
"@dashevo/dpns-contract": "github:dashevo/dpns-contract#update-dpp",
"@dashevo/dpp": "~0.20.0-dev.2",
"@dashevo/dpp": "~0.20.0-dev.3",
"@dashevo/grpc-common": "~0.3.4",
"@dashevo/wallet-lib": "~7.20.0-dev.2",
"@dashevo/wallet-lib": "~7.20.0-dev.4",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"dash": "~3.20.0-dev.2",
"dash": "~3.20.0-dev.4",
"dirty-chai": "^2.0.1",
"dotenv-safe": "^8.2.0",
"github-api": "^3.3.0",
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/wallet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('e2e', () => {
network: process.env.NETWORK,
wallet: {
mnemonic,
waitForInstantLockTimeout: 120000,
},
});
});
Expand Down Expand Up @@ -96,6 +97,7 @@ describe('e2e', () => {
restoredWallet = new Dash.Client({
wallet: {
mnemonic,
waitForInstantLockTimeout: 120000,
},
seeds: getDAPISeeds(),
network: process.env.NETWORK,
Expand Down
12 changes: 8 additions & 4 deletions test/functional/core/getTransaction.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const {
PrivateKey,
} = require('@dashevo/dashcore-lib');

const NotFoundError = require('@dashevo/dapi-client/lib/methods/errors/NotFoundError');

const createFaucetClient = require('../../../lib/test/createFaucetClient');
const wait = require('../../../lib/wait');

Expand All @@ -27,17 +29,19 @@ describe('Core', () => {
await faucetWalletAccount.broadcastTransaction(transaction);

const result = await faucetClient.getDAPIClient().core.getTransaction(transaction.id);
const receivedTx = new Transaction(Buffer.from(result));
const receivedTx = new Transaction(result.getTransaction());

expect(receivedTx.hash).to.deep.equal(transaction.id);
});

it('should respond with null if transaction was not found', async () => {
const nonExistentId = Buffer.alloc(32).toString('hex');

const result = await faucetClient.getDAPIClient().core.getTransaction(nonExistentId);

expect(result).to.equal(null);
try {
await faucetClient.getDAPIClient().core.getTransaction(nonExistentId);
} catch (e) {
expect(e).to.be.an.instanceOf(NotFoundError);
}
});
});
});
8 changes: 6 additions & 2 deletions test/functional/platform/Identity.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,13 @@ describe('Platform', () => {
});

it('should be able to get newly created identity by it\'s first public key', async () => {
const [serializedIdentity] = await client.getDAPIClient().platform
const response = await client.getDAPIClient().platform
.getIdentitiesByPublicKeyHashes(
[identity.getPublicKeyById(0).hash()],
);

const [serializedIdentity] = response.getIdentities();

expect(serializedIdentity).to.be.not.null();

const receivedIdentity = dpp.identity.createFromBuffer(
Expand All @@ -225,10 +227,12 @@ describe('Platform', () => {
});

it('should be able to get newly created identity id by it\'s first public key', async () => {
const [identityId] = await client.getDAPIClient().platform.getIdentityIdsByPublicKeyHashes(
const response = await client.getDAPIClient().platform.getIdentityIdsByPublicKeyHashes(
[identity.getPublicKeyById(0).hash()],
);

const [identityId] = response.getIdentityIds();

expect(identityId).to.be.not.null();
expect(identityId).to.deep.equal(identity.getId());
});
Expand Down

0 comments on commit af04a59

Please sign in to comment.