Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//# init --protocol-version 70 --accounts A --simulator --num-custom-validator-accounts 2

//# run-graphql
{
epoch(epochId: 0) {
epochId
validatorSet {
activeValidators {
nodes {
name
# todo DVX-1697 populate reportRecords
reportRecords {
nodes {
name
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
source: external-crates/move/crates/move-transactional-test-runner/src/framework.rs
---
processed 2 tasks

init:
A: object(0,0), validator_0: object(0,1), validator_1: object(0,2)

task 1, lines 6-24:
//# run-graphql
Response: {
"data": {
"epoch": {
"epochId": 0,
"validatorSet": {
"activeValidators": {
"nodes": [
{
"name": "validator-0",
"reportRecords": {
"nodes": []
}
},
{
"name": "validator-1",
"reportRecords": {
"nodes": []
}
}
]
}
}
}
}
}
4 changes: 4 additions & 0 deletions crates/sui-indexer-alt-graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4128,6 +4128,10 @@ type Validator implements IAddressable {
"""
projectUrl: String
"""
Other validators this validator has reported.
"""
reportRecords(first: Int, before: String, last: Int, after: String): ValidatorConnection
"""
The epoch stake rewards will be added here at the end of each epoch.
"""
rewardsPool: BigInt
Expand Down
13 changes: 8 additions & 5 deletions crates/sui-indexer-alt-graphql/src/api/types/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,20 @@ impl Epoch {
return Ok(None);
};

let validator_set_v1 = match system_state {
SuiSystemState::V1(inner) => inner.validators,
SuiSystemState::V2(inner) => inner.validators,
let (validator_set_v1, report_records) = match system_state {
SuiSystemState::V1(inner) => (inner.validators, inner.validator_report_records),
SuiSystemState::V2(inner) => (inner.validators, inner.validator_report_records),
#[cfg(msim)]
SuiSystemState::SimTestV1(_)
| SuiSystemState::SimTestShallowV2(_)
| SuiSystemState::SimTestDeepV2(_) => return Ok(None),
};

let validator_set =
ValidatorSet::from_validator_set_v1(self.scope.clone(), validator_set_v1);
let validator_set = ValidatorSet::from_validator_set_v1(
self.scope.clone(),
validator_set_v1,
report_records,
);

Ok(Some(validator_set))
}
Expand Down
Loading
Loading