Skip to content

Commit

Permalink
cgo: Use int64 for birthday time.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeGruffins committed Jun 20, 2024
1 parent 101e49f commit bee2e90
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cgo/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func birthState(cName *C.char) *C.char {
bsRes := &BirthdayState{
Hash: bs.Hash.String(),
Height: bs.Height,
Time: bs.Time,
Time: bs.Time.Unix(),
SetFromHeight: bs.SetFromHeight,
SetFromTime: bs.SetFromTime,
}
Expand Down
11 changes: 5 additions & 6 deletions cgo/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "C"
import (
"encoding/json"
"fmt"
"time"

wallettypes "decred.org/dcrwallet/v4/rpc/jsonrpc/types"
)
Expand Down Expand Up @@ -140,9 +139,9 @@ type ListTransactionRes struct {
}

type BirthdayState struct {
Hash string `json:"hash"`
Height uint32 `json:"height"`
Time time.Time `json:"time"`
SetFromHeight bool `json:"setfromheight"`
SetFromTime bool `json:"setfromtime"`
Hash string `json:"hash"`
Height uint32 `json:"height"`
Time int64 `json:"time"`
SetFromHeight bool `json:"setfromheight"`
SetFromTime bool `json:"setfromtime"`
}
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/decred/libwallet

require (
decred.org/dcrdex v0.0.0-20240415203145-79c4689fd164
decred.org/dcrwallet/v4 v4.1.1
decred.org/dcrwallet/v4 v4.1.2
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/decred/dcrd/addrmgr/v2 v2.0.4
github.com/decred/dcrd/chaincfg/chainhash v1.0.4
Expand All @@ -15,7 +15,7 @@ require (
github.com/decred/slog v1.2.0
github.com/jrick/logrotate v1.0.0
github.com/kevinburke/nacl v0.0.0-20210405173606-cd9060f5f776
golang.org/x/crypto v0.23.0
golang.org/x/crypto v0.24.0
)

require (
Expand All @@ -26,15 +26,17 @@ require (
github.com/decred/base58 v1.0.5 // indirect
github.com/decred/dcrd/blockchain/stake/v5 v5.0.1 // indirect
github.com/decred/dcrd/blockchain/standalone/v2 v2.2.1 // indirect
github.com/decred/dcrd/container/lru v1.0.0 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
github.com/decred/dcrd/crypto/rand v1.0.0 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/database/v3 v3.0.2 // indirect
github.com/decred/dcrd/dcrec v1.0.1 // indirect
github.com/decred/dcrd/dcrec/edwards/v2 v2.0.3 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/decred/dcrd/dcrjson/v4 v4.1.0 // indirect
github.com/decred/dcrd/gcs/v4 v4.1.0 // indirect
github.com/decred/dcrd/mixing v0.3.0 // indirect
github.com/decred/dcrd/mixing v0.4.0 // indirect
github.com/decred/dcrd/rpc/jsonrpc/types/v4 v4.3.0 // indirect
github.com/decred/go-socks v1.1.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
Expand All @@ -45,7 +47,7 @@ require (
go.etcd.io/bbolt v1.3.8 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/sys v0.21.0 // indirect
lukechampine.com/blake3 v1.3.0 // indirect
)

Expand Down
20 changes: 12 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ decred.org/cspp/v2 v2.2.0 h1:VSOUC1w0Wo+QOGS0r1XO6TLnO16X67KuvpDmRRYyr08=
decred.org/cspp/v2 v2.2.0/go.mod h1:9nO3bfvCheOPIFZw5f6sRQ42CjBFB5RKSaJ9Iq6G4MA=
decred.org/dcrdex v0.0.0-20240415203145-79c4689fd164 h1:ImD+Zui9lnZhVYacX0x9ki1M95hTYxwASl2PvVoAc2M=
decred.org/dcrdex v0.0.0-20240415203145-79c4689fd164/go.mod h1:rvIXDCS3B3gbu8b0tKDvNU664nC+/zVl3ivs6AeA2V8=
decred.org/dcrwallet/v4 v4.1.1 h1:imwPBboytp1PH6V8q7/JLTHiKgj/Scq9a3I1WmnJv0Y=
decred.org/dcrwallet/v4 v4.1.1/go.mod h1:WxerkRcUGVreJsAI0ptCBPUujPUmWncbdYbme8Kl5r0=
decred.org/dcrwallet/v4 v4.1.2 h1:NESPkLLpLXwrsWRmeDSLM/O5NaSMFSyjQrG+9m0iuzk=
decred.org/dcrwallet/v4 v4.1.2/go.mod h1:Ivu6THxbdMLGxKTa/eJT7vDr2awmKok7gEh82oCxs/s=
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI=
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
Expand All @@ -30,8 +30,12 @@ github.com/decred/dcrd/chaincfg/v3 v3.2.1 h1:x9zKJaU24WAKbxAR1UyFKHlM3oJgP0H9Lod
github.com/decred/dcrd/chaincfg/v3 v3.2.1/go.mod h1:SDCWDtY7BLj0leXc9FuoA1YjSVKyCIBVAyxwZn6+sXc=
github.com/decred/dcrd/connmgr/v3 v3.1.2 h1:+xNopie2L3YYwwkz51k0h/pASATOBzHtl2O8eodGg04=
github.com/decred/dcrd/connmgr/v3 v3.1.2/go.mod h1:tdbErFiNOuy/sHrX2mwaOk+r1HLs3EBz2EGxsocMPe4=
github.com/decred/dcrd/container/lru v1.0.0 h1:7foQymtbu18aQWYiY9RnNIeE+kvpiN+fiBQ3+viyJjI=
github.com/decred/dcrd/container/lru v1.0.0/go.mod h1:vlPwj0l+IzAHhQSsbgQnJgO5Cte78+yI065V+Mc5PRQ=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/rand v1.0.0 h1:Ah9Asl36OZt09sGSMbJZuL1HfwGdlC38q/ZUeLDVKRg=
github.com/decred/dcrd/crypto/rand v1.0.0/go.mod h1:coa7BbxSTiKH6esi257plGfMFYuGL4MTbQlLYnOdzpE=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 h1:TvGTmUBHDU75OHro9ojPLK+Yv7gDl2hnUvRocRCjsys=
github.com/decred/dcrd/crypto/ripemd160 v1.0.2/go.mod h1:uGfjDyePSpa75cSQLzNdVmWlbQMBuiJkvXw/MNKRY4M=
github.com/decred/dcrd/database/v3 v3.0.2 h1:rgP7XNZemTs8ZC7bnTKO8JO79Woj5nq+yQYmB9ry7yM=
Expand All @@ -50,8 +54,8 @@ github.com/decred/dcrd/gcs/v4 v4.1.0 h1:tpW7JW53yJZlgNwl/n2NL1b8NxHaIPRUyNuLMkB/
github.com/decred/dcrd/gcs/v4 v4.1.0/go.mod h1:nPTbGM/I3Ihe5KFvUmxZEqQP/jDZQjQ63+WEi/f4lqU=
github.com/decred/dcrd/hdkeychain/v3 v3.1.2 h1:x25WuuE7zM/20EynuVMyOhL0K8BwGBBsexGq8xTiHFA=
github.com/decred/dcrd/hdkeychain/v3 v3.1.2/go.mod h1:FnNJmZ7jqUDeAo6/c/xkQi5cuxh3EWtJeMmW6/Z8lcc=
github.com/decred/dcrd/mixing v0.3.0 h1:eUHpTdwTqXUllnn1ZYLfxucW/2UOkMmx4CyztipTJ9g=
github.com/decred/dcrd/mixing v0.3.0/go.mod h1:W3K7yJKmoI03G2U5Yw+HSRNe6lLBegi63ZR6fFLnM9c=
github.com/decred/dcrd/mixing v0.4.0 h1:XblHAND4Vt5owVUvjPorDg30eWT53DpCZs6VF7U1t6U=
github.com/decred/dcrd/mixing v0.4.0/go.mod h1:ySvVwTZyVz5YvevA6YjPrB6pJEwTm7IkHohTfaiHh2c=
github.com/decred/dcrd/rpc/jsonrpc/types/v4 v4.3.0 h1:l0DnCcILTNrpy8APF3FLN312ChpkQaAuW30aC/RgBaw=
github.com/decred/dcrd/rpc/jsonrpc/types/v4 v4.3.0/go.mod h1:j+kkRPXPJB5S9VFOsx8SQLcU7PTFkPKRc1aCHN4ENzA=
github.com/decred/dcrd/txscript/v4 v4.1.1 h1:R4M2+jMujgQA91899SkL0cW66d6DC76Gx+1W1oEHjc0=
Expand Down Expand Up @@ -87,15 +91,15 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA=
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down

0 comments on commit bee2e90

Please sign in to comment.