Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor SDK in order to add support for WalletL1, WalletL2 and Wallet #14

Merged
merged 31 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
bff104a
feat: add `Wallet`, `WalletL1` and `WalletL2`
petarTxFusion Mar 14, 2024
dfdc6f9
feat(Wallet): add `getRequestExecute` and `estimateGasRequestExecute`
petarTxFusion Mar 14, 2024
a6d6adc
feat(Wallet): add `estimateGasdepositTransaction` and `getDepositTran…
petarTxFusion Mar 14, 2024
8017b48
feat: add `ZkSyncClient` and `EthereumClient`
petarTxFusion Mar 14, 2024
a2cde9a
feat: add `maxPriorityFeePerGas`
petarTxFusion Mar 14, 2024
3e72bfe
feat: add `waitforTransactionReceipt`
petarTxFusion Mar 14, 2024
178528b
feat: add `l1TokenAddress` and `l2TokenAddress`
petarTxFusion Mar 14, 2024
ce02579
feat: add `getL2HashFromPriorityOp`
petarTxFusion Mar 14, 2024
c8df281
feat: add `estimateL1ToL2Execute`
petarTxFusion Mar 14, 2024
e0b2157
feat: add `getWithdrawTx` and `estimateGasWithdraw`
petarTxFusion Mar 14, 2024
bc047a0
feat: add `getTransferTx` and `estimateGasTransfer`
petarTxFusion Mar 14, 2024
4808fd6
test: update tests
petarTxFusion Mar 14, 2024
71ead18
chore: update examples
petarTxFusion Mar 14, 2024
9f84b09
refactor!: removed deprecated `EthereumProvider` in favor of `Wallet`
petarTxFusion Mar 14, 2024
c6ab517
refactor!: removed deprecated `ZkSyncWallet` in favor of `Wallet`
petarTxFusion Mar 14, 2024
ed28c4d
feat(wallet): add `getFullRequiredDepositFee`
petarTxFusion Mar 15, 2024
65c6f8c
feat(client): add `getProof`
petarTxFusion Mar 15, 2024
3fc7503
test: add `approveERC20` test
petarTxFusion Mar 15, 2024
40f0843
test: update tests
petarTxFusion Mar 15, 2024
941f6d9
ci: update test workflow
petarTxFusion Mar 16, 2024
83c81b4
'ci: fix tests run'
petarTxFusion Mar 16, 2024
712e758
test: fix `BaseIntegrationEnv`
petarTxFusion Mar 16, 2024
41ddfec
test: update test restricitons
petarTxFusion Mar 17, 2024
27c54cf
docs(README): update README
petarTxFusion Mar 17, 2024
dc6b66e
fix(Client): `getBalance` for ERC20
petarTxFusion Mar 17, 2024
24dfa2f
test: fix tests
petarTxFusion Mar 18, 2024
9a02154
test: fix tests
petarTxFusion Mar 18, 2024
36b7651
ci: update swift.yml
petarTxFusion Mar 18, 2024
c6b314c
ci: fix workflow
petarTxFusion Mar 18, 2024
951c1fe
ci: update test workflow
petarTxFusion Mar 18, 2024
43a16f9
ci: fix tests run
petarTxFusion Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ jobs:
- uses: actions/checkout@v3
- name: Build
run: swift build -v
- name: Install Docker Compose
run: brew install docker-compose
- name: Install Docker
run: |
brew install docker
brew install docker-compose
- name: Install Colima
run: |
brew install colima
- name: Initialize Colima with Docker
run: |
colima start
- name: Run local-setup
run: |
git clone https://github.com/matter-labs/local-setup.git
Expand All @@ -30,11 +38,17 @@ jobs:
run: |
while ! curl -s -X POST -d '{"jsonrpc":"2.0","method":"net_version","id":1}' -H 'Content-Type: application/json' 0.0.0.0:3050; do sleep 1; done
- name: Run tests
run: swift test --skip-build --very-verbose --filter EIP712EncoderTests --skip EIP712EncoderTests.testEncodeDomainMemberValues;
swift test --skip-build --very-verbose --filter Transaction712Tests --skip Transaction712Tests.testSerializeToEIP712Message;
swift test --skip-build --very-verbose --filter ContractDeployerTests;
swift test --skip-build --very-verbose --filter EthereumKeystoreV3Tests;
swift test --skip-build --very-verbose --filter ZKSyncWeb3RpcIntegrationTests;
swift test --skip-build --very-verbose --filter ZkSyncWalletIntegrationTests;


run: swift test --filter EIP712EncoderTests --skip EIP712EncoderTests.testEncodeDomainMemberValues;
swift test --filter Transaction712Tests --skip Transaction712Tests.testSerializeToEIP712Message;
swift test --filter ContractDeployerTests;
swift test --filter EthereumKeystoreV3Tests;
swift test --filter ZKSyncWeb3RpcIntegrationTests;
<<<<<<< HEAD
swift test --filter ZkSyncWalletIntegrationTests;
=======
swift test --filter ZkSyncWalletIntegrationTests;
<<<<<<< HEAD
>>>>>>> 9411574 (ci: update swift.yml)
=======
>>>>>>> 55750a3 ('ci: fix tests run')
>>>>>>> ba95ae8 ('ci: fix tests run')
2 changes: 1 addition & 1 deletion Examples/CocoaPods/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ use_frameworks!
install! 'cocoapods', :warn_for_unused_master_specs_repo => false

target 'ZkSync2Example' do
pod 'zkSync2-swift', '~> 0.0.2'
pod 'zkSync2-swift', '~> 0.0.2-beta.4'
end
10 changes: 5 additions & 5 deletions Examples/CocoaPods/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ PODS:
- PromiseKit (= 6.15.3)
- secp256k1.c (~> 0.1)
- Starscream (= 4.0.4)
- zkSync2-swift (0.0.2):
- zkSync2-swift (0.0.2-beta.4):
- Alamofire (~> 5.0)
- web3swift-zksync2 (= 2.6.5-zksync2)

DEPENDENCIES:
- zkSync2-swift (~> 0.0.2)
- zkSync2-swift (~> 0.0.2-beta.4)

SPEC REPOS:
trunk:
Expand All @@ -45,8 +45,8 @@ SPEC CHECKSUMS:
secp256k1.c: db47b726585d80f027423682eb369729e61b3b20
Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9
web3swift-zksync2: 6471ef28140592e65099748068ebf3437f46af50
zkSync2-swift: 68a3356dba458901c6f9208e4325cf095cf8fcff
zkSync2-swift: 949b7ad5b52ce93408c73529511cc3af9bc09bb8

PODFILE CHECKSUM: 49160431e1d735fccf212aa76bde593998d17359
PODFILE CHECKSUM: 847fbafa84d823f673c3000bad094218fb5a9733

COCOAPODS: 1.12.1
COCOAPODS: 1.12.0
3 changes: 1 addition & 2 deletions Examples/Local/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ project 'zkSync-Demo.xcodeproj'
def project_pods
pod 'BigInt', '5.2.0'
pod 'Alamofire', '5.7.1'
pod 'CryptoSwift', '1.4.3'
pod 'PromiseKit', '6.15.3'
pod 'Starscream', '4.0.4'
pod 'secp256k1.c', '0.1.2'
pod 'web3swift-zksync2', :git => 'https://github.com/zksync-sdk/web3swift.git', :branch => '2.6.5-zksync2'
pod 'web3swift', '3.1.2'
end

target 'zkSync-Demo-Localhost' do
Expand Down
35 changes: 14 additions & 21 deletions Examples/Local/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Alamofire (5.7.1)
- BigInt (5.2.0)
- CryptoSwift (1.4.3)
- CryptoSwift (1.5.1)
- PromiseKit (6.15.3):
- PromiseKit/CorePromise (= 6.15.3)
- PromiseKit/Foundation (= 6.15.3)
Expand All @@ -13,21 +13,21 @@ PODS:
- PromiseKit/CorePromise
- secp256k1.c (0.1.2)
- Starscream (4.0.4)
- web3swift-zksync2 (2.6.5-zksync2):
- BigInt (= 5.2.0)
- CryptoSwift (= 1.4.3)
- PromiseKit (= 6.15.3)
- Web3Core (3.1.2):
- BigInt (~> 5.2.0)
- CryptoSwift (~> 1.5.1)
- secp256k1.c (~> 0.1)
- Starscream (= 4.0.4)
- web3swift (3.1.2):
- Starscream (~> 4.0.4)
- Web3Core (~> 3.1.2)

DEPENDENCIES:
- Alamofire (= 5.7.1)
- BigInt (= 5.2.0)
- CryptoSwift (= 1.4.3)
- PromiseKit (= 6.15.3)
- secp256k1.c (= 0.1.2)
- Starscream (= 4.0.4)
- web3swift-zksync2 (from `https://github.com/zksync-sdk/web3swift.git`, branch `2.6.5-zksync2`)
- web3swift (= 3.1.2)

