• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revision4076224cd6404eecd1c0357fe6aebbc7b21b7116 (tree)
Time2020-09-17 14:05:23
AuthorChengcheng Zhang <943420582@qq.c...>
CommiterChengcheng Zhang

Log Message

update

Change Summary

Incremental Difference

--- a/wallet/annotated.go
+++ b/wallet/annotated.go
@@ -157,6 +157,8 @@ func (w *Wallet) BuildAnnotatedInput(tx *types.Tx, i uint32) *query.AnnotatedInp
157157 in.ControlProgram = orig.ControlProgram()
158158 in.Address = w.getAddressFromControlProgram(in.ControlProgram, false)
159159 in.SpentOutputID = e.SpentOutputId
160+ _, assetDefinition := w.getAliasDefinition(in.AssetID)
161+ in.AssetDefinition = &assetDefinition
160162 arguments := orig.Arguments()
161163 for _, arg := range arguments {
162164 in.WitnessArguments = append(in.WitnessArguments, arg)
@@ -180,6 +182,8 @@ func (w *Wallet) BuildAnnotatedInput(tx *types.Tx, i uint32) *query.AnnotatedInp
180182 in.Address = w.getAddressFromControlProgram(in.ControlProgram, false)
181183 in.SpentOutputID = e.SpentOutputId
182184 arguments := orig.Arguments()
185+ _, assetDefinition := w.getAliasDefinition(in.AssetID)
186+ in.AssetDefinition = &assetDefinition
183187 for _, arg := range arguments {
184188 in.WitnessArguments = append(in.WitnessArguments, arg)
185189 }
@@ -187,6 +191,8 @@ func (w *Wallet) BuildAnnotatedInput(tx *types.Tx, i uint32) *query.AnnotatedInp
187191 case *bc.Coinbase:
188192 in.Type = "coinbase"
189193 in.Arbitrary = e.Arbitrary
194+ _, assetDefinition := w.getAliasDefinition(in.AssetID)
195+ in.AssetDefinition = &assetDefinition
190196 }
191197 return in
192198 }
@@ -246,15 +252,21 @@ func (w *Wallet) BuildAnnotatedOutput(tx *types.Tx, idx int) *query.AnnotatedOut
246252 case *bc.IntraChainOutput:
247253 out.Type = "control"
248254 isMainchainAddress = false
255+ _, assetDefinition := w.getAliasDefinition(out.AssetID)
256+ out.AssetDefinition = &assetDefinition
249257
250258 case *bc.CrossChainOutput:
251259 out.Type = "cross_chain_out"
252260 isMainchainAddress = true
261+ _, assetDefinition := w.getAliasDefinition(out.AssetID)
262+ out.AssetDefinition = &assetDefinition
253263
254264 case *bc.VoteOutput:
255265 out.Type = "vote"
256266 out.Vote = e.Vote
257267 isMainchainAddress = false
268+ _, assetDefinition := w.getAliasDefinition(out.AssetID)
269+ out.AssetDefinition = &assetDefinition
258270 }
259271
260272 out.Address = w.getAddressFromControlProgram(orig.ControlProgram(), isMainchainAddress)
Show on old repository browser