Skip to content

Commit

Permalink
feat: upgrade pool endpoint and add pool snapshot
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Kungla <marko.kungla@gmail.com>
  • Loading branch information
mkungla committed Oct 3, 2022
1 parent 3798209 commit 18e51b3
Show file tree
Hide file tree
Showing 6 changed files with 533 additions and 44 deletions.
47 changes: 40 additions & 7 deletions .github/workflows/test-guild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,46 @@ jobs:
strategy:
matrix:
test:
- TestAssets
- TestAssetAddresses
- TestAssetInfo
- TestAssetHistory
- TestAssetPolicyInfo
- TestAssetSummary
- TestAssetTxs
- Assets
- AssetAddresses
- AssetInfo
- AssetHistory
- AssetPolicyInfo
- AssetSummary
- AssetTxs
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: actions/checkout@v3
- run: go test -v -covermode atomic -coverprofile coverage.txt -run Test${{ matrix.test }}
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
flags: "${{ env.KOIOS_NETWORK }},${{ github.job }},${{ matrix.test }}"
name: "${{ env.KOIOS_NETWORK }}-${{ github.job }}-${{ matrix.test }}"
files: ./coverage.txt
env_vars: KOIOS_NETWORK
fail_ci_if_error: true

pool:
runs-on: ubuntu-latest
needs:
# just to limit concurrent check groups to 3
- address
strategy:
matrix:
test:
- Pools
- PoolSnapshot
- PoolInfo
- PoolDelegators
- PoolDelegatorsHistory
- PoolBlocks
- PoolHistory
- PoolUpdates
- PoolRelays
- PoolMetadata
steps:
- uses: actions/setup-go@v3
with:
Expand Down
47 changes: 40 additions & 7 deletions .github/workflows/test-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,46 @@ jobs:
strategy:
matrix:
test:
- TestAssets
- TestAssetAddresses
- TestAssetInfo
- TestAssetHistory
- TestAssetPolicyInfo
- TestAssetSummary
- TestAssetTxs
- Assets
- AssetAddresses
- AssetInfo
- AssetHistory
- AssetPolicyInfo
- AssetSummary
- AssetTxs
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: actions/checkout@v3
- run: go test -v -covermode atomic -coverprofile coverage.txt -run Test${{ matrix.test }}
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
flags: "${{ env.KOIOS_NETWORK }},${{ github.job }},${{ matrix.test }}"
name: "${{ env.KOIOS_NETWORK }}-${{ github.job }}-${{ matrix.test }}"
files: ./coverage.txt
env_vars: KOIOS_NETWORK
fail_ci_if_error: true

pool:
runs-on: ubuntu-latest
needs:
# just to limit concurrent check groups to 3
- address
strategy:
matrix:
test:
- Pools
- PoolSnapshot
- PoolInfo
- PoolDelegators
- PoolDelegatorsHistory
- PoolBlocks
- PoolHistory
- PoolUpdates
- PoolRelays
- PoolMetadata
steps:
- uses: actions/setup-go@v3
with:
Expand Down
47 changes: 40 additions & 7 deletions .github/workflows/test-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,46 @@ jobs:
strategy:
matrix:
test:
- TestAssets
- TestAssetAddresses
- TestAssetInfo
- TestAssetHistory
- TestAssetPolicyInfo
- TestAssetSummary
- TestAssetTxs
- Assets
- AssetAddresses
- AssetInfo
- AssetHistory
- AssetPolicyInfo
- AssetSummary
- AssetTxs
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: actions/checkout@v3
- run: go test -v -covermode atomic -coverprofile coverage.txt -run Test${{ matrix.test }}
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
flags: "${{ env.KOIOS_NETWORK }},${{ github.job }},${{ matrix.test }}"
name: "${{ env.KOIOS_NETWORK }}-${{ github.job }}-${{ matrix.test }}"
files: ./coverage.txt
env_vars: KOIOS_NETWORK
fail_ci_if_error: true

pool:
runs-on: ubuntu-latest
needs:
# just to limit concurrent check groups to 3
- address
strategy:
matrix:
test:
- Pools
- PoolSnapshot
- PoolInfo
- PoolDelegators
- PoolDelegatorsHistory
- PoolBlocks
- PoolHistory
- PoolUpdates
- PoolRelays
- PoolMetadata
steps:
- uses: actions/setup-go@v3
with:
Expand Down
12 changes: 12 additions & 0 deletions koios_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ func networkTxHashes() []koios.TxHash {
}
return hash
}
func networkPoolID() koios.PoolID {

switch os.Getenv("KOIOS_NETWORK") {
case "guild":
return "pool1xc9eywck4e20tydz4yvh5vfe0ep8whawvwz8wqkc9k046a2ypp4"
case "testnet":
return "pool102llj7e7a0mmxssjvjkv2d6lppuh6cz6q9xwc3tsksn0jqwz9eh"
default:
// mainnet
return "pool155efqn9xpcf73pphkk88cmlkdwx4ulkg606tne970qswczg3asc"
}
}

func networkAddresses() []koios.Address {
var addrs []koios.Address
Expand Down
Loading

0 comments on commit 18e51b3

Please sign in to comment.