SPEC REPOS:
trunk:
Expand All @@ -37,26 +37,19 @@ SPEC REPOS:
- PromiseKit
- secp256k1.c
- Starscream

EXTERNAL SOURCES:
web3swift-zksync2:
:branch: 2.6.5-zksync2
:git: https://github.com/zksync-sdk/web3swift.git

CHECKOUT OPTIONS:
web3swift-zksync2:
:commit: e08de937ced3ecd635f18a4f9ad2dae0520ab31b
:git: https://github.com/zksync-sdk/web3swift.git
- Web3Core
- web3swift

SPEC CHECKSUMS:
Alamofire: 0123a34370cb170936ae79a8df46cc62b2edeb88
BigInt: f668a80089607f521586bbe29513d708491ef2f7
CryptoSwift: a0799ee936271bd2253a006f1e4523df21845000
CryptoSwift: c4f2debceb38bf44c80659afe009f71e23e4a082
PromiseKit: 3b2b6995e51a954c46dbc550ce3da44fbfb563c5
secp256k1.c: db47b726585d80f027423682eb369729e61b3b20
Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9
web3swift-zksync2: 6471ef28140592e65099748068ebf3437f46af50
Web3Core: 050eb18f0434ac16c42eb7b2270fbce325935128
web3swift: 8496f6615c3a1f86e7c9e5fe16c5422ef181527b

PODFILE CHECKSUM: 089fb34c02dd5c54b334207848b0bd39edd2dad7
PODFILE CHECKSUM: ca1831d676ba8afa32dfd7b4881bda0593b359cc

COCOAPODS: 1.12.1
Loading