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

Development #60

Merged
merged 48 commits into from
Sep 21, 2021
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b04577e
Add support for SafeFactory
rmeissner Jun 4, 2021
016f9e4
Use concrete ethersproject imports
rmeissner Jun 4, 2021
a3b4447
Merge branch 'main' into ethers_adapter_updates
germartinez Jun 10, 2021
3baaaed
wip
germartinez Jun 15, 2021
ac379eb
Merge branch 'main' into ethers_adapter_updates
germartinez Aug 30, 2021
b20b286
Remove unnecessary files
germartinez Aug 30, 2021
5950b7a
Update Safe Ethers adapters examples
germartinez Aug 30, 2021
63509dc
Merge pull request #34 from gnosis/ethers_adapter_updates
germartinez Aug 30, 2021
bcedffe
Merge branch 'main' into development
germartinez Aug 30, 2021
f886d82
v0.1.1 safe-service-client
germartinez Aug 30, 2021
46a752f
Add nonce param to methods that call createTransaction
germartinez Aug 31, 2021
1812a6d
Merge branch 'main' into development
germartinez Sep 6, 2021
214036a
Add exclude spam tokens option
germartinez Sep 6, 2021
92e8745
Add exclude spam tokens option to tests
germartinez Sep 6, 2021
8700d13
Fix get tokens tests
germartinez Sep 6, 2021
606284d
Add e2e tests config
germartinez Sep 9, 2021
fe883b8
Add decodeData tests
germartinez Sep 9, 2021
5c109e1
Add getSafesByOwner tests
germartinez Sep 9, 2021
d130bec
Update format script
germartinez Sep 9, 2021
1529be4
Add params validation
germartinez Sep 10, 2021
696d9f0
Add transactions tests
germartinez Sep 10, 2021
fe11414
Add get service info tests
germartinez Sep 10, 2021
bb2733d
Update error messages handling
germartinez Sep 10, 2021
f7a3b67
Fix SafeCollectibleResponse type
germartinez Sep 10, 2021
6f138a8
Add get balances tests
germartinez Sep 10, 2021
f428575
Add tokens tests
germartinez Sep 10, 2021
46819ce
Update incoming transactions number in e2e test
germartinez Sep 10, 2021
eca2a6b
Add github action for e2e tests
germartinez Sep 14, 2021
7de51f4
Rename test files
germartinez Sep 14, 2021
eb5ab6b
Update github workflows
germartinez Sep 14, 2021
ef62f4a
Merge pull request #64 from gnosis/service-client-e2e
germartinez Sep 14, 2021
764fb81
Add params as options
germartinez Sep 15, 2021
e72fcfe
Refactor settings trasactions parameters
germartinez Sep 15, 2021
2cf6520
Add tests to check params and options in settings transactions
germartinez Sep 15, 2021
ac17381
Refactor methods with options
germartinez Sep 15, 2021
6c82d61
Merge branch 'development' into spam-tokens
germartinez Sep 15, 2021
10eeced
Refactor exclude spam tokens conditions
germartinez Sep 15, 2021
9db9698
Merge pull request #62 from gnosis/spam-tokens
germartinez Sep 15, 2021
8236b1d
Add new type CallTransactionOptionalProps
germartinez Sep 15, 2021
d1170c4
Merge pull request #61 from gnosis/custom-nonce-methods
germartinez Sep 16, 2021
7e1453e
Check if there are enough Ether funds before executing a transaction
germartinez Sep 17, 2021
d292d69
Add tests to check if there are enough funds
germartinez Sep 17, 2021
b698093
Check if transaction value is zero
germartinez Sep 20, 2021
1e192c9
Merge pull request #65 from gnosis/tx-error-balance
germartinez Sep 20, 2021
2c30b56
Export EthAdapterTransaction
germartinez Sep 21, 2021
b845cf1
Merge pull request #68 from gnosis/export-type
germartinez Sep 21, 2021
2642b0f
v0.2.0 safe-service-client
germartinez Sep 21, 2021
bdc606b
v0.4.0 safe-core-sdk
germartinez Sep 21, 2021
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
Prev Previous commit
Next Next commit
Add tokens tests
germartinez committed Sep 10, 2021
commit f42857520e6d5d425fa6ee92ec4dabda26d3a50e
13 changes: 13 additions & 0 deletions packages/safe-service-client/e2e/get-token-list.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import chai from 'chai'
import SafeServiceClient, { TokenInfoListResponse } from '../src'
import config from './config'

describe('getTokenList', () => {
const serviceSdk = new SafeServiceClient(config.baseUrl)

it('should return an array of tokens', async () => {
const tokenInfoListResponse: TokenInfoListResponse = await serviceSdk.getTokenList()
chai.expect(tokenInfoListResponse.count).to.be.greaterThan(1)
chai.expect(tokenInfoListResponse.results.length).to.be.greaterThan(1)
})
})
28 changes: 28 additions & 0 deletions packages/safe-service-client/e2e/get-token.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import chai from 'chai'
import chaiAsPromised from 'chai-as-promised'
import SafeServiceClient, { TokenInfoResponse } from '../src'
import config from './config'

chai.use(chaiAsPromised)

describe('getToken', () => {
const serviceSdk = new SafeServiceClient(config.baseUrl)

it('should fail if token address is empty', async () => {
const tokenAddress = ''
await chai.expect(serviceSdk.getToken(tokenAddress)).to.be.rejectedWith('Invalid token address')
})

it('should fail if token address is not checksummed', async () => {
const tokenAddress = '0xc778417E063141139Fce010982780140Aa0cD5Ab'.toLowerCase()
await chai
.expect(serviceSdk.getToken(tokenAddress))
.to.be.rejectedWith('Invalid ethereum address')
})

it('should return the token info', async () => {
const tokenAddress = '0xc778417E063141139Fce010982780140Aa0cD5Ab'
const tokenInfoResponse: TokenInfoResponse = await serviceSdk.getToken(tokenAddress)
chai.expect(tokenInfoResponse.address).to.be.equal('0xc778417E063141139Fce010982780140Aa0cD5Ab')
})
})