From 8798c49d3f87a2a7578e1361aaaa5b19a38da57c Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Fri, 4 Oct 2024 11:27:20 -0300 Subject: [PATCH] add tx cases for convert subnet tx --- cmd/blockchaincmd/deploy.go | 3 ++- pkg/txutils/auth.go | 2 ++ pkg/txutils/info.go | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/blockchaincmd/deploy.go b/cmd/blockchaincmd/deploy.go index b2d91fafe..6a1ea977a 100644 --- a/cmd/blockchaincmd/deploy.go +++ b/cmd/blockchaincmd/deploy.go @@ -6,11 +6,12 @@ import ( "encoding/json" "errors" "fmt" - "github.com/ava-labs/avalanchego/vms/platformvm/warp/message" "os" "path/filepath" "strings" + "github.com/ava-labs/avalanchego/vms/platformvm/warp/message" + "github.com/ava-labs/avalanche-cli/pkg/utils" "github.com/ava-labs/avalanchego/utils/formatting/address" "github.com/ava-labs/avalanchego/vms/platformvm/fx" diff --git a/pkg/txutils/auth.go b/pkg/txutils/auth.go index e00e84e6b..1177d56f6 100644 --- a/pkg/txutils/auth.go +++ b/pkg/txutils/auth.go @@ -37,6 +37,8 @@ func GetAuthSigners(tx *txs.Tx, controlKeys []string) ([]string, error) { subnetAuth = unsignedTx.SubnetAuth case *txs.TransferSubnetOwnershipTx: subnetAuth = unsignedTx.SubnetAuth + case *txs.ConvertSubnetTx: + subnetAuth = unsignedTx.SubnetAuth default: return nil, fmt.Errorf("unexpected unsigned tx type %T", unsignedTx) } diff --git a/pkg/txutils/info.go b/pkg/txutils/info.go index 52168bd3b..c801b7a65 100644 --- a/pkg/txutils/info.go +++ b/pkg/txutils/info.go @@ -31,6 +31,8 @@ func GetNetwork(tx *txs.Tx) (models.Network, error) { networkID = unsignedTx.NetworkID case *txs.TransferSubnetOwnershipTx: networkID = unsignedTx.NetworkID + case *txs.ConvertSubnetTx: + networkID = unsignedTx.NetworkID default: return models.UndefinedNetwork, fmt.Errorf("unexpected unsigned tx type %T", unsignedTx) } @@ -58,6 +60,8 @@ func GetSubnetID(tx *txs.Tx) (ids.ID, error) { subnetID = unsignedTx.Subnet case *txs.TransferSubnetOwnershipTx: subnetID = unsignedTx.Subnet + case *txs.ConvertSubnetTx: + subnetID = unsignedTx.Subnet default: return ids.Empty, fmt.Errorf("unexpected unsigned tx type %T", unsignedTx) }