Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI nits #162

Merged
merged 57 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2e5eb55
try patch macos dylib issue
0o-de-lally Oct 28, 2023
3f12038
try one dir level up
0o-de-lally Oct 28, 2023
893ad88
patch
0o-de-lally Oct 28, 2023
80ff1e8
assume dylib path ./ means src-tauri
0o-de-lally Oct 29, 2023
1b6e226
add all mac gmp libs
0o-de-lally Oct 30, 2023
f8d91b9
update tauri rust deps
0o-de-lally Oct 30, 2023
c92a303
ci build
0o-de-lally Nov 1, 2023
be033d4
update libra-types
0o-de-lally Nov 1, 2023
24b2b56
bump version
0o-de-lally Nov 2, 2023
93b73c4
test release profile
0o-de-lally Nov 2, 2023
3b29574
language
0o-de-lally Nov 2, 2023
23de833
creating file in wrong order.
0o-de-lally Nov 3, 2023
a0e8a76
try patch macos dylib issue
0o-de-lally Oct 28, 2023
1aa8ae2
add all mac gmp libs
0o-de-lally Oct 30, 2023
8a89a92
update libra-types
0o-de-lally Nov 1, 2023
cd1826b
bump version
0o-de-lally Nov 2, 2023
1dfc1b5
language
0o-de-lally Nov 2, 2023
b0e24b9
creating file in wrong order.
0o-de-lally Nov 3, 2023
ac95f75
update to libra 6.9.0-rc.7
0o-de-lally Nov 10, 2023
93c32cd
patch cargo lock
0o-de-lally Nov 10, 2023
f0d7ff0
update cargo lock
0o-de-lally Nov 15, 2023
de2bafb
bump version
0o-de-lally Nov 15, 2023
71f9a42
update cargo.lock
0o-de-lally Nov 15, 2023
c225085
Merge branch 'main' into fix-win-install
0o-de-lally Nov 15, 2023
5550644
scaffold account deletion
0o-de-lally Nov 15, 2023
ad317dc
remove prepended 0s from account view
0o-de-lally Nov 15, 2023
f570711
patch
0o-de-lally Nov 15, 2023
924df4a
Merge branch 'main' into misc-patches
0o-de-lally Nov 15, 2023
904b932
patch account display
0o-de-lally Nov 15, 2023
283fac5
format accounts
0o-de-lally Nov 15, 2023
8f53303
patch transfer issues. Confirm migration can reuse old keys
0o-de-lally Nov 15, 2023
82bcaed
Merge branch 'misc-patches' into canary
0o-de-lally Nov 15, 2023
e8372a6
lint
0o-de-lally Nov 15, 2023
11daac0
macOs replace vcpkg build libgmp for homebrew
0o-de-lally Nov 16, 2023
5eee590
patch-ui issues in account creation
0o-de-lally Nov 17, 2023
ba487ef
test release with homebrew
Nov 20, 2023
1646781
remove dylib files
Nov 20, 2023
cbb7932
update libra version
0o-de-lally Nov 21, 2023
a1936fc
patch mac release
0o-de-lally Nov 22, 2023
5736ac8
try brew paths for gmp
0o-de-lally Nov 22, 2023
52f802f
try different toolchains macos release
0o-de-lally Nov 22, 2023
c07b4ac
try only aarch64-apple-darwin
0o-de-lally Nov 22, 2023
5b8573b
typo
0o-de-lally Nov 22, 2023
2f19b19
again
0o-de-lally Nov 22, 2023
8234a97
try --target universal-apple-darwin
0o-de-lally Nov 22, 2023
e2d3046
Squashed commit of the following:
Nov 22, 2023
6edc3dc
revert changes release.yaml
Nov 22, 2023
636722f
patch nav and info when account doesn't exist
Nov 22, 2023
c108bc8
patch issue of account always being on_chain=true. minor ui fixes
Nov 22, 2023
c46ca57
fmt
Nov 22, 2023
625dfc4
Squashed commit of the following:
Nov 22, 2023
be51e5d
Squashed commit of the following:
Nov 22, 2023
620c33e
Merge branch 'main' into ui-nits
Nov 22, 2023
1055c65
release
Nov 22, 2023
984c40e
clippy
0o-de-lally Nov 27, 2023
8a131b6
fmt
0o-de-lally Nov 27, 2023
81afd40
force CI
Nov 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/release-aarch64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: carpe-release-aarch64

on:
push:
branches:
- '*aarch64*'

env:
LDFLAGS: '/opt/homebrew/lib'
LD_LIBRARY_PATH: '/opt/homebrew/lib'
jobs:
publish:
strategy:
fail-fast: false
matrix:
os: [ macos-latest-xlarge ]
name: build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
### DO NOT REMOVE: uncomment if you need to debug runner ###
- name: setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true

# Setup Rust
- uses: dtolnay/[email protected]
with:
components: rustfmt

# Setup Node.js
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
# checkout
- name: checkout source
uses: actions/checkout@v3


