Skip to content

Commit

Permalink
Merge pull request #595 from input-output-hk/feature/reward-received-in
Browse files Browse the repository at this point in the history
feature: `Reward.receivedIn`
  • Loading branch information
rhyslbw authored Sep 17, 2021
2 parents 8fa2893 + e9e5715 commit 67a8777
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,14 @@
name: Epoch
column_mapping:
earnedInEpochNo: number
- name: receivedIn
using:
manual_configuration:
remote_table:
schema: public
name: Epoch
column_mapping:
receivedInEpochNo: number
- name: stakePool
using:
manual_configuration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ SELECT
stake_address.view AS "address",
reward.earned_epoch AS "earnedInEpochNo",
reward.pool_id AS pool_hash_id,
reward.spendable_epoch AS "receivedInEpochNo",
reward.type AS "type"
FROM reward
JOIN stake_address on reward.addr_id = stake_address.id;
Expand Down
3 changes: 3 additions & 0 deletions packages/api-cardano-db-hasura/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ type Reward {
address: StakeAddress!
amount: String!
earnedIn: Epoch!
receivedIn: Epoch!
stakePool: StakePool
type: String!
}
Expand Down Expand Up @@ -648,6 +649,7 @@ input Reward_bool_exp {
address: StakeAddress_comparison_exp
amount: text_comparison_exp
earnedIn: Epoch_bool_exp
receivedIn: Epoch_bool_exp
stakePool: StakePool_bool_exp
type: text_comparison_exp
}
Expand All @@ -656,6 +658,7 @@ input Reward_order_by {
address: order_by
amount: order_by
earnedIn: Epoch_order_by
receivedIn: Epoch_order_by
stakePool: StakePool_order_by
type: order_by
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ query rewardsForAddress (
earnedIn {
number
}
receivedIn {
number
}
type
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ query allStakePoolFields (
earnedIn {
number
}
receivedIn {
number
}
}
rewards_aggregate {
aggregate {
Expand Down
1 change: 1 addition & 0 deletions packages/api-cardano-db-hasura/test/rewards.query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('rewards', () => {
expect(rewards.length).toBe(5)
expect(rewards[0].stakePool.hash).toBeDefined()
expect(rewards[0].earnedIn.number).toBeDefined()
expect(rewards[0].receivedIn.number).toBeDefined()
expect(rewards[0].type).toBeDefined()
})

Expand Down

0 comments on commit 67a8777

Please sign in to comment.