Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gwen917 committed Nov 8, 2023
1 parent 1650e0a commit 32803fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
3 changes: 2 additions & 1 deletion tests/basic_relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
testUtils "github.com/ava-labs/awm-relayer/tests/utils"
"github.com/ava-labs/subnet-evm/core/types"
predicateutils "github.com/ava-labs/subnet-evm/predicate"
subnetevmutils "github.com/ava-labs/subnet-evm/utils"
"github.com/ava-labs/subnet-evm/x/warp"
teleportermessenger "github.com/ava-labs/teleporter/abi-bindings/go/Teleporter/TeleporterMessenger"
teleporterTestUtils "github.com/ava-labs/teleporter/tests/utils"
Expand Down Expand Up @@ -209,7 +210,7 @@ func BasicRelay() {

// Check the transaction storage key has warp message we're expecting
storageKeyHashes := accessLists[0].StorageKeys
packedPredicate := testUtils.HashSliceToBytes(storageKeyHashes)
packedPredicate := subnetevmutils.HashSliceToBytes(storageKeyHashes)
predicateBytes, err := predicateutils.UnpackPredicate(packedPredicate)
Expect(err).Should(BeNil())
receivedWarpMessage, err = avalancheWarp.ParseMessage(predicateBytes)
Expand Down
10 changes: 0 additions & 10 deletions tests/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"os"
"os/exec"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
. "github.com/onsi/gomega"
)
Expand Down Expand Up @@ -56,12 +55,3 @@ func ReadHexTextFile(filename string) string {
Expect(err).Should(BeNil())
return string(fileData)
}

// HashSliceToBytes serializes a []common.Hash into a tightly packed byte array.
func HashSliceToBytes(hashes []common.Hash) []byte {
bytes := make([]byte, common.HashLength*len(hashes))
for i, hash := range hashes {
copy(bytes[i*common.HashLength:], hash[:])
}
return bytes
}

0 comments on commit 32803fa

Please sign in to comment.