Skip to content

Commit

Permalink
fixup! asset: add method Asset.IsGenesisAsset
Browse files Browse the repository at this point in the history
  • Loading branch information
ffranr committed Oct 11, 2023
1 parent fe4f705 commit 6bb6a33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 1 addition & 3 deletions proof/courier.go
Original file line number Diff line number Diff line change
Expand Up @@ -1072,9 +1072,7 @@ func (c *UniverseRpcCourier) ReceiveProof(ctx context.Context,
// Break if we've reached the genesis point (the asset is the
// genesis asset).
asset := transitionProof.Asset
if asset.HasGenesisWitness() ||
asset.HasGenesisWitnessForGroup() {

if asset.IsGenesisAsset() {
break
}

Expand Down
3 changes: 1 addition & 2 deletions proof/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,7 @@ func (p *Proof) Verify(ctx context.Context, prev *AssetSnapshot,
// 5. If this is a genesis asset, start by verifying the
// genesis reveal, which should be present for genesis assets.
// Non-genesis assets must not have a genesis or meta reveal.
isGenesisAsset := p.Asset.HasGenesisWitness() ||
p.Asset.HasGenesisWitnessForGroup()
isGenesisAsset := p.Asset.IsGenesisAsset()
hasGenesisReveal := p.GenesisReveal != nil
hasMetaReveal := p.MetaReveal != nil

Expand Down
4 changes: 1 addition & 3 deletions universe/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,7 @@ func (a *MintingArchive) getPrevAssetSnapshot(ctx context.Context,

// If this is a genesis proof, then there is no previous asset (and
// therefore no previous asset snapshot).
if newProof.Asset.HasGenesisWitness() ||
newProof.Asset.HasGenesisWitnessForGroup() {

if newProof.Asset.IsGenesisAsset() {
return nil, nil
}

Expand Down

0 comments on commit 6bb6a33

Please sign in to comment.