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

Commit

Permalink
Merge pull request #20 from ellcrys/dev
Browse files Browse the repository at this point in the history
Fixed Transaction Issue
  • Loading branch information
ncodes authored May 2, 2019
2 parents bc73f3d + d59ecae commit 4b20287
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions dev/core/elld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export default class Elld {
// applications
const rpcUser = randomstring.generate(32);
const rpcPass = randomstring.generate(32);

const env = {
ELLD_NODE_ACCOUNT: coinbasePrivateKey,
ELLD_RPC_USERNAME: rpcUser,
Expand Down
12 changes: 6 additions & 6 deletions dev/renderer/components/modals/OnBoarding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<br>
<br>
<b>Note:</b>
The software is a an early alpha version with limited features. More features will
The software is an early alpha version with limited features. More features will
be added as we improve the protocol.
<br>
<br>
Expand Down Expand Up @@ -70,16 +70,16 @@
<h1 class="split-right-header">You Now Have A Wallet!</h1>
</div>
<div class="item content">
This wallet allow you to interact with the Ellcrys network and managing your Ellcrys native
This wallet allows you to interact with the Ellcrys network and managing your Ellcrys native
coin “ELL”. You will be able to send and receive ELL coins, and also track your transactions.
<br>
<br>You wallet is encrypted and stored on your computer using your
<br>Your wallet is encrypted and stored on your computer using your
passphrase as the encryption key. Whenever you log in, your
wallet is unlocked using the passphrase.
<br>
<br>During the sign up process, you were given a 12-words phrase.
<br>During the signup process, you were given a 12-words phrase.
These 12 words are used to create the master seed from which
all accounts of this wallet are generated from. If you
all accounts of this wallet are generated. If you
lose your computer, you will be able to retrieve all your
accounts using your 12-words phrase. Please keep it safe.
<br>
Expand Down Expand Up @@ -113,7 +113,7 @@
<h1 class="split-right-header">CPU Miner Is Also Included</h1>
</div>
<div class="item content">
The CPU miner allows you to miner blocks and receive
The CPU miner allows you to mine blocks and receive
all associated rewards. The current test network this
wallet is connected to only rewards miners with transaction
fees.
Expand Down
17 changes: 15 additions & 2 deletions dev/renderer/components/modals/SendTxn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ import Decimal from 'decimal.js';
import { Address } from '@ellcrys/spell';
import { request } from 'http';
import Vue from 'vue';
import { type } from 'os';
export default {
components: {
Expand Down Expand Up @@ -420,42 +421,54 @@ export default {
this.txError.fee = '';
this.txError.value = '';
this.txError.addr = '';
this.txError.genErr = '';
// check if amount to send is less than or equal to 0
if (this.txDetails.value <= 0) {
this.txError.value = 'Amount to send cannot be less than 0';
return false;
}
// check if the sender address is empty
if (this.txDetails.address === '') {
this.txError.addr = 'Sender address cannot be empty';
this.txError.addr = 'Recipient address cannot be empty';
return false;
}
// check if recipient address is a valid ellcrys address
if (!Address.isValid(this.txDetails.address)) {
this.txError.addr = 'Address must be a valid ellcrys Address';
return false;
}
// transaction fee cannot be 0
if (this.txDetails.fee <= 0) {
this.txError.fee = 'Transaction fee cannot be less than 0';
return false;
}
// you cannot send transaction from 0 balance
if (this.mainAccount.balance == 0) {
this.txError.genErr = 'Insufficient fund, balance is 0';
return false;
}
// convert all values to decimal
const txValue = new Decimal(this.txDetails.value);
const txFee = new Decimal(this.txDetails.fee);
const totalSend = txValue.add(txFee);
const balance = new Decimal(this.mainAccount.balance);
if (totalSend.toPrecision(10) > balance.toPrecision(10)) {
// check if there are enough balance
// to send this transaction
if (totalSend.greaterThan(balance)) {
this.txError.genErr = 'Insufficient fund';
return false;
}
// after confirmation
// move to phase2
this.phase = 'phase2';
},
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": "SafeHold",
"version": "0.1.0-alpha",
"version": "0.1.1-alpha",
"author": "Ellcrys <hello@ellcrys.co>",
"description": "Official desktop wallet and miner for the Ellcrys network",
"license": "",
Expand Down

0 comments on commit 4b20287

Please sign in to comment.