Skip to content

Commit

Permalink
FromBob now returns error
Browse files Browse the repository at this point in the history
  • Loading branch information
rohenaz committed Sep 25, 2020
1 parent 9eb95b3 commit b903310
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions bmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func New() *Tx {
}

// FromBob returns a BmapTx from a BobTx
func (bTx *Tx) FromBob(bobTx *bob.Tx) {
func (bTx *Tx) FromBob(bobTx *bob.Tx) (err error) {
for _, out := range bobTx.Out {
for _, tape := range out.Tape {
switch tape.Cell[0].S {
Expand All @@ -33,14 +33,15 @@ func (bTx *Tx) FromBob(bobTx *bob.Tx) {
bTx.AIP.SetData(out.Tape)
case bap.Prefix:
bTx.BAP = bap.New()
bTx.BAP.FromTape(tape)
err = bTx.BAP.FromTape(tape)
case mapp.Prefix:
bTx.MAP = mapp.New()
bTx.MAP.FromTape(tape)
err = bTx.MAP.FromTape(tape)
case b.Prefix:
bTx.B = b.New()
bTx.B.FromTape(tape)
err = bTx.B.FromTape(tape)
}
}
}
return nil
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/piotrnar/gocoin v0.0.0-20200920172007-af9cf2799157 // indirect
github.com/rohenaz/go-aip v0.0.4
github.com/rohenaz/go-b v0.0.2
github.com/rohenaz/go-bap v0.0.4
github.com/rohenaz/go-bap v0.0.5
github.com/rohenaz/go-bob v0.0.0-20200711220921-847f9f004275
github.com/rohenaz/go-map v0.0.0-20200707213859-02d30355d791
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ github.com/rohenaz/go-aip v0.0.4 h1:jzF1MazbGw9tG+JK6FVOGb2txgEr/98SS905i5wRxCM=
github.com/rohenaz/go-aip v0.0.4/go.mod h1:tkL6ofUQCQRm74Wn1930km23Vcy77Y5COMTKFqTdAu0=
github.com/rohenaz/go-b v0.0.2 h1:kLx3Ku7a+yCV2VwC/S7FX+wS0jhxqk7OPgDjUdujLsk=
github.com/rohenaz/go-b v0.0.2/go.mod h1:4jh2ixlUK5uzypR/E7Aib+9a/cTwu9OV8crnXqp+Rnc=
github.com/rohenaz/go-bap v0.0.4 h1:N1yxg7bEULUJwKlQGDcc0Y8ykXbO8uqSoBACcB2dRP4=
github.com/rohenaz/go-bap v0.0.4/go.mod h1:N8F6AkEfcbgbVVKUpFG/gYRAWsPpsUG9M8u+1Tmqt8E=
github.com/rohenaz/go-bap v0.0.5 h1:VeDskLJhFEGqEKfwqwmJwLkFAzYYmEkGNXFENNxnVDI=
github.com/rohenaz/go-bap v0.0.5/go.mod h1:N8F6AkEfcbgbVVKUpFG/gYRAWsPpsUG9M8u+1Tmqt8E=
github.com/rohenaz/go-bitcoin v0.0.2 h1:Qi/Sjtd2BkcjsFqLvGd9edZ9zmYrQRD2OAB2gpH5osw=
github.com/rohenaz/go-bitcoin v0.0.2/go.mod h1:SeAs3+ATQZB0J6ysNWyspNAiZXPfistYrks7dGtPz5I=
github.com/rohenaz/go-bob v0.0.0-20200704190822-4b02dd80ee80/go.mod h1:YEjUooBSmI0F5qcDnyms7/xe8TdYZNcQrdQhOJ16fvY=
Expand Down

0 comments on commit b903310

Please sign in to comment.