Skip to content

Commit

Permalink
Merge pull request #157 from aeternity/release/0.0.15
Browse files Browse the repository at this point in the history
Release - 0.0.15
  • Loading branch information
mradkov authored Apr 10, 2020
2 parents 380a40c + 3a934ea commit 8932cc8
Show file tree
Hide file tree
Showing 122 changed files with 3,270 additions and 1,394 deletions.
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"singleQuote": true,
"printWidth": 180,
"trailingComma": "es5"
"printWidth": 100,
"trailingComma": "all"
}
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ cache:
npm: true
directories:
- ~/.cache

script:
- npm run lint -- --no-fix
- npm test
- npm run build

before_deploy: scripts/before-deploy.sh
Expand All @@ -33,3 +34,8 @@ deploy:
target_branch: master
on:
branch: develop
- provider: script
skip_cleanup: true
script: scripts/deploy-stage.sh
on:
all_branches: true
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.superhero.cordova" version="0.0.14" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.superhero.cordova" version="0.0.15" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>SuperHero</name>
<description>SuperHero wallet</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Expand Down
41 changes: 30 additions & 11 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superhero-wallet",
"version": "0.0.14",
"version": "0.0.15",
"description": "Superhero wallet",
"author": "SuperHero",
"license": "MIT",
Expand Down Expand Up @@ -64,6 +64,7 @@
"extensionizer": "^1.0.1",
"file-saver": "^2.0.2",
"ionic-plugin-deeplinks": "github:aeternity/ionic-plugin-deeplinks",
"jdenticon": "^2.2.0",
"lodash-es": "^4.17.15",
"node-fetch": "^2.6.0",
"nyc": "^14.1.1",
Expand Down
20 changes: 20 additions & 0 deletions scripts/deploy-stage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e

APP_NAME=wallet

echo "${DEPLOY_KNOWN_HOSTS_BASE64}" | base64 --decode >> ~/.ssh/known_hosts
echo "${DEPLOY_USER_KEY_BASE64}" | base64 --decode > /tmp/user-key
eval "$(ssh-agent -s)"
chmod 600 /tmp/user-key
ssh-add /tmp/user-key

DOMAIN=`echo $TRAVIS_BRANCH | tr '[:punct:]' '-'`

