Pass dictionary instead of just a string as failure dapp callback #6467

pull/6469/head
Krypto Pank 2 years ago
parent f4051152d6
commit 5071432fa1
  1. 7
      AlphaWallet/Browser/ViewControllers/BrowserViewController.swift
  2. 2
      Podfile
  3. 8
      Podfile.lock

@ -150,15 +150,12 @@ final class BrowserViewController: UIViewController {
}
func notifyFinish(callbackID: Int, value: Swift.Result<DappCallback, JsonRpcError>) {
let script: String = {
switch value {
case .success(let result):
return "executeCallback(\(callbackID), null, \"\(result.value.object)\")"
webView.evaluateJavaScript("executeCallback(\(callbackID), null, \"\(result.value.object)\")")
case .failure(let error):
return "executeCallback(\(callbackID), \"\(error.message)\", null)"
webView.evaluateJavaScript("executeCallback(\(callbackID), {message: \"\(error.message)\", code: \(error.code)}, null)")
}
}()
webView.evaluateJavaScript(script, completionHandler: nil)
}
func reload() {

@ -11,7 +11,7 @@ target 'AlphaWallet' do
pod 'QRCodeReaderViewController', :git=>'https://github.com/AlphaWallet/QRCodeReaderViewController.git', :commit=>'30d1a2a7d167d0d207ae0ae3a4d81bcf473d7a65'
pod 'KeychainSwift', :git=>'https://github.com/AlphaWallet/keychain-swift.git', :commit=> 'b797d40a9d08ec509db4335140cf2259b226e6a2'
pod 'Kingfisher', '~> 7.0'
pod 'AlphaWalletWeb3Provider', :git=>'https://github.com/AlphaWallet/AlphaWallet-web3-provider', :commit => '9a4496d02b7ddb2f6307fd0510d8d7c9fcef9870'
pod 'AlphaWalletWeb3Provider', :git=>'https://github.com/AlphaWallet/AlphaWallet-web3-provider', :commit => 'bdb38b06eeedeb4ca1e32d3ecd81783b5116ae68'
pod 'TrezorCrypto', :git=>'https://github.com/AlphaWallet/trezor-crypto-ios.git', :commit => '50c16ba5527e269bbc838e80aee5bac0fe304cc7'
pod 'TrustKeystore', :git => 'https://github.com/AlphaWallet/latest-keystore-snapshot', :commit => 'c0bdc4f6ffc117b103e19d17b83109d4f5a0e764'
pod 'SAMKeychain'

@ -218,7 +218,7 @@ DEPENDENCIES:
- AlphaWalletShareExtensionCore (from `.`)
- AlphaWalletTrackAPICalls (from `.`)
- AlphaWalletWeb3 (from `.`)
- AlphaWalletWeb3Provider (from `https://github.com/AlphaWallet/AlphaWallet-web3-provider`, commit `9a4496d02b7ddb2f6307fd0510d8d7c9fcef9870`)
- AlphaWalletWeb3Provider (from `https://github.com/AlphaWallet/AlphaWallet-web3-provider`, commit `bdb38b06eeedeb4ca1e32d3ecd81783b5116ae68`)
- BigInt (~> 3.1)
- Charts
- EthereumABI (from `https://github.com/AlphaWallet/EthereumABI.git`, commit `877b77e8e7cbc54ab0712d509b74fec21b79d1bb`)
@ -318,7 +318,7 @@ EXTERNAL SOURCES:
AlphaWalletWeb3:
:path: "."
AlphaWalletWeb3Provider:
:commit: 9a4496d02b7ddb2f6307fd0510d8d7c9fcef9870
:commit: bdb38b06eeedeb4ca1e32d3ecd81783b5116ae68
:git: https://github.com/AlphaWallet/AlphaWallet-web3-provider
EthereumABI:
:commit: 877b77e8e7cbc54ab0712d509b74fec21b79d1bb
@ -347,7 +347,7 @@ EXTERNAL SOURCES:
CHECKOUT OPTIONS:
AlphaWalletWeb3Provider:
:commit: 9a4496d02b7ddb2f6307fd0510d8d7c9fcef9870
:commit: bdb38b06eeedeb4ca1e32d3ecd81783b5116ae68
:git: https://github.com/AlphaWallet/AlphaWallet-web3-provider
EthereumABI:
:commit: 877b77e8e7cbc54ab0712d509b74fec21b79d1bb
@ -441,6 +441,6 @@ SPEC CHECKSUMS:
WalletConnectSwiftV2: 52e67915f8d861ed3ba4eabb0f69fee0990f0a5f
xcbeautify: b2c6b50c9cab6414296898e94cd153e4ea879662
PODFILE CHECKSUM: ad23d195bb504301a0822c595bca600f109b4f58
PODFILE CHECKSUM: ba2913918cee4456ab48a2a7a9ddd2a8db74ea79
COCOAPODS: 1.11.3

Loading…
Cancel
Save