Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Funkatronics committed Oct 20, 2023
1 parent cff8dea commit df863d0
Showing 1 changed file with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,20 @@ class MobileWalletAdapterViewModel(application: Application) : AndroidViewModel(
associationUri
)

val config = MobileWalletAdapterConfig(
10,
10,
arrayOf(MobileWalletAdapterConfig.LEGACY_TRANSACTION_VERSION, 0),
LOW_POWER_NO_CONNECTION_TIMEOUT_MS,
arrayOf(ProtocolContract.FEATURE_ID_SIGN_TRANSACTIONS)
)

scenario = if (BuildConfig.PROTOCOL_VERSION == SessionProperties.ProtocolVersion.LEGACY) {
// manually create the scenario here so we can override the association protocol version
// this forces ProtocolVersion.LEGACY to simulate a wallet using walletlib 1.x (for testing)
LocalWebSocketServerScenario(
getApplication<FakeWalletApplication>().applicationContext,
MobileWalletAdapterConfig(
10,
10,
arrayOf(MobileWalletAdapterConfig.LEGACY_TRANSACTION_VERSION, 0),
LOW_POWER_NO_CONNECTION_TIMEOUT_MS,
arrayOf(ProtocolContract.FEATURE_ID_SIGN_TRANSACTIONS)
),
config,
AuthIssuerConfig("fakewallet"),
MobileWalletAdapterScenarioCallbacks(),
associationUri.associationPublicKey,
Expand All @@ -79,13 +81,7 @@ class MobileWalletAdapterViewModel(application: Application) : AndroidViewModel(
} else {
associationUri.createScenario(
getApplication<FakeWalletApplication>().applicationContext,
MobileWalletAdapterConfig(
10,
10,
arrayOf(MobileWalletAdapterConfig.LEGACY_TRANSACTION_VERSION, 0),
LOW_POWER_NO_CONNECTION_TIMEOUT_MS,
arrayOf(ProtocolContract.FEATURE_ID_SIGN_TRANSACTIONS)
),
config,
AuthIssuerConfig("fakewallet"),
MobileWalletAdapterScenarioCallbacks()
)
Expand Down

0 comments on commit df863d0

Please sign in to comment.