Skip to content

Commit

Permalink
Re-enable testnet builds (#1154)
Browse files Browse the repository at this point in the history
* add testnet config and some related refactoring

* fix staging target builds on iOS

* remaining work
  • Loading branch information
v-almonacid committed Jan 19, 2021
1 parent f5940d4 commit 28d77ce
Show file tree
Hide file tree
Showing 19 changed files with 284 additions and 66 deletions.
4 changes: 4 additions & 0 deletions ios/Podfile
Expand Up @@ -44,6 +44,10 @@ target 'emurgo' do
inherit! :search_paths
# Pods for testing
end

target 'emurgo-staging' do
inherit! :complete
end

target 'emurgo-nightly' do
inherit! :complete
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Expand Up @@ -342,6 +342,6 @@ SPEC CHECKSUMS:
Sentry: 81f7f2bd3cb041137ea7efcde3aa5ad0d5a67632
yoga: 616fde658be980aa60a2158835170f3f9c2d04b4

PODFILE CHECKSUM: 2a3f32cbedbb24796d1391777367809ab3a8b1ca
PODFILE CHECKSUM: 721f1927bf5c64f7d57f8675cf52d201cf8d44c1

COCOAPODS: 1.9.1
39 changes: 39 additions & 0 deletions ios/emurgo.xcodeproj/project.pbxproj
Expand Up @@ -21,6 +21,7 @@
2EBA2AD022EA877F00BF8A5B /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2971642150620600B7C4FE /* JavaScriptCore.framework */; };
9BFE476FFB747F6055B203A4 /* libPods-emurgo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 88A95429FF52104866D7E49D /* libPods-emurgo.a */; };
B0C137C68DE95847EC884660 /* libPods-emurgo-emurgo-nightly.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B84F3B989285F57F66CF87E0 /* libPods-emurgo-emurgo-nightly.a */; };
B536838130B681A4B8A341AE /* libPods-emurgo-emurgo-staging.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92EF314B8ECF261556A866AE /* libPods-emurgo-emurgo-staging.a */; };
BA3D0647FB29475CA53128CF /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 16BAD3D7933540D184340C1B /* libresolv.tbd */; };
E2FC0BF821C7F02200DA195B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E2FC0BFA21C7F02200DA195B /* InfoPlist.strings */; };
E9A1C7DC24185CCA00151CFA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
Expand Down Expand Up @@ -73,17 +74,22 @@
2EF1204922795CAD007BE6F5 /* libSentryReactNative.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libSentryReactNative.a; sourceTree = BUILT_PRODUCTS_DIR; };
2EF1208322795DE3007BE6F5 /* libSentryReactNative.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libSentryReactNative.a; sourceTree = BUILT_PRODUCTS_DIR; };
359687B3464F4A7C89D45AF9 /* libRNRandomBytes-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNRandomBytes-tvOS.a"; sourceTree = "<group>"; };
38FA8332D0A8491079DD4CE6 /* Pods-emurgo-emurgo-staging.staging.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgo-emurgo-staging.staging.release.xcconfig"; path = "Target Support Files/Pods-emurgo-emurgo-staging/Pods-emurgo-emurgo-staging.staging.release.xcconfig"; sourceTree = "<group>"; };
3EB7D285720EC3018253DCE8 /* Pods-emurgo-emurgo-staging.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgo-emurgo-staging.debug.xcconfig"; path = "Target Support Files/Pods-emurgo-emurgo-staging/Pods-emurgo-emurgo-staging.debug.xcconfig"; sourceTree = "<group>"; };
40208C83B2A34C816931818E /* Pods-emurgo-emurgo-nightly.staging.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgo-emurgo-nightly.staging.debug.xcconfig"; path = "Target Support Files/Pods-emurgo-emurgo-nightly/Pods-emurgo-emurgo-nightly.staging.debug.xcconfig"; sourceTree = "<group>"; };
5614626E94A9488458C3C847 /* Pods-emurgo-emurgo-staging.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgo-emurgo-staging.release.xcconfig"; path = "Target Support Files/Pods-emurgo-emurgo-staging/Pods-emurgo-emurgo-staging.release.xcconfig"; sourceTree = "<group>"; };
57AEDE250E1257B118F9D5EE /* Pods-emurgoTests.staging.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgoTests.staging.debug.xcconfig"; path = "Target Support Files/Pods-emurgoTests/Pods-emurgoTests.staging.debug.xcconfig"; sourceTree = "<group>"; };
5DBE1771E1614BCAB6A3665D /* libSplashScreen.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libSplashScreen.a; sourceTree = "<group>"; };
5DBF6642BF3B4B119153FD14 /* libRNFirebase.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFirebase.a; sourceTree = "<group>"; };
5F9F4B6BEEFC4DF6A66C1383 /* libRNRandomBytes.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNRandomBytes.a; sourceTree = "<group>"; };
746923B3D658412D94D241BD /* libRNSVG-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNSVG-tvOS.a"; sourceTree = "<group>"; };
77CF8607F90E508D57EAA5A2 /* Pods-emurgo.staging.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgo.staging.debug.xcconfig"; path = "Target Support Files/Pods-emurgo/Pods-emurgo.staging.debug.xcconfig"; sourceTree = "<group>"; };
7C49D6020D63B9FB6BA277E6 /* Pods-emurgo-emurgo-staging.staging.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgo-emurgo-staging.staging.debug.xcconfig"; path = "Target Support Files/Pods-emurgo-emurgo-staging/Pods-emurgo-emurgo-staging.staging.debug.xcconfig"; sourceTree = "<group>"; };
80201ADDACC8F1043483092B /* Pods-emurgoTests.staging.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgoTests.staging.release.xcconfig"; path = "Target Support Files/Pods-emurgoTests/Pods-emurgoTests.staging.release.xcconfig"; sourceTree = "<group>"; };
8306E0AE63AA483DBF7F6BF0 /* libRNFS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNFS.a; sourceTree = "<group>"; };
84D0E245B86E495693516CD7 /* libBVLinearGradient.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libBVLinearGradient.a; sourceTree = "<group>"; };
88A95429FF52104866D7E49D /* libPods-emurgo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-emurgo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
92EF314B8ECF261556A866AE /* libPods-emurgo-emurgo-staging.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-emurgo-emurgo-staging.a"; sourceTree = BUILT_PRODUCTS_DIR; };
B84F3B989285F57F66CF87E0 /* libPods-emurgo-emurgo-nightly.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-emurgo-emurgo-nightly.a"; sourceTree = BUILT_PRODUCTS_DIR; };
BEBE63E4D9B94639A10A5296 /* Pods-emurgoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgoTests.debug.xcconfig"; path = "Target Support Files/Pods-emurgoTests/Pods-emurgoTests.debug.xcconfig"; sourceTree = "<group>"; };
C78E8C902DF33189DDE7D7E7 /* Pods-emurgo-emurgo-nightly.staging.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-emurgo-emurgo-nightly.staging.release.xcconfig"; path = "Target Support Files/Pods-emurgo-emurgo-nightly/Pods-emurgo-emurgo-nightly.staging.release.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -136,6 +142,7 @@
buildActionMask = 2147483647;
files = (
2EBA2AD022EA877F00BF8A5B /* JavaScriptCore.framework in Frameworks */,
B536838130B681A4B8A341AE /* libPods-emurgo-emurgo-staging.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -198,6 +205,7 @@
88A95429FF52104866D7E49D /* libPods-emurgo.a */,
B84F3B989285F57F66CF87E0 /* libPods-emurgo-emurgo-nightly.a */,
1FC5BB94532A4954BB77BB41 /* libPods-emurgoTests.a */,
92EF314B8ECF261556A866AE /* libPods-emurgo-emurgo-staging.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -257,6 +265,10 @@
57AEDE250E1257B118F9D5EE /* Pods-emurgoTests.staging.debug.xcconfig */,
F877CE0888C912B225811E4A /* Pods-emurgoTests.release.xcconfig */,
80201ADDACC8F1043483092B /* Pods-emurgoTests.staging.release.xcconfig */,
3EB7D285720EC3018253DCE8 /* Pods-emurgo-emurgo-staging.debug.xcconfig */,
7C49D6020D63B9FB6BA277E6 /* Pods-emurgo-emurgo-staging.staging.debug.xcconfig */,
5614626E94A9488458C3C847 /* Pods-emurgo-emurgo-staging.release.xcconfig */,
38FA8332D0A8491079DD4CE6 /* Pods-emurgo-emurgo-staging.staging.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -328,6 +340,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 2E3E7CFC2298ACEA00D5C487 /* Build configuration list for PBXNativeTarget "emurgo-staging" */;
buildPhases = (
530EB74876CC05217B90CF1B /* [CP] Check Pods Manifest.lock */,
2E3E7CD72298ACEA00D5C487 /* Sources */,
2E3E7CDA2298ACEA00D5C487 /* Frameworks */,
2E3E7CF62298ACEA00D5C487 /* Resources */,
Expand Down Expand Up @@ -491,6 +504,28 @@
shellPath = /bin/sh;
shellScript = "export DEVELOPMENT_BUILD_CONFIGURATIONS=\"+(Staging.Debug|Debug)\"\nexport NODE_BINARY=node\n../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh\n";
};
530EB74876CC05217B90CF1B /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-emurgo-emurgo-staging-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
6C8B7B6608A19809AEC03D8B /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -874,6 +909,7 @@
};
2E3E7CFD2298ACEA00D5C487 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3EB7D285720EC3018253DCE8 /* Pods-emurgo-emurgo-staging.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUNDLE_DISPLAY_NAME = Yoroi;
Expand Down Expand Up @@ -924,6 +960,7 @@
};
2E3E7CFE2298ACEA00D5C487 /* Staging.Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7C49D6020D63B9FB6BA277E6 /* Pods-emurgo-emurgo-staging.staging.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUNDLE_DISPLAY_NAME = "Yoroi Staging";
Expand Down Expand Up @@ -974,6 +1011,7 @@
};
2E3E7CFF2298ACEA00D5C487 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5614626E94A9488458C3C847 /* Pods-emurgo-emurgo-staging.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUNDLE_DISPLAY_NAME = Yoroi;
Expand Down Expand Up @@ -1025,6 +1063,7 @@
};
2E3E7D002298ACEA00D5C487 /* Staging.Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 38FA8332D0A8491079DD4CE6 /* Pods-emurgo-emurgo-staging.staging.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUNDLE_DISPLAY_NAME = "Yoroi Staging";
Expand Down
Expand Up @@ -24,6 +24,20 @@
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1BEE828C124E6416179B904A9F66D794"
BuildableName = "React"
BlueprintName = "React"
ReferencedContainer = "container:Pods/Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
Expand Down
18 changes: 3 additions & 15 deletions src/components/Delegation/StakingDashboard.js
Expand Up @@ -70,7 +70,7 @@ import walletManager, {SystemAuthDisabled} from '../../crypto/walletManager'
import globalMessages, {errorMessages} from '../../i18n/global-messages'
import {formatAdaInteger} from '../../utils/format'
import FlawedWalletScreen from './FlawedWalletScreen'
import {CONFIG} from '../../config/config'
import {CONFIG, getCardanoBaseConfig} from '../../config/config'
import {WITHDRAWAL_DIALOG_STEPS, type WithdrawalDialogSteps} from './types'
import {HaskellShelleyTxSignRequest} from '../../crypto/shelley/HaskellShelleyTxSignRequest'
import KeyStore from '../../crypto/KeyStore'
Expand Down Expand Up @@ -560,20 +560,8 @@ class StakingDashboard extends React.Component<Props, State> {
} = this.props

// TODO: shouldn't be haskell-shelley specific
const config = [
{
StartAt: CONFIG.NETWORKS.BYRON_MAINNET.START_AT,
GenesisDate: CONFIG.NETWORKS.BYRON_MAINNET.GENESIS_DATE,
SlotsPerEpoch: CONFIG.NETWORKS.BYRON_MAINNET.SLOTS_PER_EPOCH,
SlotDuration: CONFIG.NETWORKS.BYRON_MAINNET.SLOT_DURATION,
},
{
StartAt: CONFIG.NETWORKS.HASKELL_SHELLEY.START_AT,
GenesisDate: CONFIG.NETWORKS.HASKELL_SHELLEY.GENESIS_DATE,
SlotsPerEpoch: CONFIG.NETWORKS.HASKELL_SHELLEY.SLOTS_PER_EPOCH,
SlotDuration: CONFIG.NETWORKS.HASKELL_SHELLEY.SLOT_DURATION,
},
]
const config = getCardanoBaseConfig()

const toRelativeSlotNumberFn = genToRelativeSlotNumber(config)
const timeToSlotFn = genTimeToSlot(config)

Expand Down
Expand Up @@ -12,7 +12,7 @@ storiesOf('MnemonicCheckScreen', module).add(
mnemonic: CONFIG.DEBUG.MNEMONIC1,
name: CONFIG.DEBUG.WALLET_NAME,
password: CONFIG.DEBUG.PASSWORD,
networkId: CONFIG.NETWORKS.BYRON_MAINNET.NETWORK_ID,
networkId: CONFIG.NETWORKS.HASKELL_SHELLEY.NETWORK_ID,
}
return <MnemonicCheckScreen route={route} navigation={navigation} />
},
Expand Down
Expand Up @@ -12,7 +12,7 @@ storiesOf('MnemonicShowScreen', module).add(
mnemonic: CONFIG.DEBUG.MNEMONIC1,
name: CONFIG.DEBUG.WALLET_NAME,
password: CONFIG.DEBUG.PASSWORD,
networkId: CONFIG.NETWORKS.BYRON_MAINNET.NETWORK_ID,
networkId: CONFIG.NETWORKS.HASKELL_SHELLEY.NETWORK_ID,
}
return <MnemonicShowScreen route={route} navigation={navigation} />
},
Expand Down
Expand Up @@ -10,7 +10,7 @@ storiesOf('RestoreWalletScreen', module).add(
'Default',
({route, navigation}) => {
route.params = {
networkId: CONFIG.NETWORKS.BYRON_MAINNET.NETWORK_ID,
networkId: CONFIG.NETWORKS.HASKELL_SHELLEY.NETWORK_ID,
walletImplementationId:
CONFIG.WALLETS.HASKELL_SHELLEY.WALLET_IMPLEMENTATION_ID,
}
Expand Down
Expand Up @@ -12,7 +12,7 @@ storiesOf('VefifyRestoredWallet', module).add('Default', ({navigation}) => (
navigation={navigation}
route={{
params: {
networkId: CONFIG.NETWORKS.BYRON_MAINNET.NETWORK_ID,
networkId: CONFIG.NETWORKS.HASKELL_SHELLEY.NETWORK_ID,
walletImplementationId:
CONFIG.WALLETS.HASKELL_SHELLEY.WALLET_IMPLEMENTATION_ID,
phrase: cleanMnemonic(CONFIG.DEBUG.MNEMONIC3),
Expand Down
6 changes: 3 additions & 3 deletions src/components/WalletInit/WalletInitScreen.stories.js
Expand Up @@ -8,19 +8,19 @@ import WalletInitScreen from './WalletInitScreen'
import {CONFIG} from '../../config/config'

storiesOf('WalletInitScreen', module)
.add('Shelley', ({navigation}) => (
.add('Byron', ({navigation}) => (
<WalletInitScreen
navigation={navigation}
route={{
params: {
networkId: CONFIG.NETWORKS.BYRON_MAINNET.NETWORK_ID,
networkId: CONFIG.NETWORKS.HASKELL_SHELLEY.NETWORK_ID,
walletImplementationId:
CONFIG.WALLETS.HASKELL_BYRON.WALLET_IMPLEMENTATION_ID,
},
}}
/>
))
.add('Byron', ({navigation}) => (
.add('Shelley', ({navigation}) => (
<WalletInitScreen
navigation={navigation}
route={{
Expand Down

0 comments on commit 28d77ce

Please sign in to comment.