This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from PureStake/develop
Candidate Release 1.0
- Loading branch information
Showing
79 changed files
with
1,810 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Release build | ||
on: | ||
create: | ||
tags: | ||
- v0.9-* | ||
- v1.* | ||
- v2.* | ||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
env: | ||
CI: 'true' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12.15' | ||
- name: Delete all dist | ||
run: npm run clean | ||
- name: Install testing dependencies | ||
env: | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true' | ||
run: npm install | ||
- name: Build | ||
id: build_dist | ||
run: npm run build | ||
- name: Run tests including puppeteer | ||
uses: djp3/puppeteer-headful@master | ||
with: | ||
args: npm test | ||
- name: Zip up release | ||
id: zip_up | ||
run: zip -r AlgoSigner.zip ./dist/* | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./AlgoSigner.zip | ||
asset_name: AlgoSigner.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
**/@types | ||
**/packages/dapp/lib | ||
.DS_Store | ||
test*.png | ||
test*.png | ||
**/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
* | ||
* Copyright (C) PureStake, Inc - All Rights Reserved | ||
* Unauthorized copying of any contents of this repository, via any medium is strictly prohibited | ||
* Proprietary and confidential | ||
* Written by PureStake Development <[email protected]>, 2020 | ||
* | ||
Copyright 2020 PureStake LTD | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
"roots": [ | ||
"<rootDir>/src" | ||
], | ||
"testMatch": [ | ||
"**/__tests__/**/*.+(ts|tsx|js)", | ||
"**/?(*.)+(spec|test).+(ts|tsx|js)" | ||
], | ||
"transform": { | ||
"^.+\\.(ts|tsx)$": "ts-jest" | ||
}, | ||
setupFiles: [ | ||
"jest-webextension-mock" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
{ | ||
"name": "@algosigner/common", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"author": "https://developer.purestake.io", | ||
"description": "Common library functions for AlgoSigner.", | ||
"devDependencies": { | ||
"typescript": "^3.7.5" | ||
"typescript": "^3.7.5", | ||
"@types/jest": "^26.0.10", | ||
"jest": "^26.4.1", | ||
"jest-webextension-mock": "^3.6.1", | ||
"ts-jest": "^26.2.0", | ||
"ts-loader": "^8.0.2" | ||
}, | ||
"dependencies": {}, | ||
"scripts": { | ||
"build": "npm run clean && tsc", | ||
"clean": "rm -rf ./dist/" | ||
"clean": "rm -rf ./dist/", | ||
"test": "jest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { extensionBrowser } from './chrome'; | ||
import { logging } from './logging'; | ||
import { isFromExtension } from './utils'; | ||
import { RequestErrors,Transaction,TAccount,Note,Amount } from './types'; | ||
|
||
|
||
test('Test chrome reference', () => { | ||
//@ts-ignore | ||
expect(extensionBrowser).toBe(chrome); | ||
}); | ||
|
||
test('Logging test', () => { | ||
expect(typeof logging.log).toBe("function"); | ||
}); | ||
|
||
test('Test extension parts', () => { | ||
extensionBrowser.runtime.id = '12345'; | ||
expect(isFromExtension('chrome-extension://12345')).toBe(true); | ||
}); | ||
|
||
test('Type - RequestErrors undefined test', () => { | ||
expect(RequestErrors.Undefined).toBe('[RequestErrors.Undefined] An undefined error occurred.'); | ||
}); | ||
|
||
test('Type - Transaction', () => { | ||
expect({amount: 1, from:"AAA", to:"BBB"} as Transaction).toBeInstanceOf(Object); | ||
}); | ||
|
||
test('Type - TAccount', () => { | ||
expect('string' as TAccount).toBe('string'); | ||
}); | ||
|
||
test('Type - Note', () => { | ||
expect('string' as Note).toBe('string'); | ||
}); | ||
|
||
test('Type - Amount', () => { | ||
expect(12345 as Amount).toBe(12345); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { extensionBrowser } from './chrome'; | ||
|
||
export function isFromExtension(origin) { | ||
const s = origin.split('://'); | ||
return s[0] === "chrome-extension" && s[1] === extensionBrowser.runtime.id; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
"roots": [ | ||
"<rootDir>/src" | ||
], | ||
"testMatch": [ | ||
"**/__tests__/**/*.+(ts|tsx|js)", | ||
"**/?(*.)+(spec|test).+(ts|tsx|js)" | ||
], | ||
"transform": { | ||
"^.+\\.(ts|tsx)$": "ts-jest" | ||
}, | ||
} |
Oops, something went wrong.