Documentation ¶
Overview ¶
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- func GetAuthSigners(tx *txs.Tx, network models.Network, subnetID ids.ID) ([]string, error)
- func GetLedgerDisplayName(tx *txs.Tx) string
- func GetNetwork(tx *txs.Tx) (models.Network, error)
- func GetOwners(network models.Network, subnetID ids.ID) ([]string, uint32, error)
- func GetRemainingSigners(tx *txs.Tx, network models.Network, subnetID ids.ID) ([]string, error)
- func IsCreateChainTx(tx *txs.Tx) bool
- func LoadFromDisk(txPath string) (*txs.Tx, error)
- func SaveToDisk(tx *txs.Tx, txPath string, forceOverwrite bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthSigners ¶
get all subnet auth addresses that are required to sign a given tx
- get subnet control keys as string slice using P-Chain API (GetOwners)
- get subnet auth indices from the tx, field tx.UnsignedTx.SubnetAuth
- creates the string slice of required subnet auth addresses by applying the indices to the control keys slice
expect tx.Unsigned type to be in: - txs.CreateChainTx - txs.AddSubnetValidatorTx - txs.RemoveSubnetValidatorTx
func GetLedgerDisplayName ¶ added in v1.2.1
func GetNetwork ¶
get network model associated to tx expect tx.Unsigned type to be in [txs.AddSubnetValidatorTx, txs.CreateChainTx]
func GetRemainingSigners ¶
get subnet auth addresses that did not yet signed a given tx
- get the string slice of auth signers for the tx (GetAuthSigners)
- verifies that all creds in tx.Creds, except the last one, are fully signed (a cred is fully signed if all the signatures in cred.Sigs are non-empty)
- computes remaining signers by iterating the last cred in tx.Creds, associated to subnet auth signing
- for each sig in cred.Sig: if sig is empty, then add the associated auth signer address (obtained from authSigners by using the index) to the remaining signers list
if the tx is fully signed, returns empty slice expect tx.Unsigned type to be in [txs.AddSubnetValidatorTx, txs.CreateChainTx]
func IsCreateChainTx ¶
Types ¶
This section is empty.