From 733fd85079c14351e15c308bf2aea95861452640 Mon Sep 17 00:00:00 2001 From: Impa10r Date: Mon, 8 Apr 2024 19:48:05 +0200 Subject: [PATCH 1/4] Fix conversion to millions with 0.1 precision --- cmd/psweb/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/psweb/utils.go b/cmd/psweb/utils.go index acf421f..2393d61 100644 --- a/cmd/psweb/utils.go +++ b/cmd/psweb/utils.go @@ -199,7 +199,7 @@ func toUint(num int64) uint64 { } func toMil(num uint64) string { - return fmt.Sprintf("%.1f", float32(num/1000000)) + return fmt.Sprintf("%.1f", float32(num)/1000000) } func getNodeAlias(key string) string { From 1f837726c3f3ee46bc51fc03e94012e79c245627 Mon Sep 17 00:00:00 2001 From: Impa10r Date: Wed, 10 Apr 2024 16:24:26 +0200 Subject: [PATCH 2/4] Bump version --- CHANGELOG.md | 4 ++++ cmd/psweb/client.go | 1 - cmd/psweb/main.go | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5dba9f..ae4f205 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Versions +## 1.2.6 + +- Fix conversion to millions in Peer Details + ## 1.2.5 - Bug fix for peg-in claim not working in v1.2.4 diff --git a/cmd/psweb/client.go b/cmd/psweb/client.go index d0de333..3e90674 100644 --- a/cmd/psweb/client.go +++ b/cmd/psweb/client.go @@ -30,7 +30,6 @@ func getClientConn(address string) (*grpc.ClientConn, error) { maxMsgRecvSize := grpc.MaxCallRecvMsgSize(1 * 1024 * 1024 * 200) opts := []grpc.DialOption{ grpc.WithDefaultCallOptions(maxMsgRecvSize), - //grpc.WithInsecure(), grpc.WithTransportCredentials(insecure.NewCredentials()), } diff --git a/cmd/psweb/main.go b/cmd/psweb/main.go index d675e99..744a104 100644 --- a/cmd/psweb/main.go +++ b/cmd/psweb/main.go @@ -41,7 +41,7 @@ var ( logFile *os.File ) -const version = "v1.2.5" +const version = "v1.2.6" func main() { @@ -1357,7 +1357,7 @@ func bumpfeeHandler(w http.ResponseWriter, r *http.Request) { } if config.PeginTxId == "" { - redirectWithError(w, r, "/bitcoin?", errors.New("No pending peg-in")) + redirectWithError(w, r, "/bitcoin?", errors.New("no pending peg-in")) return } @@ -1376,7 +1376,7 @@ func bumpfeeHandler(w http.ResponseWriter, r *http.Request) { } if tx.OutputDetails[index].Amount == config.PeginAmount { - redirectWithError(w, r, "/bitcoin?", errors.New("Peg-in tx has no change, not possible to bump")) + redirectWithError(w, r, "/bitcoin?", errors.New("peg-in tx has no change, not possible to bump")) return } From 523083b3974bc1efaa2deb7221d6d6af858f6f95 Mon Sep 17 00:00:00 2001 From: Impa10r Date: Thu, 11 Apr 2024 21:50:55 +0200 Subject: [PATCH 3/4] Add Makefile --- .gitignore | 2 ++ CHANGELOG.md | 3 ++- Makefile | 2 ++ README.md | 8 ++++---- 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b39b34b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +push.sh +.vscode/tasks.json diff --git a/CHANGELOG.md b/CHANGELOG.md index ae4f205..3c356a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## 1.2.6 -- Fix conversion to millions in Peer Details +- Fix bug in conversion to millions +- Add Makefile, update installation instructions ## 1.2.5 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cd345ac --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +install: + go install ./cmd/psweb \ No newline at end of file diff --git a/README.md b/README.md index 72f1811..2b69fab 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,8 @@ Clone the repository and build PeerSwap Web UI: ```bash git clone https://github.com/Impa10r/peerswap-web && \ -cd peerswap-web/cmd/psweb && \ -go install +cd peerswap-web && \ +make install ``` This will install `psweb` to your GOPATH (/home/USER/go/bin). You can check that it is working by running `psweb --version`. If not, add the bin path in .profile and reload with `source .profile`. @@ -107,8 +107,8 @@ When a new version comes out, just build the app again and restart: ```bash rm -rf peerswap-web && \ git clone https://github.com/Impa10r/peerswap-web && \ -cd peerswap-web/cmd/psweb && \ -go install && \ +cd peerswap-web && \ +make install && \ sudo systemctl restart psweb ``` From f15c9f0497e2eaecc80168155e1a78a40b6f2543 Mon Sep 17 00:00:00 2001 From: Impa10r Date: Thu, 11 Apr 2024 22:50:15 +0200 Subject: [PATCH 4/4] Commit debug files --- .env | 1 + .gitignore | 1 - .vscode/launch.json | 18 ++++++++++++++++++ .vscode/tasks.json | 15 +++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .env create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.env b/.env new file mode 100644 index 0000000..cd2816a --- /dev/null +++ b/.env @@ -0,0 +1 @@ +DEBUG=1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index b39b34b..02e8202 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ push.sh -.vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..865f744 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Package", + "type": "go", + "request": "launch", + "mode": "auto", + "buildFlags": "-tags lnd", + "program": "${workspaceFolder}/cmd/psweb/", + "showLog": false, + "envFile": "${workspaceFolder}/.env", + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..04b054a --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "pre-commit", + "type": "shell", + "command": "${workspaceFolder}/.git/hooks/pre-commit", + "group": "none", + "presentation": { + "reveal": "never" + }, + "problemMatcher": [] + } + ] +}