Merge pull request #2162 from AlphaWallet/remove-test-code-to-support-overriding-tokenscript-for-activities-by-bundling

Remove test code used to support overriding TokenScript files for activities by bundling them in the app
pull/2166/head
James Sangalli 4 years ago committed by GitHub
commit e45c493c48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      AlphaWallet/TokenScriptClient/Models/Activity.swift
  2. 6
      AlphaWallet/TokenScriptClient/Models/AssetDefinitionDiskBackingStore.swift

@ -93,12 +93,3 @@ struct Activity {
}
}
}
//TODO We can use the repo server instead and remove this after testing
extension Constants {
static let erc20ContractsSupportingActivities: [(address: AlphaWallet.Address, server: RPCServer, tokenScript: String)] = [
//(address: AlphaWallet.Address(string: "0x6b175474e89094c44da98b954eedeac495271d0f")!, server: .main, tokenScript: (try! String(contentsOf: R.file.daiTsml()!))),
//(address: AlphaWallet.Address(uncheckedAgainstNullAddress: "0x0000000000000000000000000000000000000000")!, server: .main, tokenScript: (try! String(contentsOf: R.file.ethTsml()!))),
//(address: AlphaWallet.Address(uncheckedAgainstNullAddress: "0x3a3a65aab0dd2a17e3f1947ba16138cd37d08c04")!, server: .main, tokenScript: (try! String(contentsOf: R.file.aETHTsml()!))),
]
}

@ -126,12 +126,6 @@ class AssetDefinitionDiskBackingStore: AssetDefinitionBackingStore {
subscript(contract: AlphaWallet.Address) -> String? {
get {
if isOfficial {
if let (_, _, tokenScript: tokenScript) = Constants.erc20ContractsSupportingActivities.first(where: { $0.address.sameContract(as: contract) }) {
return tokenScript
}
}
//TODO this is the bundled version of the XDai bridge. Should remove it when the repo server can server action-only TokenScripts
if isOfficial && contract.sameContract(as: Constants.nativeCryptoAddressInDatabase) {
if cachedVersionOfXDaiBridgeTokenScript == nil {

Loading…
Cancel
Save