-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Smart contract wallet support (#304)
* bump version * get on the latest bindings * add the defaults * bump version * Fix kt lint error that was blocking build * allow block number to be optional * bump version again * write a test for it * probably just want the bytes that were passed directly * bump * bump the lib as well * add real smart contract wallet test * add the binary files * need to fix the signature issue * make the signing key optional * get on the latest version * new binaries * a few more tweaks to the sign functions * maybe getting closer * Fix failing SCW test * Fix anvil command * dump the bindings again * update the client to create and a seperate to build * get the tests cleaned up * remove the read me * dumpt he v * make optional * get all the tests working * fix the linter * rename * add other types to the wallet for future identities --------- Co-authored-by: koleok <[email protected]> Co-authored-by: Nicholas Molnar <[email protected]>
- Loading branch information
1 parent
a7f2e3c
commit 492c797
Showing
27 changed files
with
3,573 additions
and
1,337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<application | ||
android:networkSecurityConfig="@xml/network_security_config"> | ||
</application> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
library/src/androidTest/java/org/xmtp/android/library/SmartContractWalletTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.xmtp.android.library | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import kotlinx.coroutines.runBlocking | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class SmartContractWalletTest { | ||
@Test | ||
fun testCanCreateASCW() { | ||
val key = byteArrayOf( | ||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, | ||
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, | ||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, | ||
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F | ||
) | ||
val context = InstrumentationRegistry.getInstrumentation().targetContext | ||
val davonSCW = FakeSCWWallet.generate() | ||
val options = ClientOptions( | ||
ClientOptions.Api(XMTPEnvironment.LOCAL, false), | ||
enableV3 = true, | ||
appContext = context, | ||
dbEncryptionKey = key | ||
) | ||
val davonSCWClient = runBlocking { | ||
Client().createV3( | ||
account = davonSCW, | ||
options = options | ||
) | ||
} | ||
val davonSCWClient2 = runBlocking { | ||
Client().buildV3( | ||
address = davonSCW.address, | ||
chainId = davonSCW.chainId, | ||
options = options | ||
) | ||
} | ||
|
||
assertEquals(davonSCWClient.inboxId, davonSCWClient2.inboxId) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
634 changes: 634 additions & 0 deletions
634
library/src/androidTest/java/org/xmtp/android/library/artifact/CoinbaseSmartWallet.java
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.