Skip to content

Commit

Permalink
use nolint unused
Browse files Browse the repository at this point in the history
  • Loading branch information
gwen917 committed Sep 11, 2023
1 parent 8a0a24d commit 27ad45f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions vms/evm/contract_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,45 @@ import (
"encoding/hex"
"testing"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/logging"
"github.com/ava-labs/avalanchego/vms/platformvm/warp"
"github.com/ava-labs/awm-relayer/config"
warpPayload "github.com/ava-labs/subnet-evm/warp/payload"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
)

// nolint: unused
// Used to create a valid unsigned message for testing. Should not be used directly in tests.
func createUnsignedMessage() *warp.UnsignedMessage {
sourceChainID, err := ids.FromString("yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp")
if err != nil {
return nil
}
destinationChainID, err := ids.FromString("11111111111111111111111111111111LpoYY")
if err != nil {
return nil
}

payload, err := warpPayload.NewAddressedPayload(
common.HexToAddress("27aE10273D17Cd7e80de8580A51f476960626e5f"),
common.Hash(destinationChainID),
common.HexToAddress("1234123412341234123412341234123412341234"),
[]byte{},
)
if err != nil {
return nil
}

unsignedMsg, err := warp.NewUnsignedMessage(0, sourceChainID, payload.Bytes())
if err != nil {
return nil
}
return unsignedMsg
}

func TestUnpack(t *testing.T) {
ctrl := gomock.NewController(t)

Expand Down

0 comments on commit 27ad45f

Please sign in to comment.