Skip to content

Commit 73b3879

Browse files
author
Adrian Nagy
committed
fix(graphql): split voting for serialization for grapqhl
1 parent 36a61bc commit 73b3879

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

ledger/src/account/common.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ impl VotingFor {
3838
}
3939

4040
pub fn to_base58check(&self) -> String {
41-
// let state_hash = mina_p2p_messages::v2::StateHash::from_fp(self.0);
42-
// state_hash.to_string()
43-
// TODO(adonagy): is this correct?
41+
let state_hash = mina_p2p_messages::v2::StateHash::from_fp(self.0);
42+
state_hash.to_string()
43+
}
44+
45+
pub fn to_base58check_graphql(&self) -> String {
46+
// NOTE: See https://github.com/MinaProtocol/mina/blob/fb1c3c0a408c344810140bdbcedacc532a11be91/src/lib/mina_graphql/types.ml#L1528
4447
let receipt_chain_hash = ReceiptChainHash(self.0);
4548
let receipt_chain_hash = mina_p2p_messages::v2::ReceiptChainHash::from(receipt_chain_hash);
4649
receipt_chain_hash.to_string()

node/native/src/graphql/account.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl TryFrom<ledger::Account> for GraphQLAccount {
214214
delegate_account: value.delegate.map(|d| GraphQLDelegateAccount {
215215
public_key: d.into_address(),
216216
}),
217-
voting_for: value.voting_for.to_base58check(),
217+
voting_for: value.voting_for.to_base58check_graphql(),
218218
timing: GraphQLTiming::from(value.timing),
219219
permissions: GraphQLPermissions::from(value.permissions),
220220
// zkapp: value.zkapp.map(GraphQLZkAppAccount::from),

0 commit comments

Comments
 (0)