Skip to content

Commit

Permalink
[master][DFI-953] added name field in the VM compilation result (#238)
Browse files Browse the repository at this point in the history
* [DFI-953] added name field in the VM compilation result

* [DFI-953] add seed for rand in sentry integration
  • Loading branch information
g3co authored Nov 12, 2020
1 parent 969442f commit cf749a2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions helpers/logger/sentry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func Test_SentryIntegration(t *testing.T) {

// prepare and send error message
logger := NewDNLogger()
rand.Seed(time.Now().UnixNano())
errMsg := fmt.Sprintf(errMsgFmt, rand.Int())

errMsgSendAt := time.Now()
Expand Down
1 change: 1 addition & 0 deletions x/vm/client/vm_client/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func Compile(addr string, sourceFiles *compiler_grpc.SourceFiles) ([]CompiledIte
resp[i] = CompiledItem{
ByteCode: unit.Bytecode,
Code: hex.EncodeToString(unit.Bytecode),
Name: unit.Name,
}

meta, err := metadataClient.GetMetadata(connCtx, &metadata_grpc.Bytecode{Code: unit.Bytecode})
Expand Down
1 change: 1 addition & 0 deletions x/vm/client/vm_client/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type CompiledItems []CompiledItem
type CompiledItem struct {
Code string `json:"code"`
ByteCode []byte `json:"-"`
Name string `json:"name"`
Methods []ModuleMethod `json:"methods,omitempty"`
Types []ModuleType `json:"types,omitempty"`
CodeType string `json:"code_type"`
Expand Down
1 change: 1 addition & 0 deletions x/vm/internal/keeper/integ_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ func TestVMKeeper_CheckMetaData(t *testing.T) {
})
require.NoErrorf(t, err, "can't get code for ModuleWithResources: %v", err)
require.Len(t, bytecodeModule, 1)
require.Equal(t, bytecodeModule[0].Name, "Foo")
require.Len(t, bytecodeModule[0].Methods, 2)
require.Len(t, bytecodeModule[0].Types, 2)
require.Equal(t, bytecodeModule[0].CodeType, vm_client.CodeTypeModule)
Expand Down

0 comments on commit cf749a2

Please sign in to comment.