Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LukassF committed Sep 27, 2024
1 parent c15b83a commit 24e6adf
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 54 deletions.
Binary file added bin/act
Binary file not shown.
2 changes: 1 addition & 1 deletion sdk/apps/modal-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@aptos-labs/ts-sdk": "^1.9.1",
"@aptos-labs/wallet-standard": "^0.0.11",
"@mysten/sui": "^1.2.1",
"@mysten/sui": "1.4.0",
"@nightlylabs/nightly-connect-polkadot": "0.0.16",
"@nightlylabs/nightly-connect-solana": "0.0.29",
"@nightlylabs/nightly-connect-sui": "0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/packages/selector-sui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@mysten/sui": "^1.2.1",
"@mysten/sui": "1.4.0",
"@mysten/wallet-adapter-wallet-standard": "^0.8.0",
"@mysten/wallet-standard": "^0.12.12",
"@nightlylabs/nightly-connect-sui": "0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/packages/sui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"typescript": "^5.1.3"
},
"dependencies": {
"@mysten/sui": "^1.2.1",
"@mysten/sui": "1.4.0",
"@mysten/wallet-standard": "^0.12.12",
"@nightlylabs/nightly-connect-base": "^0.0.28",
"@noble/hashes": "^1.3.0",
Expand Down
13 changes: 5 additions & 8 deletions sdk/packages/sui/src/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { parseSerializedSignature, toSerializedSignature } from '@mysten/sui/cryptography'
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519'
import { Transaction } from '@mysten/sui/transactions'
import { fromBase64, toBase64 } from '@mysten/sui/utils'
import { fromB64, toB64 } from '@mysten/sui/utils'
import { verifyPersonalMessageSignature, verifyTransactionSignature } from '@mysten/sui/verify'
import { WalletAccount } from '@mysten/wallet-standard'
import { Connect, ContentType } from '@nightlylabs/nightly-connect-base'
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('SUI client tests', () => {
responseId: e.requestId,
signedTransactions: [
{
transactionBlockBytes: toBase64(transactionBlockBytes),
transactionBlockBytes: toB64(transactionBlockBytes),
signature: signature
}
]
Expand All @@ -92,10 +92,7 @@ describe('SUI client tests', () => {

try {
// Will throw if invalid
await verifyTransactionSignature(
fromBase64(signedTx.transactionBlockBytes),
signedTx.signature
)
await verifyTransactionSignature(fromB64(signedTx.transactionBlockBytes), signedTx.signature)
} catch (error) {
assert(false, 'Transaction block is invalid')
}
Expand All @@ -110,7 +107,7 @@ describe('SUI client tests', () => {
const signedMessage = {
messageBytes: msg,
signature: toSerializedSignature({
signature: fromBase64(signature),
signature: fromB64(signature),
signatureScheme: 'ED25519',
publicKey: alice_keypair.getPublicKey()
})
Expand All @@ -132,7 +129,7 @@ describe('SUI client tests', () => {
// Will throw if invalid
await verifyPersonalMessageSignature(
new TextEncoder().encode(msgToSign),
toBase64(parsedSignature.signature!)
toB64(parsedSignature.signature!)
)
} catch (error) {
assert(false, 'Message is invalid')
Expand Down
9 changes: 3 additions & 6 deletions sdk/packages/sui/src/http-client.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519'
import { Transaction } from '@mysten/sui/transactions'
import { fromBase64, toBase64 } from '@mysten/sui/utils'
import { fromB64, toB64 } from '@mysten/sui/utils'
import { verifyTransactionSignature } from '@mysten/sui/verify'
import { WalletAccount } from '@mysten/wallet-standard'
import { Connect, ContentType, getRandomId } from '@nightlylabs/nightly-connect-base'
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('SUI http-client tests', () => {
sessionId: app.sessionId,
signedTransactions: [
{
transactionBlockBytes: toBase64(transactionBlockBytes),
transactionBlockBytes: toB64(transactionBlockBytes),
signature: signature
}
]
Expand All @@ -93,10 +93,7 @@ describe('SUI http-client tests', () => {

try {
// Will throw if invalid
await verifyTransactionSignature(
fromBase64(signedTx.transactionBlockBytes),
signedTx.signature
)
await verifyTransactionSignature(fromB64(signedTx.transactionBlockBytes), signedTx.signature)
} catch (error) {
assert(false, 'Transaction block is invalid')
}
Expand Down
46 changes: 9 additions & 37 deletions sdk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 24e6adf

Please sign in to comment.