Skip to content

Commit

Permalink
Merge pull request #136 from VerusCoin/dev
Browse files Browse the repository at this point in the history
v1.0.1
  • Loading branch information
Asherda authored Oct 14, 2023
2 parents 4adfd63 + ee27349 commit 1872097
Show file tree
Hide file tree
Showing 107 changed files with 5,814 additions and 1,007 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import com.android.build.OutputFile

def versionMajor = 1
def versionMinor = 0
def versionRevision = 0
def versionBuild = 1
def versionRevision = 1
def versionBuild = 0

def keystorePropertiesFile = rootProject.file("keystore.properties");

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
compileSdkVersion = 33
targetSdkVersion = 33

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
Expand Down
4 changes: 3 additions & 1 deletion env/main.android.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "1.0.0-1",
"APP_VERSION": "1.0.1",
"ELECTRUM_PROTOCOL_CHANGE": 1.4,

"KEY_DERIVATION_VERSION": 1,
Expand Down Expand Up @@ -28,6 +28,7 @@
},

"ETH_HOMESTEAD": "homestead",
"ETH_GOERLI": "goerli",
"VERUSID_NETWORK_DEFAULT": "VRSC",

"BIOMETRIC_SECURITY_THRESHOLD": "SECURE_HARDWARE",
Expand All @@ -46,6 +47,7 @@
"NOTIFICATIONS_STORAGE_INTERNAL_KEY": "notifications",
"WIDGET_STORAGE_INTERNAL_KEY": "widgets",
"CURRENCY_DEFINITION_STORAGE_INTERNAL_KEY": "currencyDefinitions",
"CONTRACT_DEFINITION_STORAGE_INTERNAL_KEY": "ethereumContractDefinitions",

"WYRE_ACCESSIBLE": true
}
4 changes: 3 additions & 1 deletion env/main.ios.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "1.0.0-1",
"APP_VERSION": "1.0.1",
"ELECTRUM_PROTOCOL_CHANGE": 1.4,

"KEY_DERIVATION_VERSION": 1,
Expand Down Expand Up @@ -28,6 +28,7 @@
},

"ETH_HOMESTEAD": "homestead",
"ETH_GOERLI": "goerli",
"VERUSID_NETWORK_DEFAULT": "VRSC",

"BIOMETRIC_SECURITY_THRESHOLD": "SECURE_HARDWARE",
Expand All @@ -46,6 +47,7 @@
"NOTIFICATIONS_STORAGE_INTERNAL_KEY": "notifications",
"WIDGET_STORAGE_INTERNAL_KEY": "widgets",
"CURRENCY_DEFINITION_STORAGE_INTERNAL_KEY": "currencyDefinitions",
"CONTRACT_DEFINITION_STORAGE_INTERNAL_KEY": "ethereumContractDefinitions",

"WYRE_ACCESSIBLE": true
}
12 changes: 6 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ PODS:
- React
- react-native-cameraroll (5.0.4):
- React-Core
- react-native-image-picker (4.0.6):
- react-native-image-picker (5.7.0):
- React-Core
- react-native-netinfo (6.0.2):
- React-Core
Expand Down Expand Up @@ -354,7 +354,7 @@ PODS:
- React-Core
- RNFS (2.18.0):
- React
- RNGestureHandler (2.8.0):
- RNGestureHandler (2.9.0):
- React-Core
- RNKeychain (6.2.0):
- React
Expand Down Expand Up @@ -813,7 +813,7 @@ SPEC CHECKSUMS:
React-logger: 98f663b292a60967ebbc6d803ae96c1381183b6d
react-native-camera: a49f960eb362b9fbff87667c0ce639eef1161530
react-native-cameraroll: 38b40d9033e4077b6c603f92f95c6d05fa7907df
react-native-image-picker: a6e56460d34905c849ada551db30897dc7f3d535
react-native-image-picker: 3269f75c251cdcd61ab51b911dd30d6fff8c6169
react-native-netinfo: 92e6e4476eb8bf6fc2d7c0a6ca0a1406f663d73a
react-native-randombytes: 421f1c7d48c0af8dbcd471b0324393ebf8fe7846
react-native-safe-area-context: f0906bf8bc9835ac9a9d3f97e8bde2a997d8da79
Expand All @@ -837,7 +837,7 @@ SPEC CHECKSUMS:
RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f
RNDateTimePicker: e073697ac3e8a378968d68ab0581fef542b8af8a
RNFS: 3ab21fa6c56d65566d1fb26c2228e2b6132e5e32
RNGestureHandler: 62232ba8f562f7dea5ba1b3383494eb5bf97a4d3
RNGestureHandler: 071d7a9ad81e8b83fe7663b303d132406a7d8f39
RNKeychain: b8e0711b959a19c5b057d1e970d3c83d159b6da5
RNOS: 728cdea6d232de48cfede274443dbe3f669b86e9
RNPermissions: 4b54095940aea8c03fa3e6c92d4ac3647b31ed4e
Expand Down Expand Up @@ -866,6 +866,6 @@ SPEC CHECKSUMS:
Yoga: c4d61225a466f250c35c1ee78d2d0b3d41fe661c
ZcashLightClientKit: 4e4273f2e841e982fedad461a9008cca19089f5c

