Skip to content

Commit

Permalink
Merge pull request #161 from palladians/chore/wiosna
Browse files Browse the repository at this point in the history
Chore/wiosna
  • Loading branch information
mrcnk authored Apr 9, 2024
2 parents c508773 + 3b099ea commit 31e3744
Show file tree
Hide file tree
Showing 72 changed files with 28 additions and 2,225 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/packages-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Wait for Mina Network readiness
uses: o1-labs/wait-for-mina-network-action@v1
with:
mina-graphql-port: 8080
mina-graphql-port: 3085

- name: Check Mina Accounts Manager readiness
run: |
Expand All @@ -77,31 +77,17 @@ jobs:
"variables": { "publicKey": "'"${PUBLIC_KEY}"'" }
}' \
$NODE_URL
- name: Fetch Transactions and Set Environment Variables
env:
PUBLIC_KEY: ${{ env.PUBLIC_KEY }}
ARCHIVE_NODE_URL: http://localhost:8282
run: |
curl -X POST -H "Content-Type: application/json" \
--data '{
"query": "query Transactions($address: String!, $limit: Int) { transactions(query: { canonical: true, OR: [{ to: $address }, { from: $address }] } limit: $limit sortBy: DATETIME_DESC) { amount to token kind isDelegation hash from fee failureReason dateTime blockHeight } }",
"variables": { "address": "'"${PUBLIC_KEY}"'", "limit": 1 }
}' \
$ARCHIVE_NODE_URL
- name: Run Account Provider Tests
env:
PUBLIC_KEY: ${{ env.PUBLIC_KEY }}
NODE_URL: http://127.0.0.1:8080/graphql
ARCHIVE_NODE_URL: http://127.0.0.1:8282/graphql
TX_HASH: ${{ env.TX_HASH }}
TX_ID: ${{ env.TX_ID }}

run: |
cd packages/mina-graphql
pnpm test:unit test/Providers/AccountInfoProvider.test.ts
cd packages/providers/test/mina-node/l1-mina-node/individual-providers
pnpm test:unit account-info-provider.test.ts
- name: Upload Mina logs
if: always()
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ This is a monorepo for all the Pallad-related code.
- `features` - Wallet features, views, and UI components.
- `key-management` - Blockchain agnostic key management.
- `mina-core` - Core Mina Package SDK.
- `mina-graphql` - GraphQL API client for the Mina Protocol.
- `multi-chain-core` - Foundation for hosting multiple blockchains.
- `offchain-data` - Client for fetching off-chain data like fiat price.
- `persistence` - Persistence logic for wallet related data.
- `util` - Shared util functions for other packages.
Expand Down
2 changes: 0 additions & 2 deletions packages/features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
"@jitsu/jitsu-react": "^1.7.2",
"@palladxyz/key-management": "^0.0.1",
"@palladxyz/mina-core": "^0.0.1",
"@palladxyz/mina-graphql": "^0.0.1",
"@palladxyz/multi-chain-core": "^0.0.1",
"@palladxyz/offchain-data": "^1.0.0",
"@palladxyz/persistence": "^1.0.0",
"@palladxyz/vault": "^0.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { zodResolver } from '@hookform/resolvers/zod'
import { ChainOperationArgs } from '@palladxyz/key-management'
import { Mina } from '@palladxyz/mina-core'
import { Multichain } from '@palladxyz/multi-chain-core'
import { useVault } from '@palladxyz/vault'
import { addHours } from 'date-fns'
import { Loader2Icon } from 'lucide-react'
Expand All @@ -28,7 +27,6 @@ import { cn } from '@/lib/utils'
import { ConfirmTransactionSchema } from './confirm-transaction-form.schema'

type ConfirmTransactionData = z.infer<typeof ConfirmTransactionSchema>
// TODO: Refactor to not use multichain package and use new signing args
export const ConfirmTransactionForm = () => {
const { track } = useAnalytics()
const [submitting, setSubmitting] = useState(false)
Expand Down Expand Up @@ -63,7 +61,7 @@ export const ConfirmTransactionForm = () => {
const amount = BigInt(rawAmount * 1_000_000_000).toString()
const fee = BigInt(rawFee * 1_000_000_000).toString()
const onSubmit: SubmitHandler<ConfirmTransactionData> = async (data) => {
const transaction: Multichain.MultiChainTransactionBody = {
const transaction: Mina.TransactionBody = {
to: outgoingTransaction.to,
from: publicKey,
memo: outgoingTransaction.memo,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Multichain } from '@palladxyz/multi-chain-core'
import { Mina } from '@palladxyz/mina-core'

import { useAccount } from '@/common/hooks/use-account'

import { structurizeTransactions } from '../utils/structurize-transactions'
import { TxTile } from './tx-tile'

interface TransactionsListProps {
// TODO: Refactor to not use multichain package and use new signing args
transactions: Multichain.MultiChainTransactionBody[]
transactions: Mina.TransactionBody[]
}

export const TransactionsList = ({ transactions }: TransactionsListProps) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Multichain } from '@palladxyz/multi-chain-core'
import { Mina } from '@palladxyz/mina-core'
import dayjs from 'dayjs'
import { groupBy, map, pipe } from 'rambda'

Expand All @@ -13,8 +13,7 @@ export const structurizeTransaction = ({
tx,
walletPublicKey
}: {
// TODO: remove the multichain package from this file
tx: Multichain.MultiChainTransactionBody
tx: Mina.TransactionBody
walletPublicKey: string
}) => ({
...tx,
Expand All @@ -30,11 +29,11 @@ export const structurizeTransaction = ({
})

export const structurizeTransactions = ([txs, walletPublicKey]: [
Multichain.MultiChainTransactionBody[],
Mina.TransactionBody[],
string
]) =>
pipe(
map((tx: Multichain.MultiChainTransactionBody) =>
map((tx: Mina.TransactionBody) =>
structurizeTransaction({ tx, walletPublicKey })
),
groupBy((tx) => tx.date)
Expand Down
103 changes: 0 additions & 103 deletions packages/mina-graphql/README.md

This file was deleted.

42 changes: 0 additions & 42 deletions packages/mina-graphql/package.json

This file was deleted.

Loading

0 comments on commit 31e3744

Please sign in to comment.