Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrZizik committed Oct 5, 2023
1 parent 1f42301 commit bfe5d11
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,14 @@ import io.mockk.every
import io.mockk.just
import io.mockk.mockk
import io.mockk.mockkObject
import io.mockk.mockkStatic
import io.mockk.runs
import jp.co.soramitsu.common.account.SoraAccount
import jp.co.soramitsu.common.logger.FirebaseWrapper
import jp.co.soramitsu.common.util.CryptoAssistant
import jp.co.soramitsu.common.util.json_decoder.JsonAccountsEncoder
import jp.co.soramitsu.feature_account_api.domain.interfaces.CredentialsDatasource
import jp.co.soramitsu.feature_blockexplorer_api.data.SoraConfigManager
//import jp.co.soramitsu.xsubstrate.encrypt.keypair.substrate.Sr25519Keypair
//import jp.co.soramitsu.xsubstrate.encrypt.keypair.substrate.SubstrateKeypairFactory
//import jp.co.soramitsu.xsubstrate.encrypt.mnemonic.Mnemonic
//import jp.co.soramitsu.xsubstrate.encrypt.mnemonic.MnemonicCreator
//import jp.co.soramitsu.xsubstrate.encrypt.seed.SeedFactory
//import jp.co.soramitsu.xsubstrate.encrypt.seed.substrate.SubstrateSeedFactory
import jp.co.soramitsu.sora.substrate.runtime.RuntimeManager
import jp.co.soramitsu.sora.substrate.substrate.deriveSeed32
import jp.co.soramitsu.test_shared.MainCoroutineRule
import jp.co.soramitsu.xsubstrate.encrypt.keypair.substrate.Sr25519Keypair
import jp.co.soramitsu.xsubstrate.encrypt.keypair.substrate.SubstrateKeypairFactory
Expand Down Expand Up @@ -108,7 +100,7 @@ class CredentialsRepositoryTest {
mockkObject(MnemonicCreator)
mockkObject(SubstrateKeypairFactory)
mockkObject(FirebaseWrapper)
mockkStatic(SubstrateSeedFactory::deriveSeed)
mockkObject(SubstrateSeedFactory)
val derivationResult = mockk<SeedFactory.Result>()
every { SubstrateSeedFactory.deriveSeed(any(), any()) } returns derivationResult
every { SubstrateKeypairFactory.generate(any(), any()) } returns keypair
Expand Down
1 change: 1 addition & 0 deletions feature_wallet_impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ dependencies {
implementation project(":feature_sora_card_api")

implementation xsubstrateDep
implementation xcryptoDep

implementation androidDep
implementation materialDep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ package jp.co.soramitsu.sora.substrate
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.google.gson.Gson
import com.neovisionaries.ws.client.WebSocketFactory
import jp.co.soramitsu.xsubstrate.extensions.fromHex
import jp.co.soramitsu.xsubstrate.runtime.definitions.types.fromByteArrayOrNull
import jp.co.soramitsu.xsubstrate.runtime.metadata.module
import jp.co.soramitsu.xsubstrate.runtime.metadata.storage
Expand All @@ -46,18 +45,17 @@ import jp.co.soramitsu.xsubstrate.wsrpc.executeAsync
import jp.co.soramitsu.xsubstrate.wsrpc.logging.Logger
import jp.co.soramitsu.xsubstrate.wsrpc.mappers.nonNull
import jp.co.soramitsu.xsubstrate.wsrpc.mappers.pojo
import jp.co.soramitsu.xsubstrate.wsrpc.mappers.scale
import jp.co.soramitsu.xsubstrate.wsrpc.recovery.Reconnector
import jp.co.soramitsu.xsubstrate.wsrpc.request.RequestExecutor
import jp.co.soramitsu.xsubstrate.wsrpc.request.runtime.RuntimeRequest
import jp.co.soramitsu.sora.substrate.runtime.Constants
import jp.co.soramitsu.sora.substrate.runtime.Pallete
import jp.co.soramitsu.test_shared.TestRuntimeProvider
import jp.co.soramitsu.xcrypto.util.fromHex
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

package jp.co.soramitsu.sora.substrate

import jp.co.soramitsu.xsubstrate.extensions.fromHex
import jp.co.soramitsu.xsubstrate.runtime.RuntimeSnapshot
import jp.co.soramitsu.xsubstrate.wsrpc.SocketService
import jp.co.soramitsu.sora.substrate.runtime.RuntimeManager
import jp.co.soramitsu.sora.substrate.substrate.SubstrateApiImpl
import jp.co.soramitsu.test_shared.RealRuntimeProvider
import jp.co.soramitsu.xcrypto.util.fromHex
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertEquals
import org.junit.Before
Expand Down
2 changes: 1 addition & 1 deletion test_shared/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {

api coroutineTestDep
api gsonDep
// api sharedUtilsDep
api xsubstrateDep

api jUnitDep
api mockitoDep
Expand Down

0 comments on commit bfe5d11

Please sign in to comment.