Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade coreutils and core #287

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading