Commit 36b366d3 authored by Rishi Panthee's avatar Rishi Panthee
Browse files

All operations working on testnet + changes icon on testnet

parent 67a39553
......@@ -96,9 +96,12 @@ export const ACCOUNT_CONTACTS_REMOVE = "ACCOUNT_CONTACTS_REMOVE";
export function claimRewardBalance(wif: string, params: object) {
return (dispatch: () => void) => {
const { account, reward_hive, reward_hbd, reward_vests } = params;
// let reward_hive = reward_hive.replace("HIVE", "STEEM");
// let reward_hbd = reward_hbd.replace("HBD", "SBD");
let { account, reward_hive, reward_hbd, reward_vests } = params;
if (hive.config.get('address_prefix') === 'TST') {
//if testnet
reward_hive = reward_hive.replace("HIVE", "TESTS");
reward_hbd = reward_hbd.replace("HBD", "TBD");
}
const ops = [
[
"claim_reward_balance",
......@@ -342,11 +345,14 @@ export function transferCompleted() {
export function transferFromSavings(wif, params) {
return (dispatch: () => void) => {
var { from, requestId, to, amount, memo } = params;
// amount = amount.replace("HIVE", "STEEM");
// amount = amount.replace("HBD", "SBD");
dispatch({
type: ACCOUNT_TRANSFER_FROM_SAVINGS_STARTED
});
if (hive.config.get('address_prefix') === 'TST') {
//if testnet
amount = amount.replace("HIVE", "TESTS");
amount = amount.replace("HBD", "TBD");
}
hive.broadcast.transferFromSavings(
wif,
from,
......@@ -380,8 +386,11 @@ export function transferFromSavingsCompleted() {
export function transferToSavings(wif, params) {
return (dispatch: () => void) => {
var { from, to, amount, memo } = params;
// amount = amount.replace("HIVE", "STEEM");
// amount = amount.replace("HBD", "SBD");
if (hive.config.get('address_prefix') === 'TST') {
//if testnet
amount = amount.replace("HIVE", "TESTS");
amount = amount.replace("HBD", "TBD");
}
dispatch({
type: ACCOUNT_TRANSFER_TO_SAVINGS_STARTED
});
......@@ -607,8 +616,12 @@ export function cancelWithdrawVesting(wif, params) {
export function powerUp(wif, params) {
return (dispatch: () => void) => {
const { from_account, to_account, hiveAmount } = params;
const hiveFormat = [hiveAmount, "STEEM"].join(" ");
let { from_account, to_account, hiveAmount } = params;
let hiveFormat = [hiveAmount, "HIVE"].join(" ");
if (hive.config.get('address_prefix') === 'TST') {
//if testnet
hiveFormat = hiveFormat.replace("HIVE", "TESTS");
}
dispatch({
type: ACCOUNT_POWER_UP_STARTED
});
......
......@@ -16,11 +16,10 @@ export function refreshGlobalProps() {
} else {
if(results.virtual_supply.search('HIVE') >= 0){
results.network = "Hive";
// } else if(results.virtual_supply.search('STEEM') >= 0){
// results.network = "Steem";
} else if(results.virtual_supply.search('TESTS') >= 0){
results.network = "Hive Testnet";
} else {
results.network = "Hive";
results.network = "Unknown";
}
dispatch({
......
......@@ -140,3 +140,7 @@ a {
.hivered {
color: #E31337 !important;
}
.hivetestnetpink {
color : #fe5fff !important;
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ import * as HiveActions from "../actions/hive";
import * as PreferencesActions from "../actions/preferences";
const srcHive = require("../img/hive.png");
const srcSteem = require("../img/steem.png");
const srcTestnet = require("../img/testnet.png");
class MenuBar extends Component {
state = {
......@@ -49,7 +49,7 @@ class MenuBar extends Component {
<img
alt="Vessel"
className="ui tiny image"
src={network === "Hive" ? srcHive : srcSteem}
src={network === "Hive" ? srcHive : srcTestnet}
style={{
width: "50px",
height: "50px",
......@@ -92,13 +92,13 @@ class MenuBar extends Component {
<div>
<span style={{ lineHeight: "1.5em" }}>Chain:</span>
<br />
<span style={{ fontWeight: 700 }} className="hivered">
<span style={{ fontWeight: 700 }} className={network === "Hive" ? "hivered" : "hivetestnetpink"}>
{network}
</span>
<hr />
<span style={{ lineHeight: "1.5em" }}>Height:</span>
<br />
<span style={{ fontWeight: 700 }} className="hivered">
<span style={{ fontWeight: 700 }} className={network === "Hive" ? "hivered" : "hivetestnetpink"}>
{height}
</span>
</div>
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment