Skip to content

Commit

Permalink
Feat/ adding fees module (#10)
Browse files Browse the repository at this point in the history
* Feat/ adding fees module

* lint fix
  • Loading branch information
poly-rodr authored May 4, 2023
1 parent 70a40f2 commit 8a03a29
Show file tree
Hide file tree
Showing 4 changed files with 1,091 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: git config --global url.https://[email protected]/.insteadOf https://github.com/

- name: Install Go
uses: actions/setup-go@v2
- name: Go env
uses: actions/setup-go@v4
with:
go-version: '1.16.0'
go-version: '1.16'

- name: Lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: v1.47.3
working-directory: ./pkg
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

type Contracts struct {
Exchange common.Address
FeeModule common.Address
Collateral common.Address
Conditional common.Address
}
Expand All @@ -16,12 +17,14 @@ func GetContracts(chainId int64) (*Contracts, error) {
var (
MUMBAI_CONTRACTS = &Contracts{
Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"),
FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"),
Collateral: common.HexToAddress("0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961"),
Conditional: common.HexToAddress("0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43"),
}

MATIC_CONTRACTS = &Contracts{
Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"),
FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"),
Collateral: common.HexToAddress("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"),
Conditional: common.HexToAddress("0x4D97DCd97eC945f40cF65F87097ACe5EA0476045"),
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ func TestGetContracts(t *testing.T) {
var (
mumbai = &Contracts{
Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"),
FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"),
Collateral: common.HexToAddress("0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961"),
Conditional: common.HexToAddress("0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43"),
}

matic = &Contracts{
Exchange: common.HexToAddress("0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"),
FeeModule: common.HexToAddress("0x56C79347e95530c01A2FC76E732f9566dA16E113"),
Collateral: common.HexToAddress("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"),
Conditional: common.HexToAddress("0x4D97DCd97eC945f40cF65F87097ACe5EA0476045"),
}
Expand All @@ -27,13 +29,15 @@ func TestGetContracts(t *testing.T) {
assert.NotNil(t, c)
assert.Nil(t, err)
assert.True(t, bytes.Equal(c.Exchange[:], mumbai.Exchange[:]))
assert.True(t, bytes.Equal(c.FeeModule[:], mumbai.FeeModule[:]))
assert.True(t, bytes.Equal(c.Collateral[:], mumbai.Collateral[:]))
assert.True(t, bytes.Equal(c.Conditional[:], mumbai.Conditional[:]))

c, err = GetContracts(137)
assert.NotNil(t, c)
assert.Nil(t, err)
assert.True(t, bytes.Equal(c.Exchange[:], matic.Exchange[:]))
assert.True(t, bytes.Equal(c.FeeModule[:], matic.FeeModule[:]))
assert.True(t, bytes.Equal(c.Collateral[:], matic.Collateral[:]))
assert.True(t, bytes.Equal(c.Conditional[:], matic.Conditional[:]))

Expand Down
Loading

0 comments on commit 8a03a29

Please sign in to comment.