diff --git a/library/src/androidTest/java/org/xmtp/android/library/ClientTest.kt b/library/src/androidTest/java/org/xmtp/android/library/ClientTest.kt index a1c7655f6..e4a68f9f9 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/ClientTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/ClientTest.kt @@ -161,6 +161,7 @@ class ClientTest { val client = runBlocking { Client().createOrBuild( account = fakeWallet, + address = fakeWallet.address, options = options ) } diff --git a/library/src/androidTest/java/org/xmtp/android/library/SmartContractWalletTest.kt b/library/src/androidTest/java/org/xmtp/android/library/SmartContractWalletTest.kt index 82411fc50..f0eb83596 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/SmartContractWalletTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/SmartContractWalletTest.kt @@ -29,6 +29,7 @@ class SmartContractWalletTest { val davonSCWClient = runBlocking { Client().createOrBuild( account = davonSCW, + address = davonSCW.walletAddress, options = ClientOptions( ClientOptions.Api(XMTPEnvironment.LOCAL, false), enableV3 = true, diff --git a/library/src/androidTest/java/org/xmtp/android/library/TestHelpers.kt b/library/src/androidTest/java/org/xmtp/android/library/TestHelpers.kt index ac37705e1..2eeccabff 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/TestHelpers.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/TestHelpers.kt @@ -15,6 +15,8 @@ import org.xmtp.android.library.messages.PrivateKey import org.xmtp.android.library.messages.PrivateKeyBuilder import org.xmtp.android.library.messages.Signature import org.xmtp.android.library.messages.Topic +import org.xmtp.android.library.messages.consentProofText +import org.xmtp.android.library.messages.ethHash import org.xmtp.android.library.messages.toPublicKeyBundle import org.xmtp.android.library.messages.walletAddress import org.xmtp.proto.message.contents.SignatureOuterClass @@ -71,7 +73,7 @@ class FakeSCWWallet( override val isSmartContractWallet: Boolean get() = true - override var chainId: Long = 1L + override var chainId: Long = 31337L companion object { fun generate( @@ -91,10 +93,7 @@ class FakeSCWWallet( DefaultGasProvider() ).send() - val randomHash = ByteArray(32) - SecureRandom().nextBytes(randomHash) - - val replaySafeHash = smartWallet.replaySafeHash(randomHash).send() + val replaySafeHash = smartWallet.replaySafeHash(data).send() val signedHash = Sign.signMessage(replaySafeHash, credentials.ecKeyPair) val signatureKey = KeyUtil.getSignatureBytes(signedHash) @@ -107,7 +106,7 @@ class FakeSCWWallet( } override suspend fun sign(message: String): Signature { - val digest = message.toByteArray(Charsets.UTF_8).sha256() + val digest = Signature.newBuilder().build().ethHash(message) return sign(digest) } diff --git a/library/src/androidTest/java/org/xmtp/android/library/V3ClientTest.kt b/library/src/androidTest/java/org/xmtp/android/library/V3ClientTest.kt index f260d4968..e57552c49 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/V3ClientTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/V3ClientTest.kt @@ -52,6 +52,7 @@ class V3ClientTest { boV3Client = runBlocking { Client().createOrBuild( account = boV3Wallet, + address = boV3Wallet.address, options = ClientOptions( ClientOptions.Api(XMTPEnvironment.LOCAL, false), enableV3 = true,