Skip to content

Commit

Permalink
Merge pull request #53 from ElrondNetwork/add-altered-account-struct
Browse files Browse the repository at this point in the history
added altered account for save block data args
  • Loading branch information
bogdan-rosianu authored Feb 9, 2022
2 parents ebfa738 + afccf0b commit c574d4c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions data/indexer/dtos.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,26 @@ import (
"time"

"github.com/ElrondNetwork/elrond-go-core/data"
"github.com/ElrondNetwork/elrond-go-core/data/esdt"
)

// AccountTokenData holds the data needed for indexing a token of an altered account
type AccountTokenData struct {
Identifier string `json:"identifier"`
Balance string `json:"balance"`
Nonce uint64 `json:"nonce"`
Properties string `json:"properties"`
MetaData *esdt.MetaData `json:"metadata"`
}

// AlteredAccount holds the data needed of an altered account in a block
type AlteredAccount struct {
Address string `json:"address"`
Balance string `json:"balance,omitempty"`
Nonce uint64 `json:"nonce"`
Tokens []*AccountTokenData `json:"tokens"`
}

// ArgsSaveBlockData will contains all information that are needed to save block data
type ArgsSaveBlockData struct {
HeaderHash []byte
Expand All @@ -15,6 +33,7 @@ type ArgsSaveBlockData struct {
NotarizedHeadersHashes []string
HeaderGasConsumption HeaderGasConsumption
TransactionsPool *Pool
AlteredAccounts map[string]*AlteredAccount
}

// HeaderGasConsumption holds the data needed to save the gas consumption of a header
Expand Down

0 comments on commit c574d4c

Please sign in to comment.