From 3ecee235504d308879309718a37b8d8c64938274 Mon Sep 17 00:00:00 2001 From: f321x Date: Sun, 9 Jun 2024 21:44:55 +0200 Subject: [PATCH] bond and nix shell --- .vscode/launch.json | 16 ++++++++++++++++ shell.nix | 20 ++++++++++++++++++-- taptrade-cli-demo/trader/src/wallet/bond.rs | 1 - 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..10efcb2 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // 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": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug", + "program": "${workspaceFolder}/", + "args": [], + "cwd": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/shell.nix b/shell.nix index 71024c5..2676669 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,10 @@ { pkgs ? import {} }: + +let + inherit (pkgs.lib) makeLibraryPath; + inherit (pkgs.lib) fileContents; + inherit (pkgs) stdenv; +in pkgs.mkShell { nativeBuildInputs = with pkgs.buildPackages; [ pkg-config @@ -9,7 +15,17 @@ rustfmt gcc ]; - RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; + + NIX_LD_LIBRARY_PATH = makeLibraryPath [ + stdenv.cc.cc + pkgs.openssl + pkgs.zlib + pkgs.pkg-config + pkgs.gcc + ]; + + RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; + NIX_LD = fileContents "${stdenv.cc}/nix-support/dynamic-linker"; } -# For VSCode and Rust Analyzer use the Extension "Nix Environment Selector" \ No newline at end of file +# For VSCode and Rust Analyzer use the Extension "Nix Environment Selector" diff --git a/taptrade-cli-demo/trader/src/wallet/bond.rs b/taptrade-cli-demo/trader/src/wallet/bond.rs index 6e870eb..a2ff5f3 100644 --- a/taptrade-cli-demo/trader/src/wallet/bond.rs +++ b/taptrade-cli-demo/trader/src/wallet/bond.rs @@ -21,7 +21,6 @@ pub struct Bond { } impl Bond { - println!("assembling bond transaction"); pub fn assemble(wallet: &Wallet, bond_target: &OfferCreationResponse, trader_input: &TraderSettings) -> Result {