rsync -e "ssh -p 2022" -r -v dist/web/root/* root@z52da5wt.xyz:/data/$APP_NAME/$DOMAIN

URL=$DOMAIN.$APP_NAME.z52da5wt.xyz
echo "Deployed to $URL"
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST \
-d "{\"body\": \"Deployed to [$URL](https://$URL)\"}" \
"https://api.github.com/repos/${TRAVIS_REPO_SLUG}/commits/${TRAVIS_COMMIT}/comments"
4 changes: 2 additions & 2 deletions serve.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"public": "dist/web/root"
}
"public": "dist"
}
40 changes: 33 additions & 7 deletions src/aepp/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
<p data-cy="wallet-name">{{ wallet.name }}</p>
<button data-cy="wallet-sign-msg" @click="sign">Sign Msg</button>
<button data-cy="contract-call" @click="contractCall('statefull')">Contract Call</button>
<button data-cy="contract-call-static" @click="contractCall('static')">Contract Call Static</button>
<button data-cy="contract-call-static" @click="contractCall('static')">
Contract Call Static
</button>
<button data-cy="send" @click="spend">Spend</button>
<p data-cy="message-valid" v-if="message.valid">{{ message.sig }}</p>
<p data-cy="contract-call-res" v-if="contractCallRes">{{ contractCallRes }}</p>
<p data-cy="contract-call-static-res" v-if="contractCallStaticRes">{{ contractCallStaticRes }}</p>
<p data-cy="contract-call-static-res" v-if="contractCallStaticRes">
{{ contractCallStaticRes }}
</p>
<p data-cy="send-res" v-if="sendRes">{{ sendRes }}</p>
</div>
</div>
Expand Down Expand Up @@ -73,13 +77,21 @@ contract Example =
},
methods: {
async initClient() {
const node = await Node({ url: networks[process.env.NETWORK].NODE_URL, internalUrl: networks[process.env.NETWORK].NODE_INTERNAL_URL });
const node = await Node({
url: networks[process.env.NETWORK].NODE_URL,
internalUrl: networks[process.env.NETWORK].NODE_INTERNAL_URL,
});
this.client = await RpcAepp({
name: 'AEPP',
nodes: [{ name: process.env.NETWORK, instance: node }],
compilerUrl: networks[process.env.NETWORK].COMPILER_URL,
onNetworkChange(params) {
if (this.getNetworkId() !== params.networkId) alert(`Connected network ${this.getNetworkId()} is not supported with wallet network ${params.networkId}`);
if (this.getNetworkId() !== params.networkId)
alert(
`Connected network ${this.getNetworkId()} is not supported with wallet network ${
params.networkId
}`,
);
},
onAddressChange: async () => {
this.wallet.address = await this.client.address();
Expand All @@ -89,7 +101,11 @@ contract Example =
});
},
async spend() {
const spend = await this.client.spend(1000000000000000, 'ak_2ELPCWzcTdiyYuumjaV4D7kE843d1Ts27zH1Y2LBMKDbNtfq1Q', { payload: '' });
const spend = await this.client.spend(
1000000000000000,
'ak_2ELPCWzcTdiyYuumjaV4D7kE843d1Ts27zH1Y2LBMKDbNtfq1Q',
{ payload: '' },
);
if (spend.hash) {
this.sendRes = spend;
}
Expand All @@ -98,12 +114,22 @@ contract Example =
const compile = (await this.client.contractCompile(this.contractCode)).bytecode;
const deploy = await this.client.contractDeploy(compile, this.contractCode, []);
if (type === 'statefull') {
const result = await this.client.contractCall(this.contractCode, deploy.address, 'set_bytes', ['#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa']);
const result = await this.client.contractCall(
this.contractCode,
deploy.address,
'set_bytes',
['#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'],
);
if (result.hash) {
this.contractCallRes = result;
}
} else if (type === 'static') {
const result = await this.client.contractCall(this.contractCode, deploy.address, 'get_bytes', []);
const result = await this.client.contractCall(
this.contractCode,
deploy.address,
'get_bytes',
[],
);
if (result.hash) {
this.contractCallStaticRes = result;
}
Expand Down
14 changes: 12 additions & 2 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import { buildTx } from './popup/utils';
import WalletController from './wallet-controller';
import Notification from './notifications';
import rpcWallet from './lib/rpcWallet';
import { HDWALLET_METHODS, AEX2_METHODS, NOTIFICATION_METHODS, CONNECTION_TYPES, DEFAULT_NETWORK } from './popup/utils/constants';
import {
HDWALLET_METHODS,
AEX2_METHODS,
NOTIFICATION_METHODS,
CONNECTION_TYPES,
DEFAULT_NETWORK,
} from './popup/utils/constants';
import { popupProps } from './popup/utils/config';
import TipClaimRelay from './lib/tip-claim-relay';
import RedirectChainNames from './lib/redirect-chain-names';
Expand Down Expand Up @@ -63,7 +69,11 @@ if (process.env.IS_EXTENSION && require.main.i === module.id) {
break;
}

if (msg.from === 'content' && msg.type === 'readDom' && (msg.data.address || msg.data.chainName)) {
if (
msg.from === 'content' &&
msg.type === 'readDom' &&
(msg.data.address || msg.data.chainName)
) {
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
tabs.forEach(({ url }) => {
if (sender.url === url && DEFAULT_NETWORK === 'Mainnet') {
Expand Down
32 changes: 25 additions & 7 deletions src/common/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ p {
font-size: 1.3rem;
}
.wrapper {
max-width: 480px;
max-width: 357px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0 auto;
Expand Down Expand Up @@ -689,12 +689,6 @@ input::-moz-focus-outer {
height: 50px !important;
}

@-moz-document url-prefix() {
.ae-main {
width: 357px;
margin: 0 auto;
}
}
.ae-identicon.base {
height: 100%;
width: 100%;
Expand Down Expand Up @@ -923,3 +917,27 @@ button {
text-align: center;
font-weight: bold;
}

@media screen and (min-width: 780px) {
@-moz-document url-prefix() {
.ae-main {
width: 100%;
max-width: 100%;
margin: 0 auto;
}
}
}

@media screen and (max-width: 380px) {
.ae-main {
max-width: 357px;
margin: 0 auto;
}

@-moz-document url-prefix() {
.ae-main {
max-width: 357px;
margin: 0 auto;
}
}
}
2 changes: 1 addition & 1 deletion src/common/extension.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ a {
.primary-title {
color: $white-color;
font-size: 18px;
font-weight: lighter;
font-weight: 400;
margin-bottom:27px;
margin-left:0 !important;
}
Expand Down
3 changes: 3 additions & 0 deletions src/common/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ $scrollbar-color:#707075;
$submenu-bg: #1B1B23;
$black-color: #000;
$filters-bg:#111117;
$untrusted-badge-bg: #FF5857;
$tour-bg-color: #12121b;
$tour-start-bg-color: #33343E;
$font-size: 16px;
6 changes: 6 additions & 0 deletions src/icons/edit-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/icon_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/icons/tick-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ window.addEventListener(
sendToBackground(method, data);
}
},
false
false,
);

const getAddresses = () => {
Expand Down Expand Up @@ -88,7 +88,7 @@ window.addEventListener('load', () => {
sendDomData();
}
},
false
false,
);
});

Expand Down
6 changes: 4 additions & 2 deletions src/lib/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const wrapTry = async promise => {
const backendFetch = (path, ...args) => wrapTry(fetch(`${BACKEND_URL}/${path}`, ...args));

export default class Backend {
static getTipComments = async tipId => backendFetch(`comment/api/tip/${encodeURIComponent(tipId)}`);
static getTipComments = async tipId =>
backendFetch(`comment/api/tip/${encodeURIComponent(tipId)}`);

static async sendTipComment(tipId, text, author, signCb) {
const sendComment = async postParam =>
Expand Down Expand Up @@ -91,7 +92,8 @@ export default class Backend {

static cacheInvalidateTips = async () => backendFetch(`cache/invalidate/tips`);

static getCommentCountForAddress = async address => backendFetch(`comment/count/author/${address}`);
static getCommentCountForAddress = async address =>
backendFetch(`comment/count/author/${address}`);

static getTipPreviewUrl = previewLink => `${BACKEND_URL}${previewLink}`;

Expand Down
Loading

1 comment on commit 8932cc8

@davidyuk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.