mirror of
https://github.com/luxfi/node.git
synced 2026-10-30 15:24:05 +00:00
30 lines
693 B
Go
30 lines
693 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package status
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/go-json-experiment/json"
|
|
"github.com/go-json-experiment/json/jsontext"
|
|
"time"
|
|
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/node/vms/example/xsvm/tx"
|
|
)
|
|
|
|
type TxIssuance struct {
|
|
Tx *tx.Tx
|
|
TxID ids.ID
|
|
Nonce uint64
|
|
StartTime time.Time
|
|
}
|
|
|
|
func (s *TxIssuance) String() string {
|
|
txJSON, err := json.Marshal(s.Tx, jsontext.WithIndent(" "))
|
|
if err != nil {
|
|
return "failed to marshal transaction: " + err.Error()
|
|
}
|
|
return fmt.Sprintf("issued tx %s in %s\n%s\n", s.TxID, time.Since(s.StartTime), string(txJSON))
|
|
}
|