MCPcopy Create free account
hub / github.com/akash-network/provider / parseStorage

Function parseStorage

bidengine/shellscript.go:110–128  ·  view source on GitHub ↗
(resource rtypes.Volumes)

Source from the content-addressed store, hash-verified

108}
109
110func parseStorage(resource rtypes.Volumes) []storageElement {
111 res := make([]storageElement, 0, len(resource))
112
113 for _, storage := range resource {
114 class := sdl.StorageEphemeral
115 if attr := storage.Attributes; attr != nil {
116 if cl, _ := attr.Find(sdl.StorageAttributeClass).AsString(); cl != "" {
117 class = cl
118 }
119 }
120
121 res = append(res, storageElement{
122 Class: class,
123 Size: storage.Quantity.Val.Uint64(),
124 })
125 }
126
127 return res
128}
129
130func (ssp shellScriptPricing) CalculatePrice(ctx context.Context, r Request) (sdk.DecCoin, error) {
131 d := newDataForScript(r)

Callers 1

newDataForScriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected