Skip to content

Commit

Permalink
Merge pull request #287 from SiaFoundation/nate/upgrade-coreutils
Browse files Browse the repository at this point in the history
Upgrade coreutils and core
  • Loading branch information
n8maninger authored Jan 31, 2024
2 parents e120249 + 87e8ebb commit 9d84aad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/hashicorp/golang-lru/v2 v2.0.5
github.com/mattn/go-sqlite3 v1.14.17
gitlab.com/NebulousLabs/encoding v0.0.0-20200604091946-456c3dc907fe
go.sia.tech/core v0.2.1-0.20240124010156-3ffae341852c
go.sia.tech/coreutils v0.0.0-20240125145741-0f35c5ee74a8
go.sia.tech/core v0.2.1
go.sia.tech/coreutils v0.0.1
go.sia.tech/jape v0.11.2-0.20240124024603-93559895d640
go.sia.tech/renterd v0.6.0
go.sia.tech/siad v1.5.10-0.20230228235644-3059c0b930ca
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ gitlab.com/NebulousLabs/threadgroup v0.0.0-20200608151952-38921fbef213 h1:owERlK
gitlab.com/NebulousLabs/threadgroup v0.0.0-20200608151952-38921fbef213/go.mod h1:vIutAvl7lmJqLVYTCBY5WDdJomP+V74At8LCeEYoH8w=
gitlab.com/NebulousLabs/writeaheadlog v0.0.0-20200618142844-c59a90f49130/go.mod h1:SxigdS5Q1ui+OMgGAXt1E/Fg3RB6PvKXMov2O3gvIzs=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.sia.tech/core v0.2.1-0.20240124010156-3ffae341852c h1:hFgv4uH2+wf838W7V0dIVgldjMyje2dkZcCLItu874g=
go.sia.tech/core v0.2.1-0.20240124010156-3ffae341852c/go.mod h1:3EoY+rR78w1/uGoXXVqcYdwSjSJKuEMI5bL7WROA27Q=
go.sia.tech/coreutils v0.0.0-20240125145741-0f35c5ee74a8 h1:YsZL34F4Z7QSF4r9zf+oBMjBJlGfQDGfn3YHKX4qfro=
go.sia.tech/coreutils v0.0.0-20240125145741-0f35c5ee74a8/go.mod h1:0brl203MK8CpLfWZ7AlJQ6/l5p8Ux8bzguSVXQ4Irwg=
go.sia.tech/core v0.2.1 h1:CqmMd+T5rAhC+Py3NxfvGtvsj/GgwIqQHHVrdts/LqY=
go.sia.tech/core v0.2.1/go.mod h1:3EoY+rR78w1/uGoXXVqcYdwSjSJKuEMI5bL7WROA27Q=
go.sia.tech/coreutils v0.0.1 h1:Th8iiF9fjkBaxlKRgPJfRtsD3Pb8U4d2m/OahB6wffg=
go.sia.tech/coreutils v0.0.1/go.mod h1:3Mb206QDd3NtRiaHZ2kN87/HKXhcBF6lHVatS7PkViY=
go.sia.tech/jape v0.11.2-0.20240124024603-93559895d640 h1:mSaJ622P7T/M97dAK8iPV+IRIC9M5vV28NHeceoWO3M=
go.sia.tech/jape v0.11.2-0.20240124024603-93559895d640/go.mod h1:4QqmBB+t3W7cNplXPj++ZqpoUb2PeiS66RLpXmEGap4=
go.sia.tech/mux v1.2.0 h1:ofa1Us9mdymBbGMY2XH/lSpY8itFsKIo/Aq8zwe+GHU=
Expand Down
2 changes: 1 addition & 1 deletion internal/chain/tpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type TransactionPool struct {
// RecommendedFee returns the recommended fee per byte.
func (tp *TransactionPool) RecommendedFee() (fee types.Currency) {
_, max := tp.tp.FeeEstimation()
convertToCore(&max, &fee)
convertToCore(&max, (*types.V1Currency)(&fee))
return
}

Expand Down
18 changes: 9 additions & 9 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ func (txn Transaction) EncodeTo(e *types.Encoder) {
txn.ID.EncodeTo(e)
txn.Index.EncodeTo(e)
txn.Transaction.EncodeTo(e)
txn.Inflow.EncodeTo(e)
txn.Outflow.EncodeTo(e)
(*types.V1Currency)(&txn.Inflow).EncodeTo(e)
(*types.V1Currency)(&txn.Outflow).EncodeTo(e)
e.WriteString(string(txn.Source))
e.WriteTime(txn.Timestamp)
}
Expand All @@ -137,8 +137,8 @@ func (txn *Transaction) DecodeFrom(d *types.Decoder) {
txn.ID.DecodeFrom(d)
txn.Index.DecodeFrom(d)
txn.Transaction.DecodeFrom(d)
txn.Inflow.DecodeFrom(d)
txn.Outflow.DecodeFrom(d)
(*types.V1Currency)(&txn.Inflow).DecodeFrom(d)
(*types.V1Currency)(&txn.Outflow).DecodeFrom(d)
txn.Source = TransactionSource(d.ReadString())
txn.Timestamp = d.ReadTime()
}
Expand Down Expand Up @@ -570,7 +570,7 @@ func (sw *SingleAddressWallet) ProcessConsensusChange(cc modules.ConsensusChange
}
// append the payout transaction to the diff
var utxo types.SiacoinOutput
convertToCore(dsco.SiacoinOutput, &utxo)
convertToCore(dsco.SiacoinOutput, (*types.V1SiacoinOutput)(&utxo))
sce := SiacoinElement{
ID: types.SiacoinOutputID(dsco.ID),
SiacoinOutput: utxo,
Expand All @@ -584,7 +584,7 @@ func (sw *SingleAddressWallet) ProcessConsensusChange(cc modules.ConsensusChange
for _, diff := range applied.SiacoinOutputDiffs {
if diff.Direction == modules.DiffRevert {
var so types.SiacoinOutput
convertToCore(diff.SiacoinOutput, &so)
convertToCore(diff.SiacoinOutput, (*types.V1SiacoinOutput)(&so))
spentOutputs[types.SiacoinOutputID(diff.ID)] = so
}
}
Expand All @@ -607,7 +607,7 @@ func (sw *SingleAddressWallet) ProcessConsensusChange(cc modules.ConsensusChange
}
if diff.Direction == modules.DiffApply {
var sco types.SiacoinOutput
convertToCore(diff.SiacoinOutput, &sco)
convertToCore(diff.SiacoinOutput, (*types.V1SiacoinOutput)(&sco))
err := tx.AddSiacoinElement(SiacoinElement{
SiacoinOutput: sco,
ID: types.SiacoinOutputID(diff.ID),
Expand Down Expand Up @@ -643,7 +643,7 @@ func (sw *SingleAddressWallet) ProcessConsensusChange(cc modules.ConsensusChange
}

var value types.Currency
convertToCore(sco.SiacoinOutput.Value, &value)
convertToCore(sco.SiacoinOutput.Value, (*types.V1Currency)(&value))
switch sco.Direction {
case modules.DiffApply:
if err := tx.AddWalletDelta(value, blockTimestamp); err != nil {
Expand All @@ -667,7 +667,7 @@ func (sw *SingleAddressWallet) ProcessConsensusChange(cc modules.ConsensusChange
}

var value types.Currency
convertToCore(sco.SiacoinOutput.Value, &value)
convertToCore(sco.SiacoinOutput.Value, (*types.V1Currency)(&value))
switch sco.Direction {
case modules.DiffApply:
if err := tx.AddWalletDelta(value, blockTimestamp); err != nil {
Expand Down

0 comments on commit 9d84aad

Please sign in to comment.