######## MAC ########
- name: osx deps
run: |
brew update
brew reinstall llvm
brew reinstall gmp

- uses: Swatinem/rust-cache@v2
with:
workspaces: ./src-tauri
shared-key: ${{ matrix.os }}
cache-all-crates: true
cache-on-failure: true

######## BUILD ########

- name: yarn installation
run: yarn install


- name: pre-build rust
working-directory: ./src-tauri
run: export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix)/lib && cargo b --release

- name: Build Tauri
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{secrets.TAURI_PRIVATE_KEY}}
TAURI_KEY_PASSWORD: ${{secrets.TAURI_KEY_PASSWORD}}
LIBRARY_PATH: /opt/homebrew/lib
with:
args: ${{contains(github.ref, 'canary') && '--config src-tauri/tauri.conf.aarch64.json --features carpe-canary' || '--config src-tauri/tauri.conf.aarch64.json' }} #pass the rust feature flags for canary if the tag includes "canary"
tagName: ${{contains(github.ref, 'canary') && 'v__VERSION__-canary' || 'v__VERSION__' }} # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: ${{contains(github.ref, 'canary') && 'v__VERSION__-aarch64-canary' || 'v__VERSION__-aarch64' }}
releaseBody: '[draft]'
releaseDraft: true
prerelease: false
30 changes: 17 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ on:
- '[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'

branches:
- 'canary'
- 'canary*'
- 'release-[0-9]+.[0-9]+.[0-9]+'
- 'ci'
jobs:
publish:
strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-11]
os: [ macos-11, windows-latest ]
name: build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -24,6 +25,7 @@ jobs:
# uses: mxschmitt/action-tmate@v3
# with:
# detached: true

# Setup Rust
- uses: dtolnay/[email protected]
with:
Expand All @@ -39,18 +41,19 @@ jobs:
uses: actions/checkout@v3

######## UBUNTU ########
- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: build-essential lld pkg-config libclang-dev libwebkit2gtk-4.0-dev libglib2.0-* libssl-dev libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libvips-dev libgmp-dev
version: 1.0
# - name: install dependencies (ubuntu only)
# if: matrix.os == 'ubuntu-latest'
# uses: awalsh128/cache-apt-pkgs-action@latest
# with:
# packages: build-essential lld pkg-config libclang-dev libwebkit2gtk-4.0-dev libglib2.0-* libssl-dev libgtk-3-dev libappindicator3-dev patchelf librsvg2-dev libvips-dev libgmp-dev
# version: 1.0

######## MAC ########

- name: set the Mac compile target
- name: install gmp
if: matrix.os == 'macos-11'
run: export CARGO_BUILD_TARGET='universal-apple-darwin'
run: |
brew reinstall gmp

######## WIN ########

Expand All @@ -65,7 +68,6 @@ jobs:
if: matrix.os == 'windows-latest'
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV


# Package the windows dependencies
- name: copy gmp.dll for build
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -97,8 +99,10 @@ jobs:
TAURI_PRIVATE_KEY: ${{secrets.TAURI_PRIVATE_KEY}}
TAURI_KEY_PASSWORD: ${{secrets.TAURI_KEY_PASSWORD}}
with:
args: ${{contains(github.ref, 'canary') && '--config src-tauri/tauri.conf.canary.json --features carpe-canary' || '' }} #pass the rust feature flags for canary if the tag includes "canary"
tagName: ${{contains(github.ref, 'canary') && 'v__VERSION__-canary' || 'v__VERSION__' }} # the action automatically replaces \_\_VERSION\_\_ with the app version
args: ${{contains(github.ref, 'canary') && '--config src-tauri/tauri.conf.canary.json --features carpe-canary' || '' }}
# pass the rust feature flags for canary if the tag includes "canary"
tagName: ${{contains(github.ref, 'canary') && 'v__VERSION__-canary' || 'v__VERSION__' }}
# the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: ${{contains(github.ref, 'canary') && 'v__VERSION__-canary' || 'v__VERSION__' }}
releaseBody: '[draft]'
releaseDraft: true
Expand Down
Binary file added bun.lockb
Binary file not shown.
7 changes: 7 additions & 0 deletions carpe.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"folders": [
{
"path": "."
}
]
}
1 change: 1 addition & 0 deletions dist/assets/index-0968cf85.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/assets/index-48a2a9b5.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/assets/index-48a2a9b5.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/assets/index-699678fd.css

This file was deleted.

2 changes: 0 additions & 2 deletions dist/assets/index-cf00d38c.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/assets/index-cf00d38c.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="module" crossorigin src="/assets/index-cf00d38c.js"></script>
<link rel="stylesheet" href="/assets/index-699678fd.css">
<script type="module" crossorigin src="/assets/index-48a2a9b5.js"></script>
<link rel="stylesheet" href="/assets/index-0968cf85.css">
</head>
<body>

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"dev:canary": "tauri dev --config src-tauri/tauri.conf.canary.json --features carpe-canary",
"dev:web": "vite",
"build": "tauri build",
"build:universal": "tauri build --target universal-apple-darwin",
"build:aarch64": "RUSTFLAGS='--cfg tokio_unstable' tauri build --target aarch64-apple-darwin",
"build:canary": "tauri build --config src-tauri/tauri.conf.canary.json --features carpe-canary",
"build:web": "vite build",
"lint": "svelte-check --tsconfig ./tsconfig.json && eslint src && prettier --check src",
Expand Down
18 changes: 6 additions & 12 deletions src-tauri/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,9 @@ rustflags = [
"target-feature=+sse4.2",
]

# # 64 bit MSVC
# [target.x86_64-pc-windows-msvc]
# rustflags = [
# "--cfg",
# "tokio_unstable",
# "-C",
# "force-frame-pointers=yes",
# "-C",
# "force-unwind-tables=yes",
# "-C",
# "link-arg=/STACK:8000000" # Set stack to 8 MB
# ]
# apple
[target.aarch64-apple-darwin]
rustflags = [
"--cfg",
"tokio_unstable"
]
14 changes: 7 additions & 7 deletions src-tauri/Cargo.lock

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

10 changes: 5 additions & 5 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ tauri-build = { version = "^1.5.0", features = [] }
built = { version = "0.5.1", features = ["git2"] }

[dependencies]
libra-query = { git = "https://github.com/0LNetworkCommunity/libra-framework.git", branch = "main" }
libra-tower = { git = "https://github.com/0LNetworkCommunity/libra-framework", branch = "main" }
libra-types = { git = "https://github.com/0LNetworkCommunity/libra-framework", branch = "main" }
libra-txs = { git = "https://github.com/0LNetworkCommunity/libra-framework", branch = "main" }
libra-wallet = { git = "https://github.com/0LNetworkCommunity/libra-framework", branch = "main" }
libra-query = { git = "https://github.com/0LNetworkCommunity/libra-framework.git", rev = "cc2ce46" }
libra-tower = { git = "https://github.com/0LNetworkCommunity/libra-framework", rev = "cc2ce46" }
libra-types = { git = "https://github.com/0LNetworkCommunity/libra-framework", rev = "cc2ce46" }
libra-txs = { git = "https://github.com/0LNetworkCommunity/libra-framework", rev = "cc2ce46" }
libra-wallet = { git = "https://github.com/0LNetworkCommunity/libra-framework", rev = "cc2ce46" }

# shared with libra-framework and diem
anyhow = "1.0.62"
Expand Down
Binary file removed src-tauri/libgmp.10.dylib
Binary file not shown.
Binary file removed src-tauri/libgmp.a
Binary file not shown.
Binary file removed src-tauri/libgmp.dylib
Binary file not shown.
Binary file removed src-tauri/libgmpxx.4.dylib
Binary file not shown.
Binary file removed src-tauri/libgmpxx.a
Binary file not shown.
Binary file removed src-tauri/libgmpxx.dylib
Binary file not shown.
19 changes: 18 additions & 1 deletion src-tauri/src/commands/preferences.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::configs::{default_config_path, legacy_config_path};
use crate::migrate::{self, backup_legacy_dir, read_accounts};
use crate::{carpe_error::CarpeError, configs::get_cfg};
use anyhow::Context;
use libra_types::legacy_types::mode_ol::MODE_0L;
use log::{error, info, warn};
use std::env;
Expand Down Expand Up @@ -34,8 +35,24 @@ pub async fn refresh_upstream_peer_stats() -> Result<Vec<Url>, CarpeError> {
let mut app_cfg = get_cfg()?;
app_cfg.refresh_network_profile_and_save(None).await?; // uses app_cfg.chain_info_chain_id
let np = app_cfg.get_network_profile(None)?;
// dbg!(&np);
app_cfg.save_file()?;
Ok(np.the_good_ones()?) // uses app_cfg.chain_info_chain_id

let peers = match np.the_good_ones() {
Ok(r) => r,
_ => {
let first_url = np
.nodes
.first()
.context("no hosts in network playlist")?
.url
.to_owned();

vec![first_url]
}
};
dbg!(&peers);
Ok(peers) // uses app_cfg.chain_info_chain_id
}

#[tauri::command(async)]
Expand Down
9 changes: 4 additions & 5 deletions src-tauri/src/commands/wallets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,12 @@ async fn map_get_originating_address(list: &mut [Profile]) -> Result<(), CarpeEr

async fn map_get_balance(list: &mut [Profile]) -> anyhow::Result<(), CarpeError> {
futures::future::join_all(list.iter_mut().map(|e| async {
// if query::get_seq_num(e.account).await.is_ok() {
// // e.on_chain = true;
// }
if let Ok(b) = query::get_balance(e.account).await {
e.balance = b;
e.on_chain = true;
}

if query::get_seq_num(e.account).await.is_ok() {
e.on_chain = true;
// e.on_chain = true;
}
}))
.await;
Expand Down
Loading
Loading