From b4bae85ee187c255772bf8c29d4560e24d373e34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 01:11:08 +0000 Subject: [PATCH 1/3] build(deps): bump the all-dependencies group with 5 updates Bumps the all-dependencies group with 5 updates: | Package | From | To | | --- | --- | --- | | [go.sia.tech/core](https://github.com/SiaFoundation/core) | `0.4.2` | `0.4.3` | | [go.sia.tech/coreutils](https://github.com/SiaFoundation/coreutils) | `0.2.3` | `0.2.5` | | [golang.org/x/crypto](https://github.com/golang/crypto) | `0.25.0` | `0.26.0` | | [golang.org/x/sys](https://github.com/golang/sys) | `0.23.0` | `0.24.0` | | [golang.org/x/term](https://github.com/golang/term) | `0.22.0` | `0.23.0` | Updates `go.sia.tech/core` from 0.4.2 to 0.4.3 - [Commits](https://github.com/SiaFoundation/core/compare/v0.4.2...v0.4.3) Updates `go.sia.tech/coreutils` from 0.2.3 to 0.2.5 - [Commits](https://github.com/SiaFoundation/coreutils/compare/v0.2.3...v0.2.5) Updates `golang.org/x/crypto` from 0.25.0 to 0.26.0 - [Commits](https://github.com/golang/crypto/compare/v0.25.0...v0.26.0) Updates `golang.org/x/sys` from 0.23.0 to 0.24.0 - [Commits](https://github.com/golang/sys/compare/v0.23.0...v0.24.0) Updates `golang.org/x/term` from 0.22.0 to 0.23.0 - [Commits](https://github.com/golang/term/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: go.sia.tech/core dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-dependencies - dependency-name: go.sia.tech/coreutils dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-dependencies - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-dependencies - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-dependencies - dependency-name: golang.org/x/term dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 12 ++++++------ go.sum | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index f028f32c1..371d83e10 100644 --- a/go.mod +++ b/go.mod @@ -10,17 +10,17 @@ require ( github.com/minio/minio-go/v7 v7.0.74 github.com/montanaflynn/stats v0.7.1 github.com/shopspring/decimal v1.4.0 - go.sia.tech/core v0.4.2 - go.sia.tech/coreutils v0.2.3 + go.sia.tech/core v0.4.3 + go.sia.tech/coreutils v0.2.5 go.sia.tech/gofakes3 v0.0.4 go.sia.tech/hostd v1.1.3-0.20240807214810-c2d8ed84dc45 go.sia.tech/jape v0.12.0 go.sia.tech/mux v1.2.0 go.sia.tech/web/renterd v0.57.0 go.uber.org/zap v1.27.0 - golang.org/x/crypto v0.25.0 - golang.org/x/sys v0.23.0 - golang.org/x/term v0.22.0 + golang.org/x/crypto v0.26.0 + golang.org/x/sys v0.24.0 + golang.org/x/term v0.23.0 gopkg.in/yaml.v3 v3.0.1 gorm.io/driver/mysql v1.5.7 gorm.io/driver/sqlite v1.5.6 @@ -55,7 +55,7 @@ require ( go.sia.tech/web v0.0.0-20240610131903-5611d44a533e // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.22.0 // indirect nhooyr.io/websocket v1.8.11 // indirect diff --git a/go.sum b/go.sum index 7e8b2c527..334709158 100644 --- a/go.sum +++ b/go.sum @@ -84,10 +84,10 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8 github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 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.4.2 h1:5VCRuRJAOy0cWwG32IGB0BXQAviXgKRfNXOiU0zSViM= -go.sia.tech/core v0.4.2/go.mod h1:cGfGNcyAq1k4oIOsrNpJV/Z/p+20/IMS6vIaofE8nr8= -go.sia.tech/coreutils v0.2.3 h1:wbCJI3Tti/uvDg9H7knUOPt6imNTZU+XjOuyHhtaRtQ= -go.sia.tech/coreutils v0.2.3/go.mod h1:0D0NLh0c0pBUNKPoO/rDtyyRapB5j4/gfATNyQO67Rs= +go.sia.tech/core v0.4.3 h1:XEX7v6X8eJh4zyOkSHYi6FsyD+N/OEKw/NIigaaWPAU= +go.sia.tech/core v0.4.3/go.mod h1:cGfGNcyAq1k4oIOsrNpJV/Z/p+20/IMS6vIaofE8nr8= +go.sia.tech/coreutils v0.2.5 h1:oMnBGMBRfxhLzTH1ZDBg0Ep0QLE2GE1lND9yfzOzenA= +go.sia.tech/coreutils v0.2.5/go.mod h1:Pg9eE3xL25couNL/vYrtCWP5uXkVvC+SUcMVh1/E7+I= go.sia.tech/gofakes3 v0.0.4 h1:Kvo8j5cVdJRBXvV1KBJ69bocY23twG8ao/HCdwuPMeI= go.sia.tech/gofakes3 v0.0.4/go.mod h1:6hh4lETCMbyFFNWp3FRE838geY6vh1Aeas7LtYDpQdc= go.sia.tech/hostd v1.1.3-0.20240807214810-c2d8ed84dc45 h1:yq8n3leZWAeEwbAa3sbqe5mS5LgG5IH23aM8tefSuUo= @@ -113,8 +113,8 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= @@ -127,8 +127,8 @@ golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -136,15 +136,15 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= -golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From d2ab6e74f88eaa07b78b72c944736ba3c270bdc2 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Mon, 12 Aug 2024 07:32:00 +0200 Subject: [PATCH 2/3] fix build --- bus/bus.go | 8 ++++---- stores/sql/main.go | 2 -- stores/sql/mysql/chain.go | 4 ++-- stores/sql/sqlite/chain.go | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bus/bus.go b/bus/bus.go index 029aa2c97..a3576ecd3 100644 --- a/bus/bus.go +++ b/bus/bus.go @@ -217,7 +217,7 @@ type ( SignTransaction(txn *types.Transaction, toSign []types.Hash256, cf types.CoveredFields) SpendableOutputs() ([]types.SiacoinElement, error) Tip() (types.ChainIndex, error) - UnconfirmedTransactions() ([]wallet.Event, error) + UnconfirmedEvents() ([]wallet.Event, error) Events(offset, limit int) ([]wallet.Event, error) } @@ -616,7 +616,7 @@ func (b *bus) walletTransactionsHandler(jc jape.Context) { txn = types.Transaction{SiacoinOutputs: []types.SiacoinOutput{payout.SiacoinElement.SiacoinOutput}} case wallet.EventTypeV1Transaction: v1Txn, _ := data.(wallet.EventV1Transaction) - txn = types.Transaction(v1Txn) + txn = types.Transaction(v1Txn.Transaction) case wallet.EventTypeV1ContractResolution: fce, _ := data.(wallet.EventV1ContractResolution) txn = types.Transaction{ @@ -638,8 +638,8 @@ func (b *bus) walletTransactionsHandler(jc jape.Context) { Raw: txn, Index: e.Index, ID: types.TransactionID(e.ID), - Inflow: e.Inflow, - Outflow: e.Outflow, + Inflow: e.SiacoinInflow(), + Outflow: e.SiacoinOutflow(), Timestamp: e.Timestamp, }) } diff --git a/stores/sql/main.go b/stores/sql/main.go index 3c5653b34..a210098df 100644 --- a/stores/sql/main.go +++ b/stores/sql/main.go @@ -2563,8 +2563,6 @@ func scanWalletEvent(s Scanner) (wallet.Event, error) { ID: types.BlockID(blockID), Height: height, }, - Inflow: types.Currency(inflow), - Outflow: types.Currency(outflow), Type: etype, Data: data, MaturityHeight: maturityHeight, diff --git a/stores/sql/mysql/chain.go b/stores/sql/mysql/chain.go index 0195a2dc6..281881240 100644 --- a/stores/sql/mysql/chain.go +++ b/stores/sql/mysql/chain.go @@ -95,8 +95,8 @@ func (c ChainUpdateTx) WalletApplyIndex(index types.ChainIndex, created, spent [ ssql.Hash256(e.ID), e.Index.Height, ssql.Hash256(e.Index.ID), - ssql.Currency(e.Inflow), - ssql.Currency(e.Outflow), + ssql.Currency(e.SiacoinInflow()), + ssql.Currency(e.SiacoinOutflow()), e.Type, data, e.MaturityHeight, diff --git a/stores/sql/sqlite/chain.go b/stores/sql/sqlite/chain.go index b93789367..905a2b9e8 100644 --- a/stores/sql/sqlite/chain.go +++ b/stores/sql/sqlite/chain.go @@ -98,8 +98,8 @@ func (c ChainUpdateTx) WalletApplyIndex(index types.ChainIndex, created, spent [ e.Index.Height, ssql.Hash256(e.Index.ID), ssql.Hash256(e.ID), - ssql.Currency(e.Inflow), - ssql.Currency(e.Outflow), + ssql.Currency(e.SiacoinInflow()), + ssql.Currency(e.SiacoinOutflow()), e.Type, data, e.MaturityHeight, From b5900f40f9b735e9bd215a48bc95a7418e813102 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Mon, 12 Aug 2024 08:16:29 +0200 Subject: [PATCH 3/3] e2e: fix TestWalletTransactions --- stores/sql/types.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/stores/sql/types.go b/stores/sql/types.go index 7aaeb230d..bd58ad818 100644 --- a/stores/sql/types.go +++ b/stores/sql/types.go @@ -377,19 +377,28 @@ func UnmarshalEventData(b []byte, t string) (dst wallet.EventData, err error) { case wallet.EventTypeMinerPayout, wallet.EventTypeSiafundClaim, wallet.EventTypeFoundationSubsidy: - dst = new(wallet.EventPayout) + var e wallet.EventPayout + err = json.Unmarshal(b, &e) + dst = e case wallet.EventTypeV1ContractResolution: - dst = new(wallet.EventV1ContractResolution) + var e wallet.EventV1ContractResolution + err = json.Unmarshal(b, &e) + dst = e case wallet.EventTypeV2ContractResolution: - dst = new(wallet.EventV2ContractResolution) + var e wallet.EventV2ContractResolution + err = json.Unmarshal(b, &e) + dst = e case wallet.EventTypeV1Transaction: - dst = new(wallet.EventV1Transaction) + var e wallet.EventV1Transaction + err = json.Unmarshal(b, &e) + dst = e case wallet.EventTypeV2Transaction: - dst = new(wallet.EventV2Transaction) + var e wallet.EventV2Transaction + err = json.Unmarshal(b, &e) + dst = e default: return nil, fmt.Errorf("unknown event type %v", t) } - err = json.Unmarshal(b, dst) return }