Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #317 from PureStake/develop
Browse files Browse the repository at this point in the history
Patch 1.6.7
  • Loading branch information
PureBrent authored Oct 15, 2021
2 parents 87c88e8 + eb3c945 commit b3c29da
Show file tree
Hide file tree
Showing 14 changed files with 122 additions and 95 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Added ability to use a Ledger device to add public addresses into AlgoSigner and
- Fix for rare infinite loop locking extension sign page
- Fix for display of estimated fee for Ledger device sign

### 1.6.7 Patch
- Update to SDK v1.12.0
- Update to Webpack 5

## New Users

- Watch [Getting Started with AlgoSigner](https://youtu.be/tG-xzG8r770)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algosigner",
"version": "1.6.6",
"version": "1.6.7",
"author": "https://developer.purestake.io",
"description": "Sign Algorand transactions in your browser with PureStake.",
"repository": "https://github.com/PureStake/algosigner",
Expand Down
6 changes: 3 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algosigner/common",
"version": "1.6.6",
"version": "1.6.7",
"author": "https://developer.purestake.io",
"description": "Common library functions for AlgoSigner.",
"repository": "https://github.com/PureStake/algosigner",
Expand All @@ -10,8 +10,8 @@
"jest": "27.0.0",
"jest-webextension-mock": "^3.6.1",
"ts-jest": "^27.0.0",
"ts-loader": "^8.0.3",
"typescript": "^3.7.5"
"ts-loader": "^9.2.6",
"typescript": "^4.4.4"
},
"scripts": {
"build": "npm run clean && tsc",
Expand Down
10 changes: 5 additions & 5 deletions packages/crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algosigner-crypto",
"version": "1.6.6",
"version": "1.6.7",
"author": "https://developer.purestake.io",
"description": "Cryptographic wrapper for saving and retrieving extention information in Algosigner.",
"repository": {
Expand All @@ -12,10 +12,10 @@
"@types/jest": "^27.0.0",
"jest": "27.0.0",
"ts-jest": "^27.0.0",
"ts-loader": "^7.0.5",
"typescript": "^3.9.7",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.11"
"ts-loader": "^9.2.6",
"typescript": "^4.4.4",
"webpack": "^5.58.2",
"webpack-cli": "^4.9.0"
},
"scripts": {
"build": "npm run clean && webpack",
Expand Down
10 changes: 5 additions & 5 deletions packages/dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algosigner/dapp",
"version": "1.6.6",
"version": "1.6.7",
"author": "https://developer.purestake.io",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
Expand All @@ -14,9 +14,9 @@
"@types/jest": "^27.0.0",
"jest": "27.0.0",
"ts-jest": "^27.0.0",
"ts-loader": "^7.0.5",
"typescript": "^3.9.7",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.11"
"ts-loader": "^9.2.6",
"typescript": "^4.4.4",
"webpack": "^5.58.2",
"webpack-cli": "^4.9.0"
}
}
2 changes: 1 addition & 1 deletion packages/extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "AlgoSigner",
"author": "https://developer.purestake.io",
"version": "1.6.6",
"version": "1.6.7",
"description": "Algorand Wallet Extension | Send & Receive ALGOs | Sign dApp Transactions",
"icons": {
"48": "icon.png"
Expand Down
13 changes: 7 additions & 6 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "algosigner-extension",
"version": "1.6.6",
"version": "1.6.7",
"author": "https://developer.purestake.io",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
Expand All @@ -14,13 +14,14 @@
"jest": "27.0.0",
"jest-webextension-mock": "^3.6.1",
"ts-jest": "^27.0.0",
"ts-loader": "^7.0.5",
"typescript": "^4.3.2",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.11"
"ts-loader": "^9.2.6",
"typescript": "^4.4.4",
"webpack": "^5.58.2",
"webpack-cli": "^4.9.0"
},
"dependencies": {
"algosdk": "1.11.1"
"algosdk": "1.12.0",
"buffer": "^6.0.3"
},
"scripts": {
"build": "npm run clean && npm run bundle && npm run copy",
Expand Down
83 changes: 47 additions & 36 deletions packages/extension/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,56 @@
var path = require('path');
const webpack = require('webpack');

function srcPath(subdir) {
return path.join(__dirname, "./", subdir);
return path.join(__dirname, './', subdir);
}

module.exports = {
// Change to your "entry-point".
mode: 'production',
optimization: {
// We no not want to minimize our code.
minimize: false
},
entry: {
background: './src/background/index.ts',
content: './src/content/content.ts'
// Change to your "entry-point".
mode: 'production',
optimization: {
// We no not want to minimize our code.
minimize: false,
},
entry: {
background: './src/background/index.ts',
content: './src/content/content.ts',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
},
plugins: [
// Generate a base html file and injects all generated css and js files
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
resolve: {
alias: {
'@algosigner/common': srcPath('../common/src'),
'@algosigner/crypto': srcPath('../crypto'),
'@algosigner/storage': srcPath('../storage'),
'@algosigner/ui': srcPath('../ui'),
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
extensions: ['.ts', '.tsx', '.js', '.json'],
fallback: {
buffer: require.resolve('buffer'),
crypto: false,
},
resolve: {
alias: {
'@algosigner/common': srcPath('../common/src'),
'@algosigner/crypto': srcPath('../crypto'),
'@algosigner/storage': srcPath('../storage'),
'@algosigner/ui': srcPath('../ui')
},
extensions: ['.ts', '.tsx', '.js', '.json']
},
module: {
rules: [
{
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader",
options: {}
}
]
}
]
}
},
module: {
rules: [
{
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
options: {},
},
],
},
],
},
};
11 changes: 5 additions & 6 deletions packages/storage/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "algosigner-storage",
"version": "1.6.6",
"version": "1.6.7",
"author": "https://developer.purestake.io",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
"description": "Storage wrapper for saving and retrieving extention information in Algosigner.",
"devDependencies": {
"ts-loader": "^7.0.5",
"typescript": "^3.9.7",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.11"
"ts-loader": "^9.2.6",
"typescript": "^4.4.4",
"webpack": "^5.58.2",
"webpack-cli": "^4.9.0"
},
"dependencies": {},
"scripts": {
"build": "npm run clean && webpack",
"clean": "rm -rf ./dist/"
Expand Down
4 changes: 2 additions & 2 deletions packages/test-project/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "algorand-test-project",
"version": "1.6.6",
"version": "1.6.7",
"repository": "https://github.com/PureStake/algosigner",
"license": "MIT",
"description": "Repository for tests",
"devDependencies": {
"algosdk": "1.11.1",
"algosdk": "1.12.0",
"jest": "27.0.0",
"jest-runner-groups": "^2.0.1",
"puppeteer": "^5.5.0",
Expand Down
19 changes: 10 additions & 9 deletions packages/test-project/tests/common/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { wallet, extension } = require('./constants');
const { openAccountDetails, goBack, closeModal, inputPassword, getPopup } = require('./helpers');

// Common Tests
async function WelcomePage() {
function WelcomePage() {
test('Welcome Page Title', async () => {
await expect(extensionPage.title()).resolves.toMatch(extension.name);
});
Expand All @@ -17,15 +17,15 @@ async function WelcomePage() {
});
}

async function SetPassword() {
function SetPassword() {
test('Set new Wallet Password', async () => {
await extensionPage.type('#setPassword', wallet.password);
await extensionPage.type('#confirmPassword', wallet.password);
await extensionPage.click('#createWallet');
});
}

async function SelectTestNetLedger() {
function SelectTestNetLedger() {
test('Switch Ledger', async () => {
await extensionPage.waitForSelector('#selectLedger');
await extensionPage.click('#selectLedger');
Expand All @@ -34,13 +34,13 @@ async function SelectTestNetLedger() {
});
}

async function CreateWallet() {
function CreateWallet() {
WelcomePage();
SetPassword();
SelectTestNetLedger();
}

async function ImportAccount(account) {
function ImportAccount(account) {
test(`Import Account ${account.name}`, async () => {
await extensionPage.waitForSelector('#addAccount');
await extensionPage.click('#addAccount');
Expand All @@ -51,12 +51,13 @@ async function ImportAccount(account) {
await extensionPage.type('#enterMnemonic', account.mnemonic);
await extensionPage.click('#nextStep');
await inputPassword();
await extensionPage.waitForTimeout(2000);
});

await VerifyAccount(account);
VerifyAccount(account);
}

async function VerifyAccount(account) {
function VerifyAccount(account) {
test(`Verify Account Info (${account.name})`, async () => {
await openAccountDetails(account);
await expect(extensionPage.$eval('#accountAddress', (e) => e.innerText)).resolves.toBe(
Expand All @@ -67,7 +68,7 @@ async function VerifyAccount(account) {
});
}

async function DeleteAccount(account) {
function DeleteAccount(account) {
test(`Delete Account (${account.name})`, async () => {
await openAccountDetails(account);
await extensionPage.click('#deleteAccount');
Expand All @@ -84,7 +85,7 @@ async function DeleteAccount(account) {
}

// Dapp Tests
async function ConnectAlgoSigner() {
function ConnectAlgoSigner() {
test('Expose Authorize Functions', async () => {
async function authorizeDapp() {
const popup = await getPopup();
Expand Down
16 changes: 9 additions & 7 deletions packages/test-project/tests/ui-networks-e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ const { openExtension, inputPassword } = require('./common/helpers');
const { CreateWallet, ImportAccount } = require('./common/tests');

const openNetworkMenu = async () => {
await extensionPage.waitForTimeout(500);
await extensionPage.waitForTimeout(1000);
await extensionPage.waitForSelector('#options-menu');
await extensionPage.click('#options-menu');
await extensionPage.waitForSelector('#showNetworkConfiguration');
await extensionPage.click('#showNetworkConfiguration');
await extensionPage.waitForTimeout(500);
}
await extensionPage.waitForTimeout(1000);
};

jest.setTimeout(20000);

Expand All @@ -37,7 +37,7 @@ describe('Create and Test Custom Networks', () => {
};

const e2eNetSelector = `button#select${NetworkConfig.name}`;
const otherNet = 'OtherNet'
const otherNet = 'OtherNet';
const otherNetSelector = `button#select${otherNet}`;

test('Add Custom TestNet and test it', async () => {
Expand All @@ -63,6 +63,7 @@ describe('Create and Test Custom Networks', () => {

// Fill correct network config
await extensionPage.evaluate(() => (document.getElementById('networkAlgodUrl').value = ''));
await extensionPage.waitForTimeout(1000);
await extensionPage.type('#networkAlgodUrl', NetworkConfig.algod);

// Test connection succesful
Expand All @@ -71,17 +72,18 @@ describe('Create and Test Custom Networks', () => {
await expect(extensionPage.select('#networkError')).rejects.toThrow();

// // Save Network
await extensionPage.waitForTimeout(2000);
await extensionPage.waitForTimeout(1000);
await extensionPage.click('#saveNetwork:not(disabled)');
});

ImportAccount(accounts.ui);

test('Test Modifying Network', async () => {
await openNetworkMenu();

// Change Network name
await extensionPage.click(`button#select${NetworkConfig.name}`);
await extensionPage.waitForSelector(e2eNetSelector);
await extensionPage.click(e2eNetSelector);
await extensionPage.waitForSelector('#networkName');
await extensionPage.evaluate(() => (document.getElementById('networkName').value = ''));
await extensionPage.type('#networkName', otherNet);
Expand Down
Loading

0 comments on commit b3c29da

Please sign in to comment.