Skip to content

Commit

Permalink
Merge pull request #41 from FastLane-Labs/misc-adjustments
Browse files Browse the repository at this point in the history
Misc adjustments
  • Loading branch information
jj1980a authored Apr 11, 2024
2 parents 359682b + 00b09f0 commit b7f18be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 7 additions & 2 deletions core/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,13 @@ func (br *BundleRequest) Marshal() []byte {

type BundleResponse struct {
Id string `json:"id" validate:"required"`
Result common.Hash `json:"result"`
Error string `json:"error"`
Result common.Hash `json:"result,omitempty"`
Error string `json:"error,omitempty"`
}

func (br *BundleResponse) Marshal() []byte {
b, _ := json.Marshal(br)
return b
}

type Marshaler interface {
Expand Down
9 changes: 2 additions & 7 deletions tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package tests

import (
"crypto/ecdsa"
"fmt"

"github.com/FastLane-Labs/atlas-operations-relay/contract/atlas"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
Expand All @@ -24,12 +24,7 @@ func executionEnvironment(user common.Address, dAppControl common.Address) commo
}

func signMessage(data []byte, privKey *ecdsa.PrivateKey) ([]byte, error) {
prefix := fmt.Sprintf("\x19Ethereum Signed Message:\n%d", len(data))
prefixedData := []byte(prefix + string(data))

hash := crypto.Keccak256Hash(prefixedData)

signature, err := crypto.Sign(hash.Bytes(), privKey)
signature, err := crypto.Sign(accounts.TextHash(data), privKey)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b7f18be

Please sign in to comment.