PODFILE CHECKSUM: 2ea7addfb99cd8f4e5f9742ed28cac88e62bc28c
PODFILE CHECKSUM: 2dd5cff0057e34322095c85f7a7d5ca86846e0e1

COCOAPODS: 1.11.3
COCOAPODS: 1.13.0
4 changes: 3 additions & 1 deletion ios/assets/env/main.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"APP_VERSION": "1.0.0-1",
"APP_VERSION": "1.0.1",
"ELECTRUM_PROTOCOL_CHANGE": 1.4,

"KEY_DERIVATION_VERSION": 1,
Expand Down Expand Up @@ -28,6 +28,7 @@
},

"ETH_HOMESTEAD": "homestead",
"ETH_GOERLI": "goerli",
"VERUSID_NETWORK_DEFAULT": "VRSC",

"BIOMETRIC_SECURITY_THRESHOLD": "SECURE_HARDWARE",
Expand All @@ -46,6 +47,7 @@
"NOTIFICATIONS_STORAGE_INTERNAL_KEY": "notifications",
"WIDGET_STORAGE_INTERNAL_KEY": "widgets",
"CURRENCY_DEFINITION_STORAGE_INTERNAL_KEY": "currencyDefinitions",
"CONTRACT_DEFINITION_STORAGE_INTERNAL_KEY": "ethereumContractDefinitions",

