Skip to content

Commit 30b6036

Browse files
committed
taprpc+rpcserver: populate GenesisInfo with asset type
1 parent 005f3de commit 30b6036

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rpcserver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,12 +765,12 @@ func (r *rpcServer) listBalancesByAsset(ctx context.Context,
765765
AssetGenesis: &taprpc.GenesisInfo{
766766
Version: int32(balance.Version),
767767
GenesisPoint: balance.GenesisPoint.String(),
768+
AssetType: taprpc.AssetType(balance.Type),
768769
Name: balance.Tag,
769770
MetaHash: balance.MetaHash[:],
770771
AssetId: balance.ID[:],
771772
},
772-
AssetType: taprpc.AssetType(balance.Type),
773-
Balance: balance.Balance,
773+
Balance: balance.Balance,
774774
}
775775
}
776776

@@ -1421,8 +1421,8 @@ func (r *rpcServer) marshalProof(ctx context.Context, p *proof.Proof,
14211421
MetaHash: rpcGenesis.MetaHash[:],
14221422
AssetId: decodedAssetID[:],
14231423
OutputIndex: rpcGenesis.OutputIndex,
1424+
AssetType: taprpc.AssetType(p.Asset.Type),
14241425
},
1425-
AssetType: taprpc.AssetType(p.Asset.Type),
14261426
}
14271427
}
14281428

taprpc/marshal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ func MarshalAsset(ctx context.Context, a *asset.Asset,
7272
Version: assetVersion,
7373
AssetGenesis: &GenesisInfo{
7474
GenesisPoint: a.Genesis.FirstPrevOut.String(),
75+
AssetType: AssetType(a.Type),
7576
Name: a.Genesis.Tag,
7677
MetaHash: a.Genesis.MetaHash[:],
7778
AssetId: assetID[:],
7879
OutputIndex: a.Genesis.OutputIndex,
7980
Version: int32(assetVersion),
8081
},
81-
AssetType: AssetType(a.Type),
8282
Amount: a.Amount,
8383
LockTime: int32(a.LockTime),
8484
RelativeLockTime: int32(a.RelativeLockTime),

0 commit comments

Comments
 (0)