Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes Simple throughout #3593

Merged
merged 2 commits into from
Apr 20, 2024
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
6 changes: 3 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This file details changes made to TrueBlocks over time. See the [migration notes

data models

- Added `ReconType` and `AssetType` to `SimpleReconciliation` data models.
- Added `ReconType` and `AssetType` to `Reconciliation` data models.

## v2.1.0 (2023/11/25)

Expand Down Expand Up @@ -1002,7 +1002,7 @@ The following existing data models were either added, removed, or modified by ha
- #3148 Fixes query package
- #3139 Feature/decache for all
- #3138 Update cmake
- #3137 Move token package to rpcClient, removes separate Token type in favor of SimpleToken
- #3137 Move token package to rpcClient, removes separate Token type in favor of Token
- #3131 Moved linter job to build workflow
- #3124 Removes chain from most methods on rpcClient.Options
- #3129 concurrent access to map core dumps
Expand Down Expand Up @@ -1624,7 +1624,7 @@ There were no changes to the [Specification for the Unchained Index](https://tru
- Removed `unclesCnt`.
- `TraceResult` data model:
- Renamed `newContract` to `address` in order to agree with the RPC.
- Renamed `VerboseAppearance` data model to `SimpleAppearance` to be consistent with other tools.
- Renamed `VerboseAppearance` data model to `Appearance` to be consistent with other tools.
- Renamed `TokenBalanceRecord` data model to `TokenBalance`.
- New data models:
- `BlockCount`
Expand Down
6 changes: 3 additions & 3 deletions sdk/go/abis.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func GetAbisOptions(args []string) (*AbisOptions, error) {
}

type abisGeneric interface {
types.SimpleFunction
types.Function
}

func queryAbis[T abisGeneric](opts *AbisOptions) ([]T, *types.MetaData, error) {
Expand All @@ -98,8 +98,8 @@ func queryAbis[T abisGeneric](opts *AbisOptions) ([]T, *types.MetaData, error) {
}

// Abis implements the chifra abis command.
func (opts *AbisOptions) Abis() ([]types.SimpleFunction, *types.MetaData, error) {
return queryAbis[types.SimpleFunction](opts)
func (opts *AbisOptions) Abis() ([]types.Function, *types.MetaData, error) {
return queryAbis[types.Function](opts)
}

// No enums
Expand Down
42 changes: 21 additions & 21 deletions sdk/go/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ func GetBlocksOptions(args []string) (*BlocksOptions, error) {
}

type blocksGeneric interface {
types.SimpleBlock[types.SimpleTransaction] |
types.SimpleBlock[string] |
types.SimpleTrace |
types.SimpleAppearance |
types.SimpleLog |
types.SimpleWithdrawal |
types.SimpleBlockCount
types.Block[types.Transaction] |
types.Block[string] |
types.Trace |
types.Appearance |
types.Log |
types.Withdrawal |
types.BlockCount
}

func queryBlocks[T blocksGeneric](opts *BlocksOptions) ([]T, *types.MetaData, error) {
Expand All @@ -120,38 +120,38 @@ func queryBlocks[T blocksGeneric](opts *BlocksOptions) ([]T, *types.MetaData, er
}

// Blocks implements the chifra blocks command.
func (opts *BlocksOptions) Blocks() ([]types.SimpleBlock[types.SimpleTransaction], *types.MetaData, error) {
return queryBlocks[types.SimpleBlock[types.SimpleTransaction]](opts)
func (opts *BlocksOptions) Blocks() ([]types.Block[types.Transaction], *types.MetaData, error) {
return queryBlocks[types.Block[types.Transaction]](opts)
}

// BlocksHashes implements the chifra blocks --hashes command.
func (opts *BlocksOptions) BlocksHashes() ([]types.SimpleBlock[string], *types.MetaData, error) {
return queryBlocks[types.SimpleBlock[string]](opts)
func (opts *BlocksOptions) BlocksHashes() ([]types.Block[string], *types.MetaData, error) {
return queryBlocks[types.Block[string]](opts)
}

// BlocksTraces implements the chifra blocks --traces command.
func (opts *BlocksOptions) BlocksTraces() ([]types.SimpleTrace, *types.MetaData, error) {
return queryBlocks[types.SimpleTrace](opts)
func (opts *BlocksOptions) BlocksTraces() ([]types.Trace, *types.MetaData, error) {
return queryBlocks[types.Trace](opts)
}

// BlocksUniq implements the chifra blocks --uniq command.
func (opts *BlocksOptions) BlocksUniq() ([]types.SimpleAppearance, *types.MetaData, error) {
return queryBlocks[types.SimpleAppearance](opts)
func (opts *BlocksOptions) BlocksUniq() ([]types.Appearance, *types.MetaData, error) {
return queryBlocks[types.Appearance](opts)
}

// BlocksLogs implements the chifra blocks --logs command.
func (opts *BlocksOptions) BlocksLogs() ([]types.SimpleLog, *types.MetaData, error) {
return queryBlocks[types.SimpleLog](opts)
func (opts *BlocksOptions) BlocksLogs() ([]types.Log, *types.MetaData, error) {
return queryBlocks[types.Log](opts)
}

// BlocksWithdrawals implements the chifra blocks --withdrawals command.
func (opts *BlocksOptions) BlocksWithdrawals() ([]types.SimpleWithdrawal, *types.MetaData, error) {
return queryBlocks[types.SimpleWithdrawal](opts)
func (opts *BlocksOptions) BlocksWithdrawals() ([]types.Withdrawal, *types.MetaData, error) {
return queryBlocks[types.Withdrawal](opts)
}

// BlocksCount implements the chifra blocks --count command.
func (opts *BlocksOptions) BlocksCount() ([]types.SimpleBlockCount, *types.MetaData, error) {
return queryBlocks[types.SimpleBlockCount](opts)
func (opts *BlocksOptions) BlocksCount() ([]types.BlockCount, *types.MetaData, error) {
return queryBlocks[types.BlockCount](opts)
}

type BlocksFlow int
Expand Down
28 changes: 14 additions & 14 deletions sdk/go/chunks.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,38 +186,38 @@ func enumFromChunksMode(values []string) (ChunksMode, error) {

// EXISTING_CODE
// ChunksManifest implements the chifra chunks manifest command.
func (opts *ChunksOptions) ChunksManifest() ([]types.SimpleChunkRecord, *types.MetaData, error) {
return queryChunks[types.SimpleChunkRecord](opts)
func (opts *ChunksOptions) ChunksManifest() ([]types.ChunkRecord, *types.MetaData, error) {
return queryChunks[types.ChunkRecord](opts)
}

// ChunksIndex implements the chifra chunks index command.
func (opts *ChunksOptions) ChunksIndex() ([]types.SimpleChunkIndex, *types.MetaData, error) {
return queryChunks[types.SimpleChunkIndex](opts)
func (opts *ChunksOptions) ChunksIndex() ([]types.ChunkIndex, *types.MetaData, error) {
return queryChunks[types.ChunkIndex](opts)
}

// ChunksBlooms implements the chifra chunks blooms command.
func (opts *ChunksOptions) ChunksBlooms() ([]types.SimpleChunkBloom, *types.MetaData, error) {
return queryChunks[types.SimpleChunkBloom](opts)
func (opts *ChunksOptions) ChunksBlooms() ([]types.ChunkBloom, *types.MetaData, error) {
return queryChunks[types.ChunkBloom](opts)
}

// ChunksPins implements the chifra chunks pins command.
func (opts *ChunksOptions) ChunksPins() ([]types.SimpleChunkPinReport, *types.MetaData, error) {
return queryChunks[types.SimpleChunkPinReport](opts)
func (opts *ChunksOptions) ChunksPins() ([]types.ChunkPinReport, *types.MetaData, error) {
return queryChunks[types.ChunkPinReport](opts)
}

// ChunksAddresses implements the chifra chunks addresses command.
func (opts *ChunksOptions) ChunksAddresses() ([]types.SimpleChunkAddress, *types.MetaData, error) {
return queryChunks[types.SimpleChunkAddress](opts)
func (opts *ChunksOptions) ChunksAddresses() ([]types.ChunkAddress, *types.MetaData, error) {
return queryChunks[types.ChunkAddress](opts)
}

// // ChunksAppearances implements the chifra chunks appearance command.
// func (opts *ChunksOptions) ChunksAppearances() ([]types.SimpleChunkAppearance, *types.MetaData, error) {
// return queryChunks[types.SimpleChunkAppearance](opts)
// func (opts *ChunksOptions) ChunksAppearances() ([]types.ChunkAppearance, *types.MetaData, error) {
// return queryChunks[types.ChunkAppearance](opts)
// }

// ChunkStats implements the chifra chunks stats command.
func (opts *ChunksOptions) ChunkStats() ([]types.SimpleChunkStats, *types.MetaData, error) {
return queryChunks[types.SimpleChunkStats](opts)
func (opts *ChunksOptions) ChunkStats() ([]types.ChunkStats, *types.MetaData, error) {
return queryChunks[types.ChunkStats](opts)
}

// EXISTING_CODE
54 changes: 27 additions & 27 deletions sdk/go/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ func GetExportOptions(args []string) (*ExportOptions, error) {
}

type exportGeneric interface {
types.SimpleTransaction |
types.SimpleAppearance |
types.SimpleReceipt |
types.SimpleLog |
types.SimpleTrace |
types.SimpleStatement |
types.SimpleState |
types.SimpleWithdrawal |
types.SimpleAppearanceCount
types.Transaction |
types.Appearance |
types.Receipt |
types.Log |
types.Trace |
types.Statement |
types.State |
types.Withdrawal |
types.AppearanceCount
}

func queryExport[T exportGeneric](opts *ExportOptions) ([]T, *types.MetaData, error) {
Expand All @@ -135,48 +135,48 @@ func queryExport[T exportGeneric](opts *ExportOptions) ([]T, *types.MetaData, er
}

// Export implements the chifra export command.
func (opts *ExportOptions) Export() ([]types.SimpleTransaction, *types.MetaData, error) {
return queryExport[types.SimpleTransaction](opts)
func (opts *ExportOptions) Export() ([]types.Transaction, *types.MetaData, error) {
return queryExport[types.Transaction](opts)
}

// ExportAppearances implements the chifra export --appearances command.
func (opts *ExportOptions) ExportAppearances() ([]types.SimpleAppearance, *types.MetaData, error) {
return queryExport[types.SimpleAppearance](opts)
func (opts *ExportOptions) ExportAppearances() ([]types.Appearance, *types.MetaData, error) {
return queryExport[types.Appearance](opts)
}

// ExportReceipts implements the chifra export --receipts command.
func (opts *ExportOptions) ExportReceipts() ([]types.SimpleReceipt, *types.MetaData, error) {
return queryExport[types.SimpleReceipt](opts)
func (opts *ExportOptions) ExportReceipts() ([]types.Receipt, *types.MetaData, error) {
return queryExport[types.Receipt](opts)
}

// ExportLogs implements the chifra export --logs command.
func (opts *ExportOptions) ExportLogs() ([]types.SimpleLog, *types.MetaData, error) {
return queryExport[types.SimpleLog](opts)
func (opts *ExportOptions) ExportLogs() ([]types.Log, *types.MetaData, error) {
return queryExport[types.Log](opts)
}

// ExportTraces implements the chifra export --traces command.
func (opts *ExportOptions) ExportTraces() ([]types.SimpleTrace, *types.MetaData, error) {
return queryExport[types.SimpleTrace](opts)
func (opts *ExportOptions) ExportTraces() ([]types.Trace, *types.MetaData, error) {
return queryExport[types.Trace](opts)
}

// ExportStatements implements the chifra export --statements command.
func (opts *ExportOptions) ExportStatements() ([]types.SimpleStatement, *types.MetaData, error) {
return queryExport[types.SimpleStatement](opts)
func (opts *ExportOptions) ExportStatements() ([]types.Statement, *types.MetaData, error) {
return queryExport[types.Statement](opts)
}

// ExportBalances implements the chifra export --balances command.
func (opts *ExportOptions) ExportBalances() ([]types.SimpleState, *types.MetaData, error) {
return queryExport[types.SimpleState](opts)
func (opts *ExportOptions) ExportBalances() ([]types.State, *types.MetaData, error) {
return queryExport[types.State](opts)
}

// ExportWithdrawals implements the chifra export --withdrawals command.
func (opts *ExportOptions) ExportWithdrawals() ([]types.SimpleWithdrawal, *types.MetaData, error) {
return queryExport[types.SimpleWithdrawal](opts)
func (opts *ExportOptions) ExportWithdrawals() ([]types.Withdrawal, *types.MetaData, error) {
return queryExport[types.Withdrawal](opts)
}

// ExportCount implements the chifra export --count command.
func (opts *ExportOptions) ExportCount() ([]types.SimpleAppearanceCount, *types.MetaData, error) {
return queryExport[types.SimpleAppearanceCount](opts)
func (opts *ExportOptions) ExportCount() ([]types.AppearanceCount, *types.MetaData, error) {
return queryExport[types.AppearanceCount](opts)
}

type ExportFlow int
Expand Down
18 changes: 9 additions & 9 deletions sdk/go/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ func GetListOptions(args []string) (*ListOptions, error) {
}

type listGeneric interface {
types.SimpleAppearance |
types.SimpleAppearanceCount |
types.SimpleBounds
types.Appearance |
types.AppearanceCount |
types.Bounds
}

func queryList[T listGeneric](opts *ListOptions) ([]T, *types.MetaData, error) {
Expand All @@ -101,18 +101,18 @@ func queryList[T listGeneric](opts *ListOptions) ([]T, *types.MetaData, error) {
}

// List implements the chifra list command.
func (opts *ListOptions) List() ([]types.SimpleAppearance, *types.MetaData, error) {
return queryList[types.SimpleAppearance](opts)
func (opts *ListOptions) List() ([]types.Appearance, *types.MetaData, error) {
return queryList[types.Appearance](opts)
}

// ListCount implements the chifra list --count command.
func (opts *ListOptions) ListCount() ([]types.SimpleAppearanceCount, *types.MetaData, error) {
return queryList[types.SimpleAppearanceCount](opts)
func (opts *ListOptions) ListCount() ([]types.AppearanceCount, *types.MetaData, error) {
return queryList[types.AppearanceCount](opts)
}

// ListBounds implements the chifra list --bounds command.
func (opts *ListOptions) ListBounds() ([]types.SimpleBounds, *types.MetaData, error) {
return queryList[types.SimpleBounds](opts)
func (opts *ListOptions) ListBounds() ([]types.Bounds, *types.MetaData, error) {
return queryList[types.Bounds](opts)
}

// No enums
Expand Down
6 changes: 3 additions & 3 deletions sdk/go/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func GetLogsOptions(args []string) (*LogsOptions, error) {
}

type logsGeneric interface {
types.SimpleLog
types.Log
}

func queryLogs[T logsGeneric](opts *LogsOptions) ([]T, *types.MetaData, error) {
Expand All @@ -90,8 +90,8 @@ func queryLogs[T logsGeneric](opts *LogsOptions) ([]T, *types.MetaData, error) {
}

// Logs implements the chifra logs command.
func (opts *LogsOptions) Logs() ([]types.SimpleLog, *types.MetaData, error) {
return queryLogs[types.SimpleLog](opts)
func (opts *LogsOptions) Logs() ([]types.Log, *types.MetaData, error) {
return queryLogs[types.Log](opts)
}

// No enums
Expand Down
12 changes: 6 additions & 6 deletions sdk/go/monitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func GetMonitorsOptions(args []string) (*MonitorsOptions, error) {

type monitorsGeneric interface {
bool |
types.SimpleMonitorClean |
types.SimpleMonitor
types.MonitorClean |
types.Monitor
}

func queryMonitors[T monitorsGeneric](opts *MonitorsOptions) ([]T, *types.MetaData, error) {
Expand All @@ -105,13 +105,13 @@ func (opts *MonitorsOptions) Monitors() ([]bool, *types.MetaData, error) {
}

// MonitorsClean implements the chifra monitors --clean command.
func (opts *MonitorsOptions) MonitorsClean() ([]types.SimpleMonitorClean, *types.MetaData, error) {
return queryMonitors[types.SimpleMonitorClean](opts)
func (opts *MonitorsOptions) MonitorsClean() ([]types.MonitorClean, *types.MetaData, error) {
return queryMonitors[types.MonitorClean](opts)
}

// MonitorsList implements the chifra monitors --list command.
func (opts *MonitorsOptions) MonitorsList() ([]types.SimpleMonitor, *types.MetaData, error) {
return queryMonitors[types.SimpleMonitor](opts)
func (opts *MonitorsOptions) MonitorsList() ([]types.Monitor, *types.MetaData, error) {
return queryMonitors[types.Monitor](opts)
}

// No enums
Expand Down
6 changes: 3 additions & 3 deletions sdk/go/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func GetNamesOptions(args []string) (*NamesOptions, error) {
}

type namesGeneric interface {
types.SimpleName |
types.Name |
base.Address |
string
}
Expand All @@ -106,8 +106,8 @@ func queryNames[T namesGeneric](opts *NamesOptions) ([]T, *types.MetaData, error
}

// Names implements the chifra names command.
func (opts *NamesOptions) Names() ([]types.SimpleName, *types.MetaData, error) {
return queryNames[types.SimpleName](opts)
func (opts *NamesOptions) Names() ([]types.Name, *types.MetaData, error) {
return queryNames[types.Name](opts)
}

// NamesAddr implements the chifra names --addr command.
Expand Down
6 changes: 3 additions & 3 deletions sdk/go/receipts.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func GetReceiptsOptions(args []string) (*ReceiptsOptions, error) {
}

type receiptsGeneric interface {
types.SimpleReceipt
types.Receipt
}

func queryReceipts[T receiptsGeneric](opts *ReceiptsOptions) ([]T, *types.MetaData, error) {
Expand All @@ -88,8 +88,8 @@ func queryReceipts[T receiptsGeneric](opts *ReceiptsOptions) ([]T, *types.MetaDa
}

// Receipts implements the chifra receipts command.
func (opts *ReceiptsOptions) Receipts() ([]types.SimpleReceipt, *types.MetaData, error) {
return queryReceipts[types.SimpleReceipt](opts)
func (opts *ReceiptsOptions) Receipts() ([]types.Receipt, *types.MetaData, error) {
return queryReceipts[types.Receipt](opts)
}

// No enums
Expand Down
Loading
Loading