Skip to content

Commit

Permalink
FIX: After review
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed Feb 13, 2025
1 parent 7673f05 commit f1bce8f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
3 changes: 1 addition & 2 deletions server/bridgeServer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import (
"testing"

"github.com/multiversx/mx-chain-core-go/data/sovereign"
"github.com/stretchr/testify/require"

"github.com/multiversx/mx-chain-sovereign-bridge-go/testscommon"

"github.com/stretchr/testify/require"
)

func TestNewSovereignBridgeTxServer(t *testing.T) {
Expand Down
9 changes: 3 additions & 6 deletions server/txSender/dataFormatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,11 @@ func (df *dataFormatter) createRegisterBridgeOperationsData(bridgeData *sovereig

registerBridgeOpData := []byte(registerBridgeOpsPrefix +
"@" + hex.EncodeToString(bridgeData.AggregatedSignature) +
"@" + hex.EncodeToString(bridgeData.Hash))
registerBridgeOpData = append(registerBridgeOpData, hashesHexEncodedArgs...)

bridgeDataArgs := []byte(
"@" + hex.EncodeToString(bridgeData.Hash) +
"@" + hex.EncodeToString(bridgeData.PubKeysBitmap) +
"@" + hex.EncodeToString(uint32ToBytes(bridgeData.Epoch)))
"@" + hex.EncodeToString(uint32ToBytes(bridgeData.Epoch)))

return append(registerBridgeOpData, bridgeDataArgs...)
return append(registerBridgeOpData, hashesHexEncodedArgs...)
}

func uint32ToBytes(value uint32) []byte {
Expand Down
10 changes: 5 additions & 5 deletions server/txSender/dataFormatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ func TestDataFormatter_CreateTxsData(t *testing.T) {
registerBridgeOpsPrefix +
"@" + hex.EncodeToString(aggregatedSig1) +
"@" + hex.EncodeToString(bridgeDataHash1) +
"@" + hex.EncodeToString(opHash1) +
"@" + hex.EncodeToString(opHash2) +
"@" + hex.EncodeToString(pubKeysBitmap1) +
"@" + "00000001")
"@" + "00000001" +
"@" + hex.EncodeToString(opHash1) +
"@" + hex.EncodeToString(opHash2))
execOp1 := []byte(executeBridgeOpsPrefix +
"@" + hex.EncodeToString(bridgeDataHash1) +
"@" + hex.EncodeToString(bridgeDataOp1))
Expand All @@ -138,9 +138,9 @@ func TestDataFormatter_CreateTxsData(t *testing.T) {
registerBridgeOpsPrefix +
"@" + hex.EncodeToString(aggregatedSig2) +
"@" + hex.EncodeToString(bridgeDataHash2) +
"@" + hex.EncodeToString(opHash3) +
"@" + hex.EncodeToString(pubKeysBitmap2) +
"@" + "00000002")
"@" + "00000002" +
"@" + hex.EncodeToString(opHash3))
execOp3 := []byte(executeBridgeOpsPrefix +
"@" + hex.EncodeToString(bridgeDataHash2) +
"@" + hex.EncodeToString(bridgeDataOp3))
Expand Down

0 comments on commit f1bce8f

Please sign in to comment.