Skip to content

Commit e4148fd

Browse files
committed
tapdb+itest: set and assert anchor block height
1 parent 4b1854d commit e4148fd

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

itest/assertions.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,11 @@ func AssertAssetsMinted(t *testing.T, tapClient TapdClient,
18261826
firstOutpoint)
18271827
}
18281828

1829+
if anchor.BlockHeight == 0 {
1830+
return fmt.Errorf("missing block " +
1831+
"height")
1832+
}
1833+
18291834
return nil
18301835
},
18311836
AssetScriptKeyCheck(assetRequest.Asset.ScriptKey),

tapdb/assets_store.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,14 @@ func (a *AssetStore) dbAssetsToChainAssets(dbAssets []ConfirmedAsset,
755755
}
756756

757757
chainAssets[i] = &asset.ChainAsset{
758-
Asset: assetSprout,
759-
IsSpent: sprout.Spent,
760-
AnchorTx: anchorTx,
761-
AnchorBlockHash: anchorBlockHash,
762-
AnchorOutpoint: anchorOutpoint,
758+
Asset: assetSprout,
759+
IsSpent: sprout.Spent,
760+
AnchorTx: anchorTx,
761+
AnchorBlockHash: anchorBlockHash,
762+
AnchorOutpoint: anchorOutpoint,
763+
AnchorBlockHeight: uint32(
764+
sprout.AnchorBlockHeight.Int32,
765+
),
763766
AnchorInternalKey: anchorInternalKey,
764767
AnchorMerkleRoot: sprout.AnchorMerkleRoot,
765768
AnchorTapscriptSibling: sprout.AnchorTapscriptSibling,

0 commit comments

Comments
 (0)