-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Daria Dziubałtowska <daria.dziubaltowska@iota.org> Co-authored-by: Andrea V <1577639+karimodm@users.noreply.github.com> Co-authored-by: Daria Dziubałtowska <44535712+daria305@users.noreply.github.com> Co-authored-by: Ching-Hua (Vivian) Lin <jkrvivian@gmail.com>
- Loading branch information
1 parent
4b96b36
commit 6e4203a
Showing
20 changed files
with
845 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package jsonmodels | ||
|
||
import ( | ||
"github.com/iotaledger/goshimmer/packages/epoch" | ||
) | ||
|
||
type EpochInfo struct { | ||
EI uint64 `json:"EI"` | ||
ECR string `json:"ECR"` | ||
PrevEC string `json:"prevEC"` | ||
} | ||
|
||
func EpochInfoFromRecord(record *epoch.ECRecord) *EpochInfo { | ||
return &EpochInfo{ | ||
EI: uint64(record.EI()), | ||
ECR: record.ECR().Base58(), | ||
PrevEC: record.PrevEC().Base58(), | ||
} | ||
} | ||
|
||
type EpochsResponse struct { | ||
Epochs []*EpochInfo `json:"epochs"` | ||
} | ||
|
||
type EpochVotersWeightResponse struct { | ||
VotersWeight map[string]*NodeWeight `json:"ecrVoters"` | ||
} | ||
|
||
type NodeWeight struct { | ||
Weights map[string]float64 `json:"weights"` | ||
} | ||
|
||
type EpochUTXOsResponse struct { | ||
SpentOutputs []string `json:"spentOutputs"` | ||
CreatedOutputs []string `json:"createdOutputs"` | ||
} | ||
|
||
type EpochMessagesResponse struct { | ||
Messages []string `json:"messages"` | ||
} | ||
|
||
type EpochTransactionsResponse struct { | ||
Transactions []string `json:"transactions"` | ||
} | ||
|
||
type EpochPendingBranchCountResponse struct { | ||
PendingBranchCount uint64 `json:"pendingBranchCount"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.