"WYRE_ACCESSIBLE": true
}
8 changes: 4 additions & 4 deletions ios/verusMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 3;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = J8Y97B5NMQ;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -721,7 +721,7 @@
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-webview\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/rn-fetch-blob\"",
);
MARKETING_VERSION = 1.0.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.verusmobile;
PRODUCT_NAME = verusmobile;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -740,7 +740,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 3;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = J8Y97B5NMQ;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -792,7 +792,7 @@
"\"${PODS_CONFIGURATION_BUILD_DIR}/react-native-webview\"",
"\"${PODS_CONFIGURATION_BUILD_DIR}/rn-fetch-blob\"",
);
MARKETING_VERSION = 1.0.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.verusmobile;
PRODUCT_NAME = verusmobile;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "verusmobile",
"version": "1.0.0",
"version": "1.0.1",
"private": true,
"scripts": {
"postinstall": "./node_modules/.bin/rn-nodeify --hack --install --yarn && npx jetify",
Expand Down Expand Up @@ -73,9 +73,9 @@
"react-native-elements": "1.0.0",
"react-native-format-currency": "https://github.com/michaeltout/react-native-format-currency.git",
"react-native-fs": "2.18.0",
"react-native-gesture-handler": "2.8.0",
"react-native-gesture-handler": "2.9.0",
"react-native-haptic-feedback": "1.11.0",
"react-native-image-picker": "4.0.6",
"react-native-image-picker": "5.7.0",
"react-native-keyboard-aware-scroll-view": "0.9.5",
"react-native-keychain": "6.2.0",
"react-native-level-fs": "3.0.0",
Expand Down
10 changes: 8 additions & 2 deletions src/VerusMobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { NavigationContainer } from "@react-navigation/native";
import LoadingModal from "./components/LoadingModal/LoadingModal";
import { CoinDirectory } from "./utils/CoinData/CoinDirectory";
import { removeInactiveCurrencyDefinitions } from "./utils/asyncStore/currencyDefinitionStorage";
import { removeInactiveContractDefinitions } from "./utils/asyncStore/contractDefinitionStorage";

class VerusMobile extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -107,8 +108,13 @@ class VerusMobile extends React.Component {
clearCachedVersions()
.then(async () => {
await clearCachedVrpcResponses()
await removeInactiveCurrencyDefinitions(await purgeUnusedCoins())
await CoinDirectory.populateCurrencyDefinitionsFromStorage()

const usedCoins = await purgeUnusedCoins()
await removeInactiveCurrencyDefinitions(usedCoins)
await removeInactiveContractDefinitions(usedCoins)

await CoinDirectory.populateEthereumContractDefinitionsFromStorage()
await CoinDirectory.populatePbaasCurrencyDefinitionsFromStorage()

return initCache()
})
Expand Down
39 changes: 36 additions & 3 deletions src/actions/actions/UserData.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const setTestnetOverrides = async (userID, testnetOverrides) => {
})
.catch(err => reject(err));
});
}
};

export const deleteProfile = async (account, dispatch) => {
// Clear existing account lifecycles
Expand Down Expand Up @@ -205,7 +205,37 @@ export const fetchUsers = () => {
: user.keyDerivationVersion,
disabledServices:
user.disabledServices == null ? {} : user.disabledServices,
testnetOverrides: user.testnetOverrides == null ? {} : user.testnetOverrides,
testnetOverrides:
user.testnetOverrides == null ? {} : user.testnetOverrides,
};
} else {
return user;
}
});

await setUsers(users);
}

