Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mapper.DecodeToBytes everywhere #239

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions mapper/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"testing"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/formatting"
"github.com/ava-labs/avalanchego/vms/components/avax"
"github.com/ava-labs/coreth/plugin/evm"
"github.com/coinbase/rosetta-sdk-go/types"
Expand Down Expand Up @@ -253,7 +252,7 @@ func TestCrossChainImportedInputs(t *testing.T) {
rawIdx = 0
avaxAssetID = "U8iRqJoiJm8xZHAacmvYyZVwqQx6uDNtQeP3CQ6fcgQk3JqnK"
hexTx = "0x000000000000000000057fc93d85c6d62c5b2ac0b519c87010ea5294012d1e407030d6acd0021cac10d5000000000000000000000000000000000000000000000000000000000000000000000001d4e3812503247f042cc9bbb3395ceca49e28687726489b0ea2d4dd259fadb8b6000000003d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa0000000500000000772651c00000000100000000000000013158e80abd5a1e1aa716003c9db096792c37962100000000772209123d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa000000010000000900000001309767786d3c3548f34373c858f2bab210c6bd6c837d069e314930273d32acc361e86a05bc5bd251e4cb5809bbca7680361ed3263ff5ba2aa467294bfa000aef00cfb71da5"
decodeTx, _ = formatting.Decode(formatting.Hex, hexTx)
decodeTx, _ = DecodeToBytes(hexTx)
tx = &evm.Tx{}

networkIdentifier = &types.NetworkIdentifier{
Expand Down
5 changes: 2 additions & 3 deletions service/backend/cchainatomictx/construction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"testing"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/formatting"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
Expand Down Expand Up @@ -259,7 +258,7 @@ func TestExportTxConstruction(t *testing.T) {
t.Run("submit endpoint", func(t *testing.T) {
require := require.New(t)

signedTxBytes, err := formatting.Decode(formatting.Hex, signedExportTx)
signedTxBytes, err := mapper.DecodeToBytes(signedExportTx)
require.NoError(err)
txID, err := ids.FromString(signedExportTxHash)
require.NoError(err)
Expand Down Expand Up @@ -476,7 +475,7 @@ func TestImportTxConstruction(t *testing.T) {
t.Run("submit endpoint", func(t *testing.T) {
require := require.New(t)

signedTxBytes, err := formatting.Decode(formatting.Hex, signedImportTx)
signedTxBytes, err := mapper.DecodeToBytes(signedImportTx)
require.NoError(err)
txID, err := ids.FromString(signedImportTxHash)
require.NoError(err)
Expand Down
9 changes: 4 additions & 5 deletions service/backend/pchain/construction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/ava-labs/avalanchego/api/info"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/formatting"
"github.com/coinbase/rosetta-sdk-go/types"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"
Expand Down Expand Up @@ -303,7 +302,7 @@ func TestExportTxConstruction(t *testing.T) {
t.Run("submit endpoint", func(t *testing.T) {
require := require.New(t)

signedTxBytes, err := formatting.Decode(formatting.Hex, signedExportTx)
signedTxBytes, err := mapper.DecodeToBytes(signedExportTx)
require.NoError(err)
txID, err := ids.FromString(signedExportTxHash)
require.NoError(err)
Expand Down Expand Up @@ -514,7 +513,7 @@ func TestImportTxConstruction(t *testing.T) {
t.Run("submit endpoint", func(t *testing.T) {
require := require.New(t)

signedTxBytes, err := formatting.Decode(formatting.Hex, signedImportTx)
signedTxBytes, err := mapper.DecodeToBytes(signedImportTx)
require.NoError(err)

txID, err := ids.FromString(signedImportTxHash)
Expand Down Expand Up @@ -748,7 +747,7 @@ func TestAddValidatorTxConstruction(t *testing.T) {
t.Run("submit endpoint", func(t *testing.T) {
require := require.New(t)

signedTxBytes, err := formatting.Decode(formatting.Hex, signedTx)
signedTxBytes, err := mapper.DecodeToBytes(signedTx)
require.NoError(err)
txID, err := ids.FromString(signedTxHash)
require.NoError(err)
Expand Down Expand Up @@ -978,7 +977,7 @@ func TestAddDelegatorTxConstruction(t *testing.T) {
t.Run("submit endpoint", func(t *testing.T) {
require := require.New(t)

signedTxBytes, err := formatting.Decode(formatting.Hex, signedTx)
signedTxBytes, err := mapper.DecodeToBytes(signedTx)
require.NoError(err)
txID, err := ids.FromString(signedTxHash)
require.NoError(err)
Expand Down
Loading