Skip to content

Commit

Permalink
Update default GUI bytes representation when using Solana
Browse files Browse the repository at this point in the history
  • Loading branch information
enoldev committed Feb 14, 2025
1 parent febd89f commit c702749
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tui2/pages/output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ func New(c common.Common, config *request.Config) (*Output, error) {
// return nil, err
// }

getBytesEncodingPerNetwork := func(endpoint string) dynamic.BytesRepresentation {
if manifest.HardcodedEndpoints["solana-mainnet-beta"] == endpoint {
return dynamic.BytesAsBase58
}

return dynamic.BytesAsBase64
}

bytesRepresentation := getBytesEncodingPerNetwork(config.Endpoint)

output := &Output{
Common: c,
Config: config,
Expand All @@ -83,10 +93,10 @@ func New(c common.Common, config *request.Config) (*Output, error) {
outputView: viewport.New(24, 80),
messageFactory: dynamic.NewMessageFactoryWithDefaults(),
outputViewYoffset: map[request.BlockContext]int{},
statusBar: statusbar.New(c),
statusBar: newStatusBarWithBytesRepresentation(c, bytesRepresentation),
searchCtx: search.New(c),
blockSearchCtx: blocksearch.New(c),
bytesRepresentation: dynamic.BytesAsBase64,
bytesRepresentation: bytesRepresentation,
moduleSearchView: modsearch.New(c, "output"),
outputModule: config.OutputModule,
logsEnabled: true,
Expand Down Expand Up @@ -536,3 +546,9 @@ func (o *Output) hasDataForBlock(num uint64) bool {
}
return false
}

func newStatusBarWithBytesRepresentation(c common.Common, bytesRepresentation dynamic.BytesRepresentation) *statusbar.StatusBar {
statusBar := statusbar.New(c)
statusBar.SetBytesRepresentation(bytesRepresentation)
return statusBar
}

0 comments on commit c702749

Please sign in to comment.