Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2020-01-08 15:41:07 +01:00
parent f36efbc24b
commit e220ecbb0a
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
12 changed files with 32 additions and 22 deletions

View File

@ -276,7 +276,7 @@ lint: ##@test Run code style checks
lint-fix: export TARGET := lein lint-fix: export TARGET := lein
lint-fix: ##@test Run code style checks and fix issues lint-fix: ##@test Run code style checks and fix issues
lein cljfmt fix lein cljfmt fix
test: export TARGET := lein test: export TARGET := lein
test: ##@test Run tests once in NodeJS test: ##@test Run tests once in NodeJS
lein with-profile test doo node test once lein with-profile test doo node test once

View File

@ -1253,7 +1253,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
public void isDeviceRooted(final Callback callback) { public void isDeviceRooted(final Callback callback) {
callback.invoke(rootedDevice); callback.invoke(rootedDevice);
} }
@ReactMethod @ReactMethod
public void validateMnemonic(final String seed, final Callback callback) { public void validateMnemonic(final String seed, final Callback callback) {
Log.d(TAG, "validateMnemonic"); Log.d(TAG, "validateMnemonic");

View File

@ -687,4 +687,4 @@ void RCTStatus::generateAliasAndIdenticonAsync(QString publicKey, double callbac
const char *alias = GenerateAlias({pubKey.data(), pubKey.length()}); const char *alias = GenerateAlias({pubKey.data(), pubKey.length()});
const char *identicon = Identicon({pubKey.data(), pubKey.length()}); const char *identicon = Identicon({pubKey.data(), pubKey.length()});
d->bridge->invokePromiseCallback(callbackId, QVariantList{alias, identicon}); d->bridge->invokePromiseCallback(callbackId, QVariantList{alias, identicon});
} }

View File

@ -124,7 +124,7 @@ RCT_EXPORT_METHOD(initKeystore) {
^(void) ^(void)
{ {
NSString *res = StatusgoInitKeystore(keystoreDir.path); NSString *res = StatusgoInitKeystore(keystoreDir.path);
NSLog(@"StopNode result %@", res); NSLog(@"InitKeyStore result %@", res);
}); });
} }
@ -434,7 +434,7 @@ RCT_EXPORT_METHOD(logout) {
NSLog(@"Logout() method called"); NSLog(@"Logout() method called");
#endif #endif
NSString *result = StatusgoLogout(); NSString *result = StatusgoLogout();
NSLog(@"%@", result); NSLog(@"%@", result);
} }

View File

@ -1,4 +1,4 @@
{ {
config ? {}, config ? {},
pkgs ? import ./pkgs.nix { inherit config; } pkgs ? import ./pkgs.nix { inherit config; }
}: }:

View File

@ -1,4 +1,4 @@
{ config, lib, stdenvNoCC, callPackage,status-go, { config, lib, stdenvNoCC, callPackage, status-go,
localMavenRepoBuilder, composeXcodeWrapper, mkShell, mergeSh }: localMavenRepoBuilder, composeXcodeWrapper, mkShell, mergeSh }:
let let
@ -21,7 +21,7 @@ let
fastlane fastlane
status-go.android status-go.android
status-go.ios status-go.ios
androidPlatform androidPlatform
iosPlatform iosPlatform
]; ];

View File

@ -1,10 +1,10 @@
{ mkShell, mergeSh, status-go }: { mkShell, mergeSh, status-go }:
let let
shell = mkShell { shell = mkShell {
shellHook = '' shellHook = ''
if [ -z "$RCTSTATUS_FILEPATH" ]; then if [ -z "$STATUS_GO_IOS_LIBDIR" ]; then
echo "RCTSTATUS_FILEPATH is not defined! Aborting." echo "STATUS_GO_IOS_LIBDIR is not defined! Aborting."
exit 1 exit 1
fi fi
@ -13,13 +13,13 @@ let
# Compare target folder with source to see if copying is required # Compare target folder with source to see if copying is required
if [ -d "$RCTSTATUS_DIR/$targetBasename" ] && [ -d $STATUS_REACT_HOME/ios/Pods/ ] && \ if [ -d "$RCTSTATUS_DIR/$targetBasename" ] && [ -d $STATUS_REACT_HOME/ios/Pods/ ] && \
diff -q --no-dereference --recursive $RCTSTATUS_DIR/$targetBasename/ $RCTSTATUS_FILEPATH/ > /dev/null; then diff -q --no-dereference --recursive $RCTSTATUS_DIR/$targetBasename/ $STATUS_GO_IOS_LIBDIR/ > /dev/null; then
echo "$RCTSTATUS_DIR/$targetBasename already in place" echo "$RCTSTATUS_DIR/$targetBasename already in place"
else else
sourceBasename="$(basename $RCTSTATUS_FILEPATH)" sourceBasename="$(basename $STATUS_GO_IOS_LIBDIR)"
echo "Copying $sourceBasename from Nix store to $RCTSTATUS_DIR" echo "Copying $sourceBasename from Nix store to $RCTSTATUS_DIR"
rm -rf "$RCTSTATUS_DIR/$targetBasename/" rm -rf "$RCTSTATUS_DIR/$targetBasename/"
cp -a $RCTSTATUS_FILEPATH $RCTSTATUS_DIR cp -a $STATUS_GO_IOS_LIBDIR $RCTSTATUS_DIR
chmod -R 755 "$RCTSTATUS_DIR/$targetBasename" chmod -R 755 "$RCTSTATUS_DIR/$targetBasename"
if [ "$sourceBasename" != "$targetBasename" ]; then if [ "$sourceBasename" != "$targetBasename" ]; then
mv "$RCTSTATUS_DIR/$sourceBasename" "$RCTSTATUS_DIR/$targetBasename" mv "$RCTSTATUS_DIR/$sourceBasename" "$RCTSTATUS_DIR/$targetBasename"
@ -27,5 +27,5 @@ let
fi fi
''; '';
}; };
in in
mergeSh status-go.shell [ shell ] mergeSh status-go.shell [ shell ]

View File

@ -51,8 +51,13 @@ if [[ "$TARGET" =~ (linux|windows|darwin|macos) ]]; then
nix-shell ${shellArgs[@]} --run "scripts/prepare-for-desktop-platform.sh" || exit nix-shell ${shellArgs[@]} --run "scripts/prepare-for-desktop-platform.sh" || exit
fi fi
statusGoConfig=''
if [ -n "${STATUS_GO_SRC_OVERRIDE}" ]; then if [ -n "${STATUS_GO_SRC_OVERRIDE}" ]; then
shellArgs+=("--arg config {status_go.src_override=\"${STATUS_GO_SRC_OVERRIDE}\";}") statusGoConfig+="status_go.src_override=\"${STATUS_GO_SRC_OVERRIDE}\";"
fi
if [ -n "$statusGoConfig" ]; then
shellArgs+=("--arg config {$statusGoConfig}")
fi fi
# if _NIX_ATTR is specified we shouldn't use shell.nix, the path will be different # if _NIX_ATTR is specified we shouldn't use shell.nix, the path will be different

View File

@ -1,13 +1,13 @@
# This file defines custom shells as well as shortcuts # This file defines custom shells as well as shortcuts
# for accessing more nested shells. # for accessing more nested shells.
{ {
config ? {}, config ? {},
pkgs ? import ./pkgs.nix { inherit config; } pkgs ? import ./pkgs.nix { inherit config; }
}: }:
let let
# everything else we define in nix/ dir # everything else we define in nix/ dir
targets = pkgs.callPackage ./targets.nix { }; targets = pkgs.callPackage ./targets.nix { inherit config; };
# for calling lein targets in CI or Makefile # for calling lein targets in CI or Makefile
leiningen-sh = pkgs.mkShell { leiningen-sh = pkgs.mkShell {
@ -27,7 +27,7 @@ let
name = "status-react-shell"; # for identifying all shells name = "status-react-shell"; # for identifying all shells
buildInputs = with pkgs; lib.unique ([ buildInputs = with pkgs; lib.unique ([
# core utilities that should always be present in a shell # core utilities that should always be present in a shell
bash curl wget file unzip flock git gnumake jq ncurses bash curl wget file unzip flock git gnumake jq ncurses
# build specific utilities # build specific utilities
clojure leiningen maven watchman clojure leiningen maven watchman
# other nice to have stuff # other nice to have stuff

View File

@ -131,7 +131,7 @@ let
inherit buildInputs; inherit buildInputs;
shellHook = '' shellHook = ''
# These variables are used by the iOS build preparation section in nix/mobile/ios/default.nix # These variables are used by the iOS build preparation section in nix/mobile/ios/default.nix
export RCTSTATUS_FILEPATH=${status-go-packages.ios}/lib/Statusgo.framework export STATUS_GO_IOS_LIBDIR=${status-go-packages.ios}/lib/Statusgo.framework
''; '';
}; };
}; };

View File

@ -6,8 +6,13 @@ source "$_current_dir/lib/setup/path-support.sh"
source_lib "platform.sh" source_lib "platform.sh"
statusGoConfig=''
if [ -n "${STATUS_GO_SRC_OVERRIDE}" ]; then
statusGoConfig+="status_go.src_override=\"${STATUS_GO_SRC_OVERRIDE}\";"
fi
nixOpts=( nixOpts=(
"--arg config {status_go.src_override=\"${STATUS_GO_SRC_OVERRIDE}\";}" "--arg config {${statusGoConfig}}"
"--arg env {BUILD_ENV=\"${BUILD_ENV}\";ANDROID_ABI_SPLIT=\"${ANDROID_ABI_SPLIT}\";ANDROID_ABI_INCLUDE=\"${ANDROID_ABI_INCLUDE}\";}" "--arg env {BUILD_ENV=\"${BUILD_ENV}\";ANDROID_ABI_SPLIT=\"${ANDROID_ABI_SPLIT}\";ANDROID_ABI_INCLUDE=\"${ANDROID_ABI_INCLUDE}\";}"
"--argstr build-type ${BUILD_TYPE}" "--argstr build-type ${BUILD_TYPE}"
"--argstr build-number ${BUILD_NUMBER}" "--argstr build-number ${BUILD_NUMBER}"

View File

@ -343,4 +343,4 @@
"Validate that a mnemonic conforms to BIP39 dictionary/checksum standards" "Validate that a mnemonic conforms to BIP39 dictionary/checksum standards"
[mnemonic callback] [mnemonic callback]
(log/debug "[native-module] validate-mnemonic") (log/debug "[native-module] validate-mnemonic")
(.validateMnemonic (status) mnemonic callback)) (.validateMnemonic (status) mnemonic callback))