Skip to content

Commit

Permalink
accounts: iterate ordinal
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroShkvorets committed Mar 22, 2023
1 parent 6d73e12 commit 02da68a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion accounts/src/sinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ use crate::accounts::Accounts;
pub fn kv_out( accounts: Accounts) -> Result<KvOperations, Error> {
let mut kv_ops: KvOperations = Default::default();

let mut ordinal = 1;
for account in accounts.accounts {
log::debug!("account={:?}", account);
let value = proto::encode(&account).unwrap();
kv_ops.push_new(account.name, value, 1);
kv_ops.push_new(account.name, value, ordinal);
ordinal += 1;
}

Ok(kv_ops)
Expand Down
2 changes: 1 addition & 1 deletion accounts/substreams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ modules:
inputs:
- map: map_accounts
output:
type: proto:sf.substreams.sink.kv.v1.KVOperations
type: proto:substreams.sink.kv.v1.KVOperations

- name: prom_out
kind: map
Expand Down

0 comments on commit 02da68a

Please sign in to comment.