Skip to content

Commit

Permalink
refactor: switch proto files to SDK math (#6270)
Browse files Browse the repository at this point in the history
* refactor: switch proto files to SDK math

* updates
  • Loading branch information
p0mvn authored Sep 4, 2023
1 parent 63e8787 commit c7904f6
Show file tree
Hide file tree
Showing 84 changed files with 2,570 additions and 2,452 deletions.
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.20

require (
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.1.2
github.com/CosmWasm/wasmd v0.31.0
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/cosmos-sdk v0.47.4
Expand All @@ -21,10 +22,10 @@ require (
github.com/mattn/go-sqlite3 v1.14.17
github.com/ory/dockertest/v3 v3.10.0
github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3
github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230830181116-75b4d5f6a4c2
github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230830181116-75b4d5f6a4c2
github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230830181116-75b4d5f6a4c2
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230830181116-75b4d5f6a4c2
github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230901175805-bab180bc078b
github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230901175805-bab180bc078b
github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230901175805-bab180bc078b
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230901175805-bab180bc078b
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.1
Expand All @@ -46,7 +47,6 @@ require (

require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
cosmossdk.io/math v1.1.2 // indirect
github.com/4meepo/tagalign v1.3.2 // indirect
github.com/Abirdcfly/dupword v0.0.12 // indirect
github.com/Djarvur/go-err113 v0.1.0 // indirect
Expand All @@ -56,8 +56,8 @@ require (
github.com/alingse/asasalint v0.0.11 // indirect
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/butuzov/mirror v1.1.0 // indirect
github.com/bytedance/sonic v1.10.0 // indirect
github.com/ccojocar/zxcvbn-go v1.0.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/cosmos/gogoproto v1.4.11 // indirect
github.com/cosmos/iavl v0.19.5 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
Expand Down
25 changes: 8 additions & 17 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7N
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
github.com/bytedance/sonic v1.10.0 h1:qtNZduETEIWJVIyDl01BeNxur2rW9OwTQ/yBqFRkKEk=
github.com/bytedance/sonic v1.10.0/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34=
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/ccojocar/zxcvbn-go v1.0.1 h1:+sxrANSCj6CdadkcMnvde/GWU1vZiiXRbqYSCalV4/4=
Expand Down Expand Up @@ -963,22 +962,14 @@ github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230829222007-529c69c19915 h1:
github.com/osmosis-labs/cosmos-sdk v0.45.0-rc1.0.20230829222007-529c69c19915/go.mod h1:L6USUt+QX9lIqUVCRs8DFEVRZJbCYbemmtcXb7GfHYE=
github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:YlmchqTmlwdWSmrRmXKR+PcU96ntOd8u10vTaTZdcNY=
github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI=
github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230804142026-a81cfe3ddde7 h1:NTR4zfrPMP4pJ5T60zyZumBAnTWmTAQX/JSZLGrM9jI=
github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230804142026-a81cfe3ddde7/go.mod h1:UlftwozB+QObT3o0YfkuuyL9fsVdgoWt0dm6J7MLYnU=
github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230830181116-75b4d5f6a4c2 h1:m3pUdFUUJ97iuKFB8szkuOp5aQdufaS7q0XPC/FfO5E=
github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230830181116-75b4d5f6a4c2/go.mod h1:MakArTjDobfAOPe2myXDSRRTeP8amtcYcSpG80UoOcE=
github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230807183608-16c217dedde5 h1:j4ifxomFROGROHalqWwX7VPDgxOPotMB1GiAWdb03i4=
github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230807183608-16c217dedde5/go.mod h1:Pl8Nzx6O6ow/+aqfMoMSz4hX+zz6RrnDYsooptECGxM=
github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230830181116-75b4d5f6a4c2 h1:UU1YGwJieag2oSK4LyMTH9ulCkp5VGKOL57jWAmAx9U=
github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230830181116-75b4d5f6a4c2/go.mod h1:6ekJSCvnwK3AB7RVJV0Z6xdC+WoMTyAyBjsjuXRU+Zg=
github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230328024000-175ec88e4304 h1:RIrWLzIiZN5Xd2JOfSOtGZaf6V3qEQYg6EaDTAkMnCo=
github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230328024000-175ec88e4304/go.mod h1:yPWoJTj5RKrXKUChAicp+G/4Ni/uVEpp27mi/FF/L9c=
github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230830181116-75b4d5f6a4c2 h1:HPiXZ8SyAALdzrlD/vl3lTwYt+6PtcTy3rlQ2xwpL7Y=
github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230830181116-75b4d5f6a4c2/go.mod h1:dAcK2rT6RDusLHuCWBvE+ciHg2vicoVDwiSpxsL4zvI=
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230807183608-16c217dedde5 h1:clEegVniz0zTTBXKfg2oymKa63IYUxcrVXM+LtsvCpA=
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230807183608-16c217dedde5/go.mod h1:sR0lpev9mcm9/9RY50T1og3UC3WpZAsINh/OmgrmFlg=
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230830181116-75b4d5f6a4c2 h1:Jt67EXP/eEXwkBJHaUgE+sqvP+WS4yVTQYDqQKgQWJ4=
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230830181116-75b4d5f6a4c2/go.mod h1:Vww+9pUXpbnemAQBEGimE7RwDQIRvBPySB/F3aPbExU=
github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230901175805-bab180bc078b h1:Sw0WZKfZrUz+ozJhcjZ64TQFOtOHwqSLKrNOLonhXUU=
github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20230901175805-bab180bc078b/go.mod h1:MakArTjDobfAOPe2myXDSRRTeP8amtcYcSpG80UoOcE=
github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230901175805-bab180bc078b h1:UFJcRrnM4q+kgvVvH35+Au5Mzj6Www4SYIF3LG0AvgM=
github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20230901175805-bab180bc078b/go.mod h1:6ekJSCvnwK3AB7RVJV0Z6xdC+WoMTyAyBjsjuXRU+Zg=
github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230901175805-bab180bc078b h1:6w9/InjrxkQ3Q+3OKdtKQQh4lyUiMb5iknG3NhdtpHc=
github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20230901175805-bab180bc078b/go.mod h1:dAcK2rT6RDusLHuCWBvE+ciHg2vicoVDwiSpxsL4zvI=
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230901175805-bab180bc078b h1:hGUSuffzHPtbu3sjCZi9FK3NkSEkyexg3v2z/H6Bxwg=
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.9-0.20230901175805-bab180bc078b/go.mod h1:Vww+9pUXpbnemAQBEGimE7RwDQIRvBPySB/F3aPbExU=
github.com/osmosis-labs/wasmd v0.31.0-osmo-v16 h1:X747cZYdnqc/+RV48iPVeGprpVb/fUWSaKGsZUWrdbg=
github.com/osmosis-labs/wasmd v0.31.0-osmo-v16/go.mod h1:Rf8zW/GgBQyFRRB4s62VQHWA6sTlMFSjoDQQpoq64iI=
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
Expand Down
60 changes: 31 additions & 29 deletions osmoutils/accum/accum.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion osmoutils/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/osmosis-labs/osmosis/osmoutils
go 1.20

require (
cosmossdk.io/math v1.1.2
github.com/cosmos/cosmos-sdk v0.47.4
github.com/cosmos/iavl v0.19.5
github.com/cosmos/ibc-go/v4 v4.3.1
Expand All @@ -16,7 +17,6 @@ require (
)

require (
cosmossdk.io/math v1.1.2 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
Expand Down
46 changes: 23 additions & 23 deletions osmoutils/sumtree/tree.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions proto/osmosis/accum/v1beta1/accum.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ message AccumulatorContent {
(gogoproto.nullable) = false
];
string total_shares = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",

(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
}
Expand All @@ -28,7 +29,8 @@ message Record {
// num_shares is the number of shares belonging to the position associated
// with this record.
string num_shares = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",

(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
// accum_value_per_share is the subset of coins per shar of the global
Expand Down
3 changes: 2 additions & 1 deletion proto/osmosis/concentrated-liquidity/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ message PoolRecord {
uint64 tick_spacing = 3 [ (gogoproto.moretags) = "yaml:\"tick_spacing\"" ];
reserved 4;
string spread_factor = 5 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",

(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.moretags) = "yaml:\"spread_factor\"",
(gogoproto.nullable) = false
];
Expand Down
Loading

0 comments on commit c7904f6

Please sign in to comment.