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

Komenci <> Valora Integration: invites and escrow #5742

Merged
merged 148 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
ed3b7c0
[Wallet] Validate mnemonic in the app's language
Sep 25, 2020
0165347
Add language explanation for mnemonic
Sep 25, 2020
e9d56a2
Merge branch 'mnemonic-language' of https://github.com/celo-org/celo-…
tarikbellamine Sep 25, 2020
f302e51
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Sep 28, 2020
c476a1a
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Sep 28, 2020
32c3b1a
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Sep 30, 2020
aedcef2
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Oct 1, 2020
919e022
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Oct 1, 2020
5bcbdcb
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Oct 9, 2020
8a66082
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Oct 23, 2020
aebeaa0
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Oct 28, 2020
8e3e895
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Oct 29, 2020
4956591
logic changes
tarikbellamine Oct 29, 2020
94e46f1
feeding ODIS the account address instead of wallet address
tarikbellamine Oct 29, 2020
fed9f13
forwarding DEK/wallet registration through the MTW if it exists
tarikbellamine Oct 29, 2020
43405f2
finished DEK related logic. cleaned up wallet fetching logic
tarikbellamine Oct 29, 2020
6a6827b
incorporated answers to open questions. fixed tests
tarikbellamine Oct 29, 2020
ff97865
add support for edge case of no registered walletAddress + test for it
tarikbellamine Oct 29, 2020
721a5c6
code cleanup
tarikbellamine Oct 30, 2020
352a009
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Oct 30, 2020
151c50e
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Oct 30, 2020
725aeb3
Merge branch 'master' into tarikbellamine/komenci-valora-logic
tarikbellamine Oct 31, 2020
34e75d6
starting the adventure
tarikbellamine Oct 31, 2020
77aa973
continued work on verifications
tarikbellamine Nov 1, 2020
ab1d07b
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 1, 2020
94c70ed
Merge branch 'master' into tarikbellamine/komenci-valora-verification
tarikbellamine Nov 1, 2020
34902ba
bulk of first pass is done. still need to interpret error messages an…
tarikbellamine Nov 1, 2020
11c02e6
adding in Komenci DEK registration
tarikbellamine Nov 1, 2020
bf11799
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 1, 2020
d6811a9
Merge branch 'master' into tarikbellamine/komenci-valora-verification
tarikbellamine Nov 1, 2020
ba6fdfb
tidying up logic
tarikbellamine Nov 2, 2020
61cff1d
handling verification errors
tarikbellamine Nov 2, 2020
1fde3e1
more tidying
tarikbellamine Nov 2, 2020
65fe2e9
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 2, 2020
e304b45
frontend changes + build related changes
tarikbellamine Nov 3, 2020
34a43ba
more config changes
tarikbellamine Nov 3, 2020
ab93cf5
Get compiling to work
cmcewen Nov 3, 2020
64f9143
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 3, 2020
df270f7
stuff
tarikbellamine Nov 3, 2020
0627748
more stuff
tarikbellamine Nov 3, 2020
16d1932
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 3, 2020
cc0796c
pr feedback
tarikbellamine Nov 3, 2020
1072275
Merge branch 'master' into tarikbellamine/komenci-valora-logic
tarikbellamine Nov 3, 2020
821e191
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 3, 2020
d7918bc
resolve merge conflict
tarikbellamine Nov 3, 2020
09f7fe3
flow working end-to-end but still ironing out kinks
tarikbellamine Nov 4, 2020
1979680
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 4, 2020
fa2950d
organizing a bit more and fixing tests
tarikbellamine Nov 4, 2020
8e806e3
more pr feedback
tarikbellamine Nov 4, 2020
62641fb
fixing tests
tarikbellamine Nov 4, 2020
a2dc837
added util function to check for null addresses
tarikbellamine Nov 4, 2020
5266f64
working on getting resend button working
tarikbellamine Nov 4, 2020
1d71cfc
revert unwanted changes
tarikbellamine Nov 4, 2020
ecac22e
Fix dynamic require to use static path imports
yorhodes Nov 4, 2020
ea5be7e
podlocl
tarikbellamine Nov 4, 2020
d7be14d
podlock
tarikbellamine Nov 4, 2020
31053fc
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 4, 2020
81ef032
resolve conflicts and merge master
tarikbellamine Nov 4, 2020
0f4f070
fixing changes based on lastest merge
tarikbellamine Nov 4, 2020
00a02d8
enabling komenci feature and more merge compatability fixes
tarikbellamine Nov 4, 2020
0ef108a
Move some stuff around on the UI
Nov 4, 2020
de855b5
Small fixes
Nov 4, 2020
a205913
Remove console.log
Nov 4, 2020
9c3e9a0
adding a rehydrate condition for feeless
tarikbellamine Nov 4, 2020
7e18d5f
swallowing error verifying address for now
tarikbellamine Nov 5, 2020
378167d
removing forno mode enablement in verification as it appears to do no…
tarikbellamine Nov 5, 2020
d03f91e
fixed error handling
tarikbellamine Nov 5, 2020
c05130b
updating dependency graph
tarikbellamine Nov 5, 2020
cbc34f2
fixes for rehydration bug and dispatching action for extra sms
tarikbellamine Nov 5, 2020
3eb58a9
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 5, 2020
dcede3b
merging with gonza's branch
tarikbellamine Nov 5, 2020
2951c51
merging with logic branch
tarikbellamine Nov 5, 2020
fba69a6
making progress
tarikbellamine Nov 5, 2020
6e787df
pr feedback
tarikbellamine Nov 6, 2020
643908f
fixing revoke function
tarikbellamine Nov 6, 2020
3650bb4
minor edits
tarikbellamine Nov 6, 2020
94a57b6
merge with verifications branch
tarikbellamine Nov 6, 2020
6445194
editting UI on send flow and finishing up txs
tarikbellamine Nov 6, 2020
200b9c5
added escrow redemption for non-feeless verification
tarikbellamine Nov 6, 2020
67b9447
final pr feedback
tarikbellamine Nov 6, 2020
a3854d1
removing new file that belong in later PR
tarikbellamine Nov 6, 2020
6aacc40
adding nullAddress helper
tarikbellamine Nov 6, 2020
b8a9a06
Merge branch 'master' into tarikbellamine/komenci-valora-logic
mergify[bot] Nov 6, 2020
8aa6207
Merge branch 'master' into tarikbellamine/komenci-valora-logic
mergify[bot] Nov 6, 2020
7b9d319
more PR feedback
tarikbellamine Nov 6, 2020
2f8b178
Merge branch 'master' into tarikbellamine/komenci-valora-logic
mergify[bot] Nov 6, 2020
623dce0
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 6, 2020
48aa77d
Merge branch 'master' into tarikbellamine/komenci-valora-logic
mergify[bot] Nov 6, 2020
148e186
merging master and resolving conflicts
tarikbellamine Nov 6, 2020
d8bf543
Set concurrency
cmcewen Nov 6, 2020
c4c4301
merging logic branch
tarikbellamine Nov 6, 2020
ab92579
merge related cleanup
tarikbellamine Nov 7, 2020
6164384
merge with verifications branch
tarikbellamine Nov 7, 2020
5edcf35
working on pr feedback
tarikbellamine Nov 7, 2020
19e9383
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 7, 2020
a4556a7
resolving merge conflicts
tarikbellamine Nov 7, 2020
b71ab05
updating snap
tarikbellamine Nov 7, 2020
5ca4485
PR feedback
tarikbellamine Nov 7, 2020
0c82f44
password lock
cmcewen Nov 7, 2020
517d00b
update copy
tarikbellamine Nov 7, 2020
4e38b87
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 7, 2020
1c162b5
set lock to false on return
cmcewen Nov 7, 2020
d77b569
Upgrade version
cmcewen Nov 7, 2020
f95e013
podfile
cmcewen Nov 7, 2020
e6bed17
attempted fix
tarikbellamine Nov 7, 2020
bea535e
merged with verifications
tarikbellamine Nov 7, 2020
680adcf
Merge branch 'master' into tarikbellamine/komenci-valora-verification
cmcewen Nov 7, 2020
077cea0
more pr feedback
tarikbellamine Nov 7, 2020
6323ba3
update test
cmcewen Nov 7, 2020
273ca01
merge master
tarikbellamine Nov 7, 2020
a998e81
apply previous suggestion to the correct place
Nov 7, 2020
e9f8d42
Merge branch 'tarikbellamine/komenci-valora-verification' into tarikb…
cmcewen Nov 7, 2020
31fe344
fix error displayed when no escrow payments to withdraw
Nov 7, 2020
6c1b846
Merge branch 'tarikbellamine/komenci-valora-escrow' of github.com:cel…
Nov 7, 2020
3adfbff
fix undefined error when checking for escrow after verification
Nov 7, 2020
5698e99
Add pseudocode
Nov 7, 2020
0cd89d9
filling in the blanks
tarikbellamine Nov 7, 2020
531b8c3
filling in the blanks
tarikbellamine Nov 7, 2020
fc58629
fix UI bugs with verification loading
tarikbellamine Nov 8, 2020
facec92
working on debugging escrow tx failure
tarikbellamine Nov 8, 2020
678239c
unbatching withdraw and transfer txs
tarikbellamine Nov 8, 2020
3de51e1
Fetch transaction receipts as a backup to web3 (#5762)
Nov 9, 2020
ef4019d
console logging signature properties and removing gas estimation
tarikbellamine Nov 9, 2020
a449db7
Merge branch 'tarikbellamine/komenci-valora-escrow' of https://github…
tarikbellamine Nov 9, 2020
a4a3903
escrows working. need to cleanup
tarikbellamine Nov 9, 2020
bc58f82
reverting debugging edits
tarikbellamine Nov 9, 2020
de914ca
fixing bug where completion txs were being submitted with the same nonce
tarikbellamine Nov 9, 2020
fff3613
add support for callbackUrl
tarikbellamine Nov 9, 2020
8cbaacb
adding contractKit docs
tarikbellamine Nov 9, 2020
be1d688
Switch invite to use valora domain
cmcewen Nov 9, 2020
d6711ea
Merge branch 'tarikbellamine/komenci-valora-escrow' of github.com:cel…
cmcewen Nov 9, 2020
7720687
changed komenci url and fixed for loop
tarikbellamine Nov 9, 2020
304ba6b
more PR feedback
tarikbellamine Nov 9, 2020
6eb5ff2
adding new implementation addresses and moving constants to config file
tarikbellamine Nov 9, 2020
ad07230
commenting out unused function
tarikbellamine Nov 9, 2020
cc9c4b7
Fix e2e tests
Nov 9, 2020
6bd24c4
more PR feedback
tarikbellamine Nov 9, 2020
f9f01dc
Merge branch 'tarikbellamine/komenci-valora-escrow' of https://github…
tarikbellamine Nov 9, 2020
ee1c694
Add production recaptcha key
Nov 9, 2020
cc3c74b
fixing unit tests
tarikbellamine Nov 9, 2020
2462a24
Merge branch 'tarikbellamine/komenci-valora-escrow' of https://github…
tarikbellamine Nov 9, 2020
9e1553e
adding analytics
tarikbellamine Nov 10, 2020
9439db9
Merge branch 'master' of https://github.com/celo-org/celo-monorepo
tarikbellamine Nov 10, 2020
49dfdb0
resolving merge conflicts
tarikbellamine Nov 10, 2020
1b0a6bc
fix test schema
tarikbellamine Nov 10, 2020
ef9c8f7
turn off invite test
tarikbellamine Nov 10, 2020
89ca4c3
recaptcha config
cmcewen Nov 10, 2020
ecf067a
Merge branch 'master' into tarikbellamine/komenci-valora-escrow
mergify[bot] Nov 10, 2020
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
1 change: 1 addition & 0 deletions dependency-graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"dependencies": [
"@celo/contractkit",
"@celo/flake-tracker",
"@celo/komencikit",
"@celo/react-components",
"@celo/typescript",
"@celo/utils"
Expand Down
2 changes: 1 addition & 1 deletion packages/contractkit/src/explorer/block-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class BlockExplorer {
matchedAbi.signature === PROXY_SET_AND_INITIALIZE_IMPLEMENTATION_SIGNATURE &&
args.length === 2
) {
const initializeAbi = getInitializeAbiOfImplementation(contract)
const initializeAbi = getInitializeAbiOfImplementation(contract as any)
const encodedInitializeParameters = args[1].slice(10)

const { params: initializeParams } = parseDecodedParams(
Expand Down
2 changes: 1 addition & 1 deletion packages/contractkit/src/governance/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class ProposalBuilder {
) {
// Transform array of initialize arguments (if provided) into delegate call data
tx.args[1] = this.kit.web3.eth.abi.encodeFunctionCall(
getInitializeAbiOfImplementation(tx.contract),
getInitializeAbiOfImplementation(tx.contract as any),
tx.args[1]
)
}
Expand Down
65 changes: 61 additions & 4 deletions packages/contractkit/src/governance/proxy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
import { ABIDefinition } from 'web3-eth-abi'
import { AbiItem } from 'web3-utils'
import { ABI as AccountsABI } from '../generated/Accounts'
import { ABI as AttestationsABI } from '../generated/Attestations'
import { ABI as BlockchainParametersABI } from '../generated/BlockchainParameters'
import { ABI as DoubleSigningSlasherABI } from '../generated/DoubleSigningSlasher'
import { ABI as DowntimeSlasherABI } from '../generated/DowntimeSlasher'
import { ABI as ElectionABI } from '../generated/Election'
import { ABI as EpochRewardsABI } from '../generated/EpochRewards'
import { ABI as EscrowABI } from '../generated/Escrow'
import { ABI as ExchangeABI } from '../generated/Exchange'
import { ABI as FeeCurrencyWhitelistABI } from '../generated/FeeCurrencyWhitelist'
import { ABI as FreezerABI } from '../generated/Freezer'
import { ABI as GasPriceMinimumABI } from '../generated/GasPriceMinimum'
import { ABI as GoldTokenABI } from '../generated/GoldToken'
import { ABI as GovernanceABI } from '../generated/Governance'
import { ABI as LockedGoldABI } from '../generated/LockedGold'
import { ABI as MetaTransactionWalletABI } from '../generated/MetaTransactionWallet'
import { ABI as MetaTransactionWalletDeployerABI } from '../generated/MetaTransactionWalletDeployer'
import { ABI as MultiSigABI } from '../generated/MultiSig'
import { ABI as ProxyABI } from '../generated/Proxy'
import { ABI as RandomABI } from '../generated/Random'
import { ABI as RegistryABI } from '../generated/Registry'
import { ABI as ReserveABI } from '../generated/Reserve'
import { ABI as SortedOraclesABI } from '../generated/SortedOracles'
import { ABI as StableTokenABI } from '../generated/StableToken'
import { ABI as TransferWhitelistABI } from '../generated/TransferWhitelist'
import { ABI as ValidatorsABI } from '../generated/Validators'

export const GET_IMPLEMENTATION_ABI: ABIDefinition = {
constant: true,
Expand Down Expand Up @@ -63,10 +89,41 @@ export const PROXY_SET_IMPLEMENTATION_SIGNATURE = SET_IMPLEMENTATION_ABI.signatu
export const PROXY_SET_AND_INITIALIZE_IMPLEMENTATION_SIGNATURE =
SET_AND_INITIALIZE_IMPLEMENTATION_ABI.signature

export const getInitializeAbiOfImplementation = (proxyContractName: string) => {
const implementationABI = require(`../generated/${proxyContractName.replace('Proxy', '')}`)
.ABI as AbiItem[]
const initializeAbi = implementationABI.find((item) => item.name === 'initialize')
const findInitializeAbi = (items: AbiItem[]) => items.find((item) => item.name === 'initialize')

const initializeAbiMap = {
AccountsProxy: findInitializeAbi(AccountsABI),
AttestationsProxy: findInitializeAbi(AttestationsABI),
BlockchainParametersProxy: findInitializeAbi(BlockchainParametersABI),
DoubleSigningSlasherProxy: findInitializeAbi(DoubleSigningSlasherABI),
DowntimeSlasherProxy: findInitializeAbi(DowntimeSlasherABI),
ElectionProxy: findInitializeAbi(ElectionABI),
EpochRewardsProxy: findInitializeAbi(EpochRewardsABI),
EscrowProxy: findInitializeAbi(EscrowABI),
ExchangeProxy: findInitializeAbi(ExchangeABI),
FeeCurrencyWhitelistProxy: findInitializeAbi(FeeCurrencyWhitelistABI),
FreezerProxy: findInitializeAbi(FreezerABI),
GasPriceMinimumProxy: findInitializeAbi(GasPriceMinimumABI),
GoldTokenProxy: findInitializeAbi(GoldTokenABI),
GovernanceProxy: findInitializeAbi(GovernanceABI),
LockedGoldProxy: findInitializeAbi(LockedGoldABI),
MetaTransactionWalletProxy: findInitializeAbi(MetaTransactionWalletABI),
MetaTransactionWalletDeployerProxy: findInitializeAbi(MetaTransactionWalletDeployerABI),
MultiSigProxy: findInitializeAbi(MultiSigABI),
ProxyProxy: findInitializeAbi(ProxyABI),
RandomProxy: findInitializeAbi(RandomABI),
RegistryProxy: findInitializeAbi(RegistryABI),
ReserveProxy: findInitializeAbi(ReserveABI),
SortedOraclesProxy: findInitializeAbi(SortedOraclesABI),
StableTokenProxy: findInitializeAbi(StableTokenABI),
TransferWhitelistProxy: findInitializeAbi(TransferWhitelistABI),
ValidatorsProxy: findInitializeAbi(ValidatorsABI),
}

export const getInitializeAbiOfImplementation = (
proxyContractName: keyof typeof initializeAbiMap
) => {
const initializeAbi = initializeAbiMap[proxyContractName]
if (!initializeAbi) {
throw new Error(`Initialize method not found on implementation of ${proxyContractName}`)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/komencikit/src/kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export class KomenciKit {
const accounts = await this.contractKit.contracts.getAccounts()
return this.submitMetaTransaction(
metaTxWalletAddress,
accounts.setAccount(name, dataEncryptionKey, walletAddress, proofOfPossession).txo
accounts.setAccount(name, dataEncryptionKey, walletAddress, proofOfPossession)
)
}

Expand Down
36 changes: 15 additions & 21 deletions packages/komencikit/src/verifyWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,26 @@ import { Address, normalizeAddress } from '@celo/base'
import { Err, Ok, Result } from '@celo/base/lib/result'
import { ContractKit } from '@celo/contractkit'
import { GET_IMPLEMENTATION_ABI } from '@celo/contractkit/lib/governance/proxy'
import Proxy from '@celo/protocol/build/contracts/Proxy.json'
import {
InvalidBytecode,
InvalidImplementation,
InvalidSigner,
WalletValidationError,
} from './errors'
import { InvalidImplementation, InvalidSigner, WalletValidationError } from './errors'

export const verifyWallet = async (
contractKit: ContractKit,
walletAddress: Address,
metaTxWalletAddress: Address,
allowedImplementations: Address[],
expectedSigner: Address
): Promise<Result<true, WalletValidationError>> => {
const code = await contractKit.web3.eth.getCode(walletAddress)
// const code = await contractKit.web3.eth.getCode(metaTxWalletAddress)
// XXX: I'm unsure whether this is safe or if we should store the
// bytecode as a constant in `mobile` and pass it into KomenciKit
// I'm unsure if we should protect from the `Proxy` contract output
// in protocol from changing, or there are already constraints put in
// place for that not to happen.
if (stripBzz(code) !== stripBzz(Proxy.deployedBytecode)) {
return Err(new InvalidBytecode(walletAddress))
}
// if (stripBzz(code) !== stripBzz(Proxy.deployedBytecode)) {
// return Err(new InvalidBytecode(metaTxWalletAddress))
// }

const actualImplementationRaw = await contractKit.web3.eth.call({
to: walletAddress,
to: metaTxWalletAddress,
data: GET_IMPLEMENTATION_ABI.signature,
})
const actualImplementation = normalizeAddress(
Expand All @@ -42,25 +36,25 @@ export const verifyWallet = async (
if (normalizedAllowedImplementations.indexOf(actualImplementation) === -1) {
return Err(
new InvalidImplementation(
walletAddress,
metaTxWalletAddress,
actualImplementation,
normalizedAllowedImplementations
)
)
}

const wallet = await contractKit.contracts.getMetaTransactionWallet(walletAddress)
const wallet = await contractKit.contracts.getMetaTransactionWallet(metaTxWalletAddress)
const actualSigner = normalizeAddress(await wallet.signer())
const normalizedExpectedSigner = normalizeAddress(expectedSigner)
if (actualSigner !== normalizedExpectedSigner) {
return Err(new InvalidSigner(walletAddress, actualSigner, normalizedExpectedSigner))
return Err(new InvalidSigner(metaTxWalletAddress, actualSigner, normalizedExpectedSigner))
}

return Ok(true)
}

function stripBzz(bytecode: string): string {
// The actual deployed bytecode always differs because of the BZZ prefix
// https://www.shawntabrizi.com/ethereum/verify-ethereum-contracts-using-web3-js-and-solc/
return bytecode.split('a265627a7a72315820')[0]
}
// function stripBzz(bytecode: string): string {
// // The actual deployed bytecode always differs because of the BZZ prefix
// // https://www.shawntabrizi.com/ethereum/verify-ethereum-contracts-using-web3-js-and-solc/
// return bytecode.split('a265627a7a72315820')[0]
// }
1 change: 1 addition & 0 deletions packages/mobile/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
plugins: [[require('@babel/plugin-proposal-decorators').default, { legacy: true }]],
presets: ['module:metro-react-native-babel-preset'],
}
4 changes: 2 additions & 2 deletions packages/mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ SPEC CHECKSUMS:
Analytics: fcf79ebc393a7d77befb8d43ce296353ba9ede3d
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CeloBlockchain: 84bc1cf8faace08aeecdeb24a30f0492b4c266cf
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: 4aab18c93cd9546e4bfed752b4084585eca8b245
FBReactNativeSpec: 5465d51ccfeecb7faa12f9ae0024f2044ce4044e
Firebase: 458d109512200d1aca2e1b9b6cf7d68a869a4a46
Expand All @@ -774,7 +774,7 @@ SPEC CHECKSUMS:
FirebaseMessaging: 089b7a4991425783384acc8bcefcd78c0af913bd
FirebaseStorage: 93fe2f8190a01bfb2b2c4932df7d679744c4ef1d
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
GoogleAppMeasurement: dfe55efa543e899d906309eaaac6ca26d249862f
GoogleDataTransport: 061fe7d9b476710e3cd8ea51e8e07d8b67c2b420
GoogleDataTransportCCTSupport: 0f39025e8cf51f168711bd3fb773938d7e62ddb5
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/locales/en-US/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"invalidPhone": "Invalid phone number",
"cantSelectInvalidPhone": "Cannot select contact: invalid phone number",
"needMoreFundsToSend": "Need more funds to send payment",
"maxEscrowTransferExceeded": "The maximum amount to transfer to unverified users is {{symbol}}{{maxAmount}}",
"invalidAmount": "Invalid amount",
"invalidCode": "Invalid Verification Code",
"confirm": "Confirm",
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/locales/es-419/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"invalidPhone": "Número de teléfono inválido",
"cantSelectInvalidPhone": "No se puede seleccionar el contacto: número de teléfono no válido",
"needMoreFundsToSend": "Necesita más fondos para enviar el pago",
"maxEscrowTransferExceeded": "La cantidad máxima a transferir a usuarios no verificados es de {{symbol}}{{maxAmount}}",
"invalidAmount": "Monto invalido",
"invalidCode": "Código de verificación inválido",
"confirm": "Confirmar",
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const cwd = path.resolve(__dirname)
const root = path.resolve(cwd, '../..')
const escapedRoot = escapeStringRegexp(root)
const celoRegex = new RegExp(
`${escapedRoot}\/packages\/(?!mobile|utils|base|contractkit|react-components).*`
`${escapedRoot}\/packages\/(?!mobile|utils|base|contractkit|komencikit|react-components).*`
)
const nestedRnRegex = new RegExp(`.*\/node_modules\/.*\/node_modules\/(react-native)\/.*`)
const componentsRnRegex = new RegExp(`.*react-components\/node_modules\/(react-native)\/.*`)
Expand Down
2 changes: 2 additions & 0 deletions packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"dependencies": {
"@celo/client": "0.0.317",
"@celo/contractkit": "0.4.19-dev",
"@celo/komencikit": "0.0.1-dev",
"@celo/react-components": "1.0.0",
"@celo/react-native-sms-retriever": "git+https://github.com/celo-org/react-native-sms-retriever#b88e502",
"@celo/utils": "0.1.23-dev",
Expand Down Expand Up @@ -151,6 +152,7 @@
},
"devDependencies": {
"@apollo/react-testing": "^3.1.3",
"@babel/plugin-proposal-decorators":"^7.12.1",
"@celo/flake-tracker": "0.0.1-dev",
"@celo/typescript": "0.0.1",
"@graphql-codegen/add": "^1.10.0",
Expand Down
78 changes: 78 additions & 0 deletions packages/mobile/src/account/__snapshots__/Settings.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4467,6 +4467,84 @@ exports[`Account renders correctly when verification is not possible 1`] = `
</View>
</View>
</View>
<View
style={
Object {
"backgroundColor": "#FFFFFF",
}
}
>
<View
accessible={true}
focusable={true}
nativeBackgroundAndroid={
Object {
"attribute": "selectableItemBackgroundBorderless",
"type": "ThemeAttrAndroid",
}
}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
>
<View
style={
Object {
"borderBottomColor": "#EDEEEF",
"borderBottomWidth": 1,
"marginLeft": 16,
"paddingVertical": 16,
}
}
>
<View
style={
Object {
"alignItems": "center",
"flexDirection": "row",
"justifyContent": "space-between",
"paddingRight": 16,
}
}
>
<View
style={
Array [
Object {
"justifyContent": "center",
},
]
}
>
<Text
style={
Object {
"color": "#2E3338",
"fontFamily": "Inter-Regular",
"fontSize": 16,
"lineHeight": 22,
}
}
>
confirmNumber
</Text>
</View>
<View
style={
Object {
"alignItems": "center",
"flexDirection": "row",
}
}
/>
</View>
</View>
</View>
</View>
<View
style={
Object {
Expand Down
30 changes: 30 additions & 0 deletions packages/mobile/src/account/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export enum Actions {
SET_PINCODE_SUCCESS = 'ACCOUNT/SET_PINCODE_SUCCESS',
SET_PINCODE_FAILURE = 'ACCOUNT/SET_PINCODE_FAILURE',
SET_ACCOUNT_CREATION_TIME = 'ACCOUNT/SET_ACCOUNT_CREATION_TIME',
INITIALIZE_ACCOUNT = 'ACCOUNT/INITIALIZE_ACCOUNT',
INITIALIZE_ACCOUNT_SUCCESS = 'ACCOUNT/INITIALIZE_ACCOUNT_SUCCESS',
INITIALIZE_ACCOUNT_FAILURE = 'ACCOUNT/INITIALIZE_ACCOUNT_FAILURE',
SET_BACKUP_COMPLETED = 'ACCOUNT/SET_BACKUP_COMPLETED',
SET_BACKUP_DELAYED = 'ACCOUNT/SET_BACKUP_DELAYED',
TOGGLE_BACKUP_STATE = 'ACCOUNT/TOGGLE_BACKUP_STATE',
Expand Down Expand Up @@ -73,6 +76,18 @@ export interface SetPincodeFailureAction {
type: Actions.SET_PINCODE_FAILURE
}

export interface InitializeAccountAction {
type: Actions.INITIALIZE_ACCOUNT
}

export interface InitializeAccountSuccessAction {
type: Actions.INITIALIZE_ACCOUNT_SUCCESS
}

export interface InitializeAccountFailureAction {
type: Actions.INITIALIZE_ACCOUNT_FAILURE
}

export interface SetAccountCreationAction {
type: Actions.SET_ACCOUNT_CREATION_TIME
}
Expand Down Expand Up @@ -133,6 +148,9 @@ export type ActionTypes =
| SetPincodeAction
| SetPincodeSuccessAction
| SetPincodeFailureAction
| InitializeAccountAction
| InitializeAccountSuccessAction
| InitializeAccountFailureAction
| SetAccountCreationAction
| SetBackupCompletedAction
| SetBackupDelayedAction
Expand Down Expand Up @@ -206,6 +224,18 @@ export const setPincodeFailure = (): SetPincodeFailureAction => ({
type: Actions.SET_PINCODE_FAILURE,
})

export const initializeAccount = (): InitializeAccountAction => ({
type: Actions.INITIALIZE_ACCOUNT,
})

export const initializeAccountSuccess = (): InitializeAccountSuccessAction => ({
type: Actions.INITIALIZE_ACCOUNT_SUCCESS,
})

export const initializeAccountFailure = (): InitializeAccountFailureAction => ({
type: Actions.INITIALIZE_ACCOUNT_FAILURE,
})

export const setAccountCreationTime = (): SetAccountCreationAction => ({
type: Actions.SET_ACCOUNT_CREATION_TIME,
})
Expand Down
Loading