Skip to content

Commit 75c6e3f

Browse files
authored
Merge pull request #68 from GalaxyPay/dev
parameterize DEFAULT_NETWORK
2 parents 19eede3 + c35791b commit 75c6e3f

File tree

12 files changed

+28
-39
lines changed

12 files changed

+28
-39
lines changed

Diff for: .github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,5 +266,5 @@ jobs:
266266
uses: ncipollo/release-action@v1
267267
with:
268268
allowUpdates: true
269-
tag: v3.3.3
269+
tag: v3.3.4
270270
artifacts: "Output/*"

Diff for: FUNC.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "FUNC"
5-
#define MyAppVersion "3.3.3"
5+
#define MyAppVersion "3.3.4"
66
#define MyAppPublisher "Galaxy Pay, LLC"
77
#define MyAppPublisherURL "https://galaxy-pay.com"
88
#define MyPublishPath "publish"

Diff for: create-package-deb.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
rm -r Output
22

3-
PKG=Output/func_3.3.3_linux-$1
3+
PKG=Output/func_3.3.4_linux-$1
44

55
mkdir -p $PKG/lib/systemd/system
66
mkdir -p $PKG/opt/func

Diff for: create-package-pkg.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ pkgbuild --root publish \
55
--install-location /opt/func \
66
--scripts pkg/scripts \
77
--identifier func.app \
8-
Output/func_3.3.3_darwin-$1.pkg
8+
Output/func_3.3.4_darwin-$1.pkg

Diff for: deb/amd64/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: func
2-
Version: 3.3.3
2+
Version: 3.3.4
33
Section: base
44
Priority: optional
55
Architecture: amd64

Diff for: deb/arm64/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: func
2-
Version: 3.3.3
2+
Version: 3.3.4
33
Section: base
44
Priority: optional
55
Architecture: arm64

Diff for: webui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "func-webui",
3-
"version": "3.3.3",
3+
"version": "3.3.4",
44
"scripts": {
55
"dev": "vite",
66
"build": "vite build",

Diff for: webui/src/components/Node.vue

+1-7
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,7 @@
113113
</div>
114114
<div>Online Stake</div>
115115
</v-col>
116-
<v-col
117-
cols="12"
118-
sm="6"
119-
md="3"
120-
class="text-center"
121-
align-self="center"
122-
>
116+
<v-col cols="12" sm="6" md="3" class="text-center">
123117
<div class="text-h4">
124118
{{
125119
partDetails?.votes == null

Diff for: webui/src/components/Participation.vue

+11-22
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
</template>
239239

240240
<script lang="ts" setup>
241-
import { networks } from "@/data";
241+
import { DEFAULT_NETWORK, networks } from "@/data";
242242
import { PartDetails, Participation } from "@/types";
243243
import { b64, delay, execAtc, formatAddr } from "@/utils";
244244
import { mdiChevronDown, mdiClose, mdiContentCopy, mdiPlus } from "@mdi/js";
@@ -310,26 +310,15 @@ const statsClient = axios.create({
310310
const partStats = ref<any>({});
311311
312312
async function getKeys(): Promise<Participation[]> {
313-
const { data } = await partClient.get("");
314-
return (
315-
data
316-
// TODO: there's got to be a better way algosdk!
317-
?.map((p: any) => ({
318-
...p,
319-
key: new modelsv2.AccountParticipation({
320-
voteParticipationKey: p.key["vote-participation-key"],
321-
selectionParticipationKey: p.key["selection-participation-key"],
322-
stateProofKey: p.key["state-proof-key"],
323-
voteFirstValid: p.key["vote-first-valid"],
324-
voteLastValid: p.key["vote-last-valid"],
325-
voteKeyDilution: p.key["vote-key-dilution"],
326-
}),
327-
}))
328-
.sort(
329-
(a: Participation, b: Participation) =>
330-
Number(b.key.voteLastValid) - Number(a.key.voteLastValid)
331-
)
332-
);
313+
const { data }: { data: Participation[] } = await partClient.get("");
314+
return data
315+
?.map((p) => ({
316+
...p,
317+
key: modelsv2.AccountParticipation.fromEncodingData(
318+
new Map(Object.entries(p.key))
319+
),
320+
}))
321+
.sort((a, b) => Number(b.key.voteLastValid) - Number(a.key.voteLastValid));
333322
}
334323
335324
async function refreshData() {
@@ -425,7 +414,7 @@ function isKeyActive(item: Participation) {
425414
}
426415
427416
function incentiveIneligible(addr: string) {
428-
if (activeNetwork.value !== "mainnet")
417+
if (activeNetwork.value !== DEFAULT_NETWORK)
429418
return { val: false, reason: "Not Supported" };
430419
const acctInfo = acctInfos.value.find((ai) => ai.address === addr);
431420
if ((acctInfo?.amount || 0) < 3 * 10 ** 10)

Diff for: webui/src/components/Settings.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
</template>
9191

9292
<script lang="ts" setup>
93+
import { DEFAULT_NETWORK } from "@/data";
9394
import FUNC from "@/services/api";
9495
import { mdiClose } from "@mdi/js";
9596
import { NetworkId, useNetwork } from "@txnlab/use-wallet-vue";
@@ -117,7 +118,7 @@ const url = ref();
117118
let init = false;
118119
119120
onBeforeMount(async () => {
120-
if (activeNetwork.value !== "mainnet") setShowNetworks(true);
121+
if (activeNetwork.value !== DEFAULT_NETWORK) setShowNetworks(true);
121122
await getVersion();
122123
if (store.funcUpdateAvailable) {
123124
url.value = (await FUNC.api.get("func/latest")).data;
@@ -176,7 +177,7 @@ async function updateNode(release: string) {
176177
async function setShowNetworks(val: boolean) {
177178
store.showNetworks = val;
178179
localStorage.setItem("showNetworks", val.toString());
179-
if (!val) setActiveNetwork("mainnet" as NetworkId);
180+
if (!val) setActiveNetwork(DEFAULT_NETWORK as NetworkId);
180181
}
181182
182183
async function setShowMachineName(val: boolean) {

Diff for: webui/src/data/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import networks from "./networks.json";
22

3+
export const DEFAULT_NETWORK = "mainnet";
4+
5+
networks[0].id = DEFAULT_NETWORK;
6+
37
export { networks };

Diff for: webui/src/plugins/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import pinia from "../stores";
1616

1717
// Types
1818
import type { App } from "vue";
19+
import { DEFAULT_NETWORK } from "@/data";
1920

2021
const networks = new NetworkConfigBuilder()
2122
.addNetwork("voimain", {
@@ -40,7 +41,7 @@ export function registerPlugins(app: App) {
4041
WalletId.PERA,
4142
WalletId.KIBISIS,
4243
],
43-
defaultNetwork: NetworkId.MAINNET,
44+
defaultNetwork: DEFAULT_NETWORK as NetworkId,
4445
networks,
4546
});
4647
}

0 commit comments

Comments
 (0)