Skip to content

Commit

Permalink
Change PoolsSDK.Query().AgentOwes() to .AgentInterestOwed()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Pick committed Jan 5, 2024
1 parent 80cdf49 commit 92e40f3
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 220 deletions.
2 changes: 1 addition & 1 deletion cmd/agent_exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var exitCmd = &cobra.Command{
logFatalf("Failed to get iFIL balance %s", err)
}

amountOwed, _, err := PoolsSDK.Query().AgentOwes(ctx, agentAddr)
amountOwed, err := PoolsSDK.Query().AgentInterestOwed(ctx, agentAddr, nil)
if err != nil {
logFatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/agent_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func econInfo(ctx context.Context, agent common.Address, agentID *big.Int, lapi
return PoolsSDK.Query().InfPoolAgentMaxBorrow(ctx, agent, agentData)
},
func() (interface{}, error) {
amountOwed, _, err := query.AgentOwes(ctx, agent)
amountOwed, err := query.AgentInterestOwed(ctx, agent, nil)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent_pay.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ func payAmount(ctx context.Context, cmd *cobra.Command, args []string, paymentTy
return nil, err
}

amountOwed, _, err := PoolsSDK.Query().AgentOwes(ctx, agentAddr)
amountOwed, err := PoolsSDK.Query().AgentInterestOwed(ctx, agentAddr, nil)
if err != nil {
return nil, err
}

payAmt = new(big.Int).Add(amount, amountOwed)
case ToCurrent:
amountOwed, _, err := PoolsSDK.Query().AgentOwes(ctx, agentAddr)
amountOwed, err := PoolsSDK.Query().AgentInterestOwed(ctx, agentAddr, nil)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/agent_pay_current.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var payToCurrentCmd = &cobra.Command{
logFatal(err)
}

amountOwed, _, err := PoolsSDK.Query().AgentOwes(cmd.Context(), agentAddr)
amountOwed, err := PoolsSDK.Query().AgentInterestOwed(cmd.Context(), agentAddr, nil)
if err != nil {
logFatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/agent_pay_principal.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var payPrincipalCmd = &cobra.Command{
logFatal(err)
}

amountOwed, _, err := PoolsSDK.Query().AgentOwes(cmd.Context(), agentAddr)
amountOwed, err := PoolsSDK.Query().AgentInterestOwed(cmd.Context(), agentAddr, nil)
if err != nil {
logFatal(err)
}
Expand Down
108 changes: 54 additions & 54 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ require (
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/briandowns/spinner v1.23.0
github.com/ethereum/go-ethereum v1.12.0
github.com/fatih/color v1.15.0
github.com/filecoin-project/go-address v1.1.0
github.com/filecoin-project/go-state-types v0.11.1
github.com/filecoin-project/lotus v1.23.0
github.com/glifio/go-pools v0.0.0-20230829035659-cf313239bb86
github.com/filecoin-project/go-state-types v0.12.8
github.com/filecoin-project/lotus v1.25.1
github.com/glifio/go-pools v0.0.0-20240104202749-7b05cc34097d
github.com/glifio/go-wallet-utils v0.0.0-20230719050429-ff6c4bc75533
github.com/golang/mock v1.6.0
github.com/ipfs/go-cid v0.4.0
github.com/ipfs/go-cid v0.4.1
github.com/pelletier/go-toml/v2 v2.0.6
github.com/raulk/clock v1.1.0
github.com/rodaine/table v1.1.0
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.3
github.com/stretchr/testify v1.8.4
github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31
golang.org/x/exp v0.0.0-20230206171751-46f607a40771
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
)

Expand All @@ -32,40 +33,41 @@ require (
github.com/GeertJohan/go.incremental v1.0.0 // indirect
github.com/GeertJohan/go.rice v1.0.3 // indirect
github.com/akavel/rsrc v0.8.0 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect
github.com/daaku/go.zipexe v1.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.3.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349 // indirect
github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 // indirect
github.com/filecoin-project/go-amt-ipld/v4 v4.0.0 // indirect
github.com/filecoin-project/go-amt-ipld/v4 v4.2.0 // indirect
github.com/filecoin-project/go-bitfield v0.2.4 // indirect
github.com/filecoin-project/go-cbor-util v0.0.1 // indirect
github.com/filecoin-project/go-crypto v0.0.1 // indirect
github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc4 // indirect
github.com/filecoin-project/go-fil-markets v1.27.0-rc1 // indirect
github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc7 // indirect
github.com/filecoin-project/go-fil-markets v1.28.3 // indirect
github.com/filecoin-project/go-hamt-ipld v0.1.5 // indirect
github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 // indirect
github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 // indirect
github.com/filecoin-project/go-jsonrpc v0.3.1 // indirect
github.com/filecoin-project/go-padreader v0.0.1 // indirect
github.com/filecoin-project/go-statemachine v1.0.3 // indirect
github.com/filecoin-project/go-statestore v0.2.0 // indirect
github.com/filecoin-project/kubo-api-client v0.0.1 // indirect
github.com/filecoin-project/specs-actors v0.9.15 // indirect
github.com/filecoin-project/specs-actors/v2 v2.3.6 // indirect
github.com/filecoin-project/specs-actors/v3 v3.1.2 // indirect
github.com/filecoin-project/specs-actors/v4 v4.0.2 // indirect
github.com/filecoin-project/specs-actors/v5 v5.0.6 // indirect
github.com/filecoin-project/specs-actors/v6 v6.0.2 // indirect
github.com/filecoin-project/specs-actors/v7 v7.0.1 // indirect
github.com/filecoin-project/specs-actors/v8 v8.0.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gbrlsnchs/jwt/v3 v3.0.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect
Expand All @@ -77,66 +79,62 @@ require (
github.com/hannahhoward/cbor-gen-for v0.0.0-20230214144701-5d17c9d5243c // indirect
github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.5 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/uint256 v1.2.3 // indirect
github.com/icza/backscanner v0.0.0-20210726202459-ac2ffc679f94 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ipfs/bbloom v0.0.4 // indirect
github.com/ipfs/go-block-format v0.1.1 // indirect
github.com/ipfs/go-blockservice v0.5.0 // indirect
github.com/ipfs/boxo v0.10.1 // indirect
github.com/ipfs/go-block-format v0.1.2 // indirect
github.com/ipfs/go-blockservice v0.5.1 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
github.com/ipfs/go-graphsync v0.14.3 // indirect
github.com/ipfs/go-ipfs-blockstore v1.2.0 // indirect
github.com/ipfs/go-ipfs-cmds v0.8.2 // indirect
github.com/ipfs/go-graphsync v0.14.6 // indirect
github.com/ipfs/go-ipfs-blockstore v1.3.0 // indirect
github.com/ipfs/go-ipfs-cmds v0.9.0 // indirect
github.com/ipfs/go-ipfs-ds-help v1.1.0 // indirect
github.com/ipfs/go-ipfs-exchange-interface v0.2.0 // indirect
github.com/ipfs/go-ipfs-http-client v0.5.0 // indirect
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
github.com/ipfs/go-ipfs-util v0.0.3 // indirect
github.com/ipfs/go-ipld-cbor v0.0.6 // indirect
github.com/ipfs/go-ipld-format v0.4.0 // indirect
github.com/ipfs/go-ipld-legacy v0.1.1 // indirect
github.com/ipfs/go-libipfs v0.7.0 // indirect
github.com/ipfs/go-ipld-format v0.5.0 // indirect
github.com/ipfs/go-ipld-legacy v0.2.1 // indirect
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/ipfs/go-merkledag v0.9.0 // indirect
github.com/ipfs/go-merkledag v0.11.0 // indirect
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
github.com/ipfs/go-path v0.3.1 // indirect
github.com/ipfs/go-unixfs v0.4.3 // indirect
github.com/ipfs/go-verifcid v0.0.2 // indirect
github.com/ipfs/interface-go-ipfs-core v0.11.1 // indirect
github.com/ipld/go-car v0.5.0 // indirect
github.com/ipld/go-codec-dagpb v1.5.0 // indirect
github.com/ipld/go-car v0.6.1 // indirect
github.com/ipld/go-codec-dagpb v1.6.0 // indirect
github.com/ipld/go-ipld-prime v0.20.0 // indirect
github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/jessevdk/go-flags v1.4.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-flow-metrics v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.26.2 // indirect
github.com/libp2p/go-libp2p v0.30.0 // indirect
github.com/libp2p/go-libp2p-pubsub v0.9.3 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/magefile/mage v1.9.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/miekg/dns v1.1.55 // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr v0.8.0 // indirect
github.com/multiformats/go-multiaddr v0.11.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multicodec v0.8.0 // indirect
github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.4.1 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/nkovacs/streamquote v1.0.0 // indirect
Expand All @@ -155,29 +153,31 @@ require (
github.com/subosito/gotenv v1.4.2 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/urfave/cli/v2 v2.25.5 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba // indirect
github.com/whyrusleeping/cbor-gen v0.0.0-20230126041949-52956bd4c9aa // indirect
github.com/whyrusleeping/cbor-gen v0.0.0-20230923211252-36a87e1ba72f // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel v1.12.0 // indirect
go.opentelemetry.io/otel/trace v1.12.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)
Loading

0 comments on commit 92e40f3

Please sign in to comment.