This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
generated from mrz1836/go-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #484 from BuxOrg/bux-166-merkle-path-bump
feat(BUX-166): MerkleProof from mAPI and MerklePath from Arc unified to BUMP in Transaction model
- Loading branch information
Showing
11 changed files
with
238 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package chainstate | ||
|
||
import ( | ||
"github.com/libsv/go-bc" | ||
) | ||
|
||
// TransactionInfo is the universal information about the transaction found from a chain provider | ||
type TransactionInfo struct { | ||
BlockHash string `json:"block_hash,omitempty"` // mAPI, WOC | ||
BlockHeight int64 `json:"block_height"` // mAPI, WOC | ||
Confirmations int64 `json:"confirmations,omitempty"` // mAPI, WOC | ||
ID string `json:"id"` // Transaction ID (Hex) | ||
MinerID string `json:"miner_id,omitempty"` // mAPI ONLY - miner_id found | ||
Provider string `json:"provider,omitempty"` // Provider is our internal source | ||
MerkleProof *bc.MerkleProof `json:"merkle_proof,omitempty"` // mAPI 1.5 ONLY. Should be also supported by Arc in future | ||
} | ||
|
||
// Validate validates TransactionInfo by checking if it contains | ||
// BlockHash and MerkleProof (from mAPI) or MerklePath (from Arc) | ||
func (t *TransactionInfo) Valid() bool { | ||
return !(t.BlockHash == "" || t.MerkleProof == nil || t.MerkleProof.TxOrID == "" || len(t.MerkleProof.Nodes) == 0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.