1.0.73 • Published 4 years ago

@rskcapitalmanagement/rsk-striker-sdk v1.0.73

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Striker-SDK

About

This repo contains files including const, interfaces, types etc. that are shared between striker and striker-api.

Testing

In order to test components that deal directly with RPC nodes, we use Hardhat. The tests use mocha and chai and are located in ./hardhat/test.

The command to execute the test suite locally is:

npm run hh-test-[eth, polygon]

This command will spin up a hardhat node, which forks the Ethereum mainnet at a particular block number (see ./hardhat/hardhat.config.ts).

Tests can obtain an RPC provider which is configured to interact with this test node like so:

import { ethers } from 'hardhat';

const provider = ethers.provider;

At startup, Hardhat provisions 20 test wallets, each with a balance of 10,000 ETH. Tests can get a reference to the array of Signers like so:

import { ethers } from 'hardhat';

const signers = ethers.signers;

In most cases, you'll want to reset the Hardhat fork before executing a new test. To do this, you can use a utility function located in ./hardhat/test/test.util.ts:

describe('YourTestSuite', () => {
    beforeEach(async () => {
        await resetFork();
    });

    it('YourTestCase', async () => {
        ...
    });
});
1.0.73

4 years ago

1.0.72

4 years ago

1.0.71

4 years ago

1.0.70

4 years ago

1.0.69

4 years ago

1.0.68

4 years ago

1.0.67

4 years ago

1.0.66

4 years ago

1.0.65

4 years ago

1.0.64

4 years ago

1.0.63

4 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.55

4 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.51

4 years ago

1.0.50

4 years ago

1.0.49

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago