Skip to content

Commit cc1db17

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents dabac79 + 8e084eb commit cc1db17

6 files changed

+118
-29
lines changed

api/openapi.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1551,8 +1551,7 @@
15511551
"code",
15521552
"code_hash",
15531553
"methods",
1554-
"compiler",
1555-
"source"
1554+
"compiler"
15561555
],
15571556
"type": "object"
15581557
},

api/openapi.yml

+11-12
Original file line numberDiff line numberDiff line change
@@ -7410,7 +7410,6 @@ components:
74107410
- code_hash
74117411
- methods
74127412
- compiler
7413-
- source
74147413
properties:
74157414
code:
74167415
type: string
@@ -7480,17 +7479,17 @@ components:
74807479
format: int64
74817480
example: 1668436763
74827481
ExtraCurrency:
7483-
type: object
7484-
required:
7485-
- amount
7486-
- preview
7487-
properties:
7488-
amount:
7489-
type: string
7490-
x-js-format: bigint
7491-
example: "1000000000"
7492-
preview:
7493-
$ref: '#/components/schemas/EcPreview'
7482+
type: object
7483+
required:
7484+
- amount
7485+
- preview
7486+
properties:
7487+
amount:
7488+
type: string
7489+
x-js-format: bigint
7490+
example: "1000000000"
7491+
preview:
7492+
$ref: '#/components/schemas/EcPreview'
74947493
SourceFile:
74957494
type: object
74967495
required:

pkg/api/account_handlers.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,7 @@ func (h *Handler) BlockchainAccountInspect(ctx context.Context, params oas.Block
488488
if err != nil {
489489
return nil, toError(http.StatusInternalServerError, err)
490490
}
491-
source, err := h.verifierSource.GetAccountSource(account.ID)
492-
if err != nil {
493-
return nil, toError(http.StatusInternalServerError, err)
494-
}
491+
source, _ := h.verifierSource.GetAccountSource(account.ID)
495492
sourceFiles := make([]oas.SourceFile, len(source.Files))
496493
for idx, file := range source.Files {
497494
sourceFiles[idx] = oas.SourceFile{
@@ -502,11 +499,17 @@ func (h *Handler) BlockchainAccountInspect(ctx context.Context, params oas.Block
502499
IncludeInCommand: file.IncludeInCommand,
503500
}
504501
}
502+
compiler := oas.BlockchainAccountInspectCompilerFunc
503+
if source.Compiler != "" {
504+
compiler = oas.BlockchainAccountInspectCompiler(source.Compiler)
505+
}
505506
resp := oas.BlockchainAccountInspect{
506507
Code: hex.EncodeToString(rawAccount.Code),
507508
CodeHash: hex.EncodeToString(codeHash),
508-
Compiler: oas.BlockchainAccountInspectCompiler(source.Compiler),
509-
Source: oas.Source{Files: sourceFiles},
509+
Compiler: compiler,
510+
}
511+
if len(sourceFiles) > 0 {
512+
resp.Source = oas.NewOptSource(oas.Source{Files: sourceFiles})
510513
}
511514
for _, methodID := range methods {
512515
if method, ok := code.Methods[methodID]; ok {

pkg/oas/oas_json_gen.go

+39-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/oas/oas_schemas_gen.go

+49-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/oas/oas_validators_gen.go

+9-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)