1.0.73 • Published 2 years ago

@rskcapitalmanagement/rsk-striker-sdk v1.0.73

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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

2 years ago

1.0.72

2 years ago

1.0.71

2 years ago

1.0.70

2 years ago

1.0.69

2 years ago

1.0.68

2 years ago

1.0.67

2 years ago

1.0.66

2 years ago

1.0.65

2 years ago

1.0.64

2 years ago

1.0.63

2 years ago

1.0.62

2 years ago

1.0.61

2 years ago

1.0.60

2 years ago

1.0.59

2 years ago

1.0.58

2 years ago

1.0.57

2 years ago

1.0.56

2 years ago

1.0.55

2 years ago

1.0.54

2 years ago

1.0.53

2 years ago

1.0.52

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.49

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.40

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.33

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago