Skip to content

Commit

Permalink
Merge pull request #419 from SiaFoundation/chris/update-core
Browse files Browse the repository at this point in the history
Update core and coreutils
  • Loading branch information
n8maninger authored Jun 17, 2024
2 parents 85e9a3f + 93ceb2d commit 7b92ecd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require (
github.com/mattn/go-sqlite3 v1.14.22
github.com/shopspring/decimal v1.4.0
gitlab.com/NebulousLabs/encoding v0.0.0-20200604091946-456c3dc907fe
go.sia.tech/core v0.2.6
go.sia.tech/coreutils v0.0.5
go.sia.tech/core v0.2.7
go.sia.tech/coreutils v0.0.6
go.sia.tech/jape v0.11.2-0.20240306154058-9832414a5385
go.sia.tech/siad v1.5.10-0.20230228235644-3059c0b930ca
go.sia.tech/web/hostd v0.44.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ gitlab.com/NebulousLabs/writeaheadlog v0.0.0-20200618142844-c59a90f49130/go.mod
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0=
go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ=
go.sia.tech/core v0.2.6 h1:JrbZwW4cPHCB2Q6TeqCsAj2GAFXrRqLq0q/GNevtnPU=
go.sia.tech/core v0.2.6/go.mod h1:B7ooFH3F6cLjxQz6IX33kgjOY392Ava7pzpPeccagac=
go.sia.tech/coreutils v0.0.5 h1:Jj03VrqAayYHgA9fwV13+X88WB+Wr1p8wuLw2B8d2FI=
go.sia.tech/coreutils v0.0.5/go.mod h1:SkSpHeq3tBh2ff4HXuBk2WtlhkYQQtdcvU4Yv1Rd2bU=
go.sia.tech/core v0.2.7 h1:9Q/3BHL6ziAMPeiko863hhTD/Zs2s7OqEUiPKouDny8=
go.sia.tech/core v0.2.7/go.mod h1:BMgT/reXtgv6XbDgUYTCPY7wSMbspDRDs7KMi1vL6Iw=
go.sia.tech/coreutils v0.0.6 h1:xLpv3JyvbOoXcX3gC6a6Y3zQ/MZn/fyFvuPIzv/e/Eg=
go.sia.tech/coreutils v0.0.6/go.mod h1:EiDcQk2qLuP32Qoj/XphY9fbjTXphJhJZMERoC4LF0c=
go.sia.tech/jape v0.11.2-0.20240306154058-9832414a5385 h1:Gho1g6pkv56o6Ut9cez/Yu5o4xlA8WNkDbPn6RWXL7g=
go.sia.tech/jape v0.11.2-0.20240306154058-9832414a5385/go.mod h1:wU+h6Wh5olDjkPXjF0tbZ1GDgoZ6VTi4naFw91yyWC4=
go.sia.tech/mux v1.2.0 h1:ofa1Us9mdymBbGMY2XH/lSpY8itFsKIo/Aq8zwe+GHU=
Expand Down
10 changes: 2 additions & 8 deletions persist/sqlite/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,20 +988,14 @@ func decodeRevision(b []byte, fcr *types.FileContractRevision) error {
func encodeTxnSet(txns []types.Transaction) []byte {
var buf bytes.Buffer
e := types.NewEncoder(&buf)
e.WritePrefix(len(txns))
for i := range txns {
txns[i].EncodeTo(e)
}
types.EncodeSlice(e, txns)
e.Flush()
return buf.Bytes()
}

func decodeTxnSet(b []byte, txns *[]types.Transaction) error {
d := types.NewBufDecoder(b)
*txns = make([]types.Transaction, d.ReadPrefix())
for i := range *txns {
(*txns)[i].DecodeFrom(d)
}
types.DecodeSlice(d, txns)
return d.Err()
}

Expand Down
5 changes: 2 additions & 3 deletions rhp/v3/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,9 @@ func (pe *programExecutor) executeSwapSector(instr *rhp3.InstrSwapSector, log *z
// encode the old leaf hashes
var buf bytes.Buffer
enc := types.NewEncoder(&buf)
enc.WritePrefix(len(oldLeafHashes))
for _, h := range oldLeafHashes {
types.EncodeSliceFn(enc, oldLeafHashes, func(enc *types.Encoder, h types.Hash256) {
enc.Write(h[:])
}
})
if err := enc.Flush(); err != nil {
return nil, nil, fmt.Errorf("failed to encode old leaf hashes: %w", err)
}
Expand Down

0 comments on commit 7b92ecd

Please sign in to comment.