// Update testnet overrides to include ETH
if (
users.some(
value =>
value.testnetOverrides != null &&
value.testnetOverrides.hasOwnProperty('VRSC') &&
!value.testnetOverrides.hasOwnProperty('ETH'),
)
) {
console.warn('Updating testnet profile to account for goerli ETH');

users = users.map(user => {
if (
user.testnetOverrides != null &&
user.testnetOverrides.hasOwnProperty('VRSC') &&
!user.testnetOverrides.hasOwnProperty('ETH')
) {
return {
...user,
testnetOverrides: {...user.testnetOverrides, ETH: 'GETH'},
};
} else {
return user;
Expand Down Expand Up @@ -300,7 +330,10 @@ export const authenticateAccount = async (account, password) => {
? {}
: {[WYRE_SERVICE_ID]: true}
: account.disabledServices,
testnetOverrides: account.testnetOverrides == null ? {} : account.testnetOverrides,
testnetOverrides:
account.testnetOverrides == null
? {}
: account.testnetOverrides,
},
await initSession(password),
),
Expand Down
35 changes: 33 additions & 2 deletions src/actions/actions/account/dispatchers/account.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LOADING_ACCOUNT, VALIDATING_ACCOUNT } from "../../../../utils/constants/constants";
import { ADDRESS_BLOCKLIST_FROM_WEBSERVER, LOADING_ACCOUNT, VALIDATING_ACCOUNT } from "../../../../utils/constants/constants";
import { signIntoAuthenticatedAccount } from "../../../actionCreators";
import { COIN_MANAGER_MAP, fetchActiveCoins, setUserCoins } from "../../coins/Coins";
import {
Expand All @@ -13,6 +13,7 @@ import { fetchUsers, validateLogin } from "../../UserData";
import { initSettings, saveGeneralSettings } from "../../WalletSettings";
import { DISABLED_CHANNELS } from '../../../../../env/index'
import store from "../../../../store";
import { getAddressBlocklistFromServer } from "../../../../utils/api/channels/general/addressBlocklist/getAddressBlocklist";

export const initializeAccountData = async (
account,
Expand Down Expand Up @@ -40,7 +41,37 @@ export const initializeAccountData = async (
);
const {activeCoinsForUser} = setUserCoinsAction.payload;

store.dispatch(await initSettings());
const settingsAction = await initSettings()
store.dispatch(settingsAction);

try {
const { addressBlocklistDefinition, addressBlocklist } = store.getState().settings.generalWalletSettings;

if (addressBlocklistDefinition.type === ADDRESS_BLOCKLIST_FROM_WEBSERVER) {
const fetchedBlocklist = await getAddressBlocklistFromServer();
const currentBlocklist = [...addressBlocklist];

for (const address of fetchedBlocklist) {
if (currentBlocklist.find(x => x.address === address) == null) {
currentBlocklist.unshift({
address,
details: '',
lastModified: Math.floor(Date.now() / 1000)
});
}
}

const saveGeneralSettingsAction = await saveGeneralSettings({
addressBlocklist: currentBlocklist
});

store.dispatch(saveGeneralSettingsAction);
}
} catch(e) {
console.warn("Failed to fetch address blocklist");
console.warn(e);
}

store.dispatch(accountAuthenticator);
store.dispatch(coinList);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
export const initErc20Wallet = async (coinObj) => {
Store.dispatch({
type: INIT_ERC20_CHANNEL_START,
payload: { chainTicker: coinObj.id, contractAddress: coinObj.currency_id }
payload: { chainTicker: coinObj.id, contractAddress: coinObj.currency_id, network: coinObj.network }
})

return
Expand All @@ -16,7 +16,7 @@ export const initErc20Wallet = async (coinObj) => {
export const closeErc20Wallet = async (coinObj) => {
Store.dispatch({
type: CLOSE_ERC20_CHANNEL,
payload: { chainTicker: coinObj.id, contractAddress: coinObj.currency_id }
payload: { chainTicker: coinObj.id, contractAddress: coinObj.currency_id, network: coinObj.network }
})

return
Expand Down
21 changes: 20 additions & 1 deletion src/actions/actions/sendModal/dispatchers/sendModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ import {
SEND_MODAL_SHOW_EXPORTTO_FIELD,
SEND_MODAL_SHOW_VIA_FIELD,
SEND_MODAL_PRICE_ESTIMATE,
SEND_MODAL_ADVANCED_FORM
SEND_MODAL_ADVANCED_FORM,
SEND_MODAL_CONTRACT_ADDRESS_FIELD,
ADD_ERC20_TOKEN_MODAL,
SEND_MODAL_SHOW_MAPPING_FIELD
} from '../../../../utils/constants/sendModal';
import {
CLOSE_SEND_COIN_MODAL,
Expand Down Expand Up @@ -97,6 +100,7 @@ export const openConvertOrCrossChainSendModal = (coinObj, subWallet, data) => {
[SEND_MODAL_SHOW_CONVERTTO_FIELD]: true,
[SEND_MODAL_SHOW_EXPORTTO_FIELD]: true,
[SEND_MODAL_SHOW_VIA_FIELD]: true,
[SEND_MODAL_SHOW_MAPPING_FIELD]: true,
[SEND_MODAL_ADVANCED_FORM]: false
}
: data,
Expand Down Expand Up @@ -135,6 +139,21 @@ export const openAddPbaasCurrencyModal = (coinObj, data) => {
);
};

export const openAddErc20TokenModal = (coinObj, data) => {
openSendModal(
`Add ERC20 Token`,
coinObj,
null,
data == null
? {
[SEND_MODAL_CONTRACT_ADDRESS_FIELD]: '',
}
: data,
ADD_ERC20_TOKEN_MODAL,
'To add an ERC20 token to your wallet, enter its contract address here and press continue.',
);
};

export const openProvisionIdentityModal = (coinObj, req) => {
openSendModal(
`Request VerusID`,
Expand Down
Loading

0 comments on commit 1872097

Please sign in to comment.