Skip to content

Commit f9982a3

Browse files
committed
fix: update paths and make rules
1 parent 5121c35 commit f9982a3

File tree

29 files changed

+265
-166
lines changed

29 files changed

+265
-166
lines changed

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/Agoric/cosmic-swingset
1+
module github.com/Agoric/agoric-sdk
22

33
go 1.14
44

@@ -29,6 +29,6 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alp
2929
// replace github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.34.4-0.20201011165527-9684bf64c2db
3030

3131
// For testing against a local cosmos-sdk or tendermint
32-
// replace github.com/cosmos/cosmos-sdk => ../../../forks/cosmos-sdk
32+
// replace github.com/cosmos/cosmos-sdk => ../forks/cosmos-sdk
3333

34-
// replace github.com/tendermint/tendermint => ../../../forks/tendermint
34+
// replace github.com/tendermint/tendermint => ../forks/tendermint

golang/cosmos/.gitignore

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# OS
2+
.DS_Store
3+
*.swp
4+
*.swo
5+
.vscode
6+
.idea
7+
8+
# Build
9+
vendor
10+
.vendor-new
11+
build
12+
13+
# IDE
14+
.idea/
15+
*.iml
16+
node_modules
17+
t[0-9]/
18+
19+
ve[0-9]/
20+
ve[0-9]-client/
21+
*.egg-info/
22+
__pycache__/
23+
chains
24+
solo
25+
solo/
26+
27+
# emacs
28+
*~
29+
30+
# Logs
31+
logs
32+
*.log
33+
npm-debug.log*
34+
yarn-debug.log*
35+
yarn-error.log*
36+
37+
# Runtime data
38+
pids
39+
*.pid
40+
*.seed
41+
*.pid.lock
42+
43+
# Directory for instrumented libs generated by jscoverage/JSCover
44+
lib-cov
45+
46+
# Coverage directory used by tools like istanbul
47+
coverage
48+
49+
# nyc test coverage
50+
.nyc_output
51+
52+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
53+
.grunt
54+
55+
# Bower dependency directory (https://bower.io/)
56+
bower_components
57+
58+
# node-waf configuration
59+
.lock-wscript
60+
61+
# Compiled binary addons (https://nodejs.org/api/addons.html)
62+
build/Release
63+
64+
# Dependency directories
65+
node_modules
66+
jspm_packages/
67+
68+
# TypeScript v1 declaration files
69+
typings/
70+
71+
# Optional npm cache directory
72+
.npm
73+
74+
# Optional eslint cache
75+
.eslintcache
76+
77+
# Optional REPL history
78+
.node_repl_history
79+
80+
# Yarn Integrity file
81+
.yarn-integrity
82+
83+
# dotenv environment variables file
84+
.env
85+
86+
# next.js build output
87+
.next
88+
lib/git-revision.txt
89+
/binding.gyp
90+
*-stamp

golang/cosmos/Makefile

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
NAME := unknown
2+
VERSION := unknown
3+
COMMIT = $(shell git log -1 --format='%H' 2>/dev/null)
4+
5+
MOD_READONLY = # -mod=readonly
6+
7+
BIN := $(shell echo $${GOBIN-$${GOPATH-$$HOME/go}/bin})
8+
LIBDAEMON := $(shell echo $${GOBIN-$${GOPATH-$$HOME/go}/lib})/libdaemon.so
9+
10+
whitespace :=
11+
whitespace += $(whitespace)
12+
comma := ,
13+
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))
14+
15+
# process linker flags
16+
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(NAME) \
17+
-X github.com/cosmos/cosmos-sdk/version.AppName=ag-cosmos-server \
18+
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
19+
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
20+
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
21+
22+
gcflags =
23+
24+
ifneq ($(GO_DEBUG),)
25+
ldflags += -compressdwarf=false
26+
gcflags += -N -l
27+
endif
28+
29+
30+
ldflags_helper = $(ldflags) \
31+
-X github.com/cosmos/cosmos-sdk/version.AppName=ag-cosmos-helper
32+
BUILD_FLAGS := -tags "$(build_tags)" -gcflags '$(gcflags)' -ldflags '$(ldflags)'
33+
BUILD_FLAGS_HELPER := -tags "$(build_tags)" -gcflags '$(gcflags)' -ldflags '$(ldflags_helper)'
34+
35+
include Makefile.ledger
36+
37+
all: ../../go.sum
38+
go install -v $(MOD_READONLY) $(BUILD_FLAGS_HELPER) ./cmd/helper
39+
go build -v $(MOD_READONLY) $(BUILD_FLAGS) -buildmode=c-shared -o $(LIBDAEMON) ./cmd/libdaemon/main.go
40+
test "`uname -s 2>/dev/null`" != Darwin || install_name_tool -id $(LIBDAEMON) $(LIBDAEMON)
41+
42+
go-mod-cache: ../../go.sum
43+
@echo "--> Download go modules to local cache"
44+
@go mod download
45+
46+
../../go.sum: ../../go.mod
47+
@echo "--> Ensure dependencies have not been modified"
48+
GO111MODULE=on go mod verify
49+
50+
###############################################################################
51+
### Protobuf ###
52+
###############################################################################
53+
54+
proto-gen: proto-tools
55+
./scripts/protocgen.sh
56+
57+
proto-lint: proto-tools
58+
buf check lint --error-format=json
59+
60+
proto-check-breaking: proto-tools
61+
buf check breaking --against-input '.git#branch=master'
62+
63+
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc3/proto/tendermint
64+
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
65+
IBC_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/master/proto/ibc/core
66+
COSMOS_SDK_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/master/proto/cosmos/base
67+
68+
GOGO_PROTO_TYPES = third_party/proto/gogoproto
69+
IBC_CHANNEL_TYPES = third_party/proto/ibc/core/channel/v1
70+
IBC_CLIENT_TYPES = third_party/proto/ibc/core/client/v1
71+
SDK_QUERY_TYPES = third_party/proto/cosmos/base/query/v1beta1
72+
73+
proto-update-deps:
74+
mkdir -p $(GOGO_PROTO_TYPES)
75+
curl -sSL $(GOGO_PROTO_URL)/gogoproto/gogo.proto > $(GOGO_PROTO_TYPES)/gogo.proto
76+
77+
mkdir -p $(IBC_CHANNEL_TYPES)
78+
curl -sSL $(IBC_PROTO_URL)/channel/v1/channel.proto > $(IBC_CHANNEL_TYPES)/channel.proto
79+
80+
mkdir -p $(IBC_CLIENT_TYPES)
81+
curl -sSL $(IBC_PROTO_URL)/client/v1/client.proto > $(IBC_CLIENT_TYPES)/client.proto
82+
83+
mkdir -p $(SDK_QUERY_TYPES)
84+
curl -sSL $(COSMOS_SDK_PROTO_URL)/query/v1beta1/pagination.proto > $(SDK_QUERY_TYPES)/pagination.proto
85+
86+
87+
UNAME_S ?= $(shell uname -s)
88+
UNAME_M ?= $(shell uname -m)
89+
90+
BUF_VERSION ?= 0.11.0
91+
92+
PROTOC_VERSION ?= 3.11.2
93+
ifeq ($(UNAME_S),Linux)
94+
PROTOC_ZIP ?= protoc-${PROTOC_VERSION}-linux-x86_64.zip
95+
endif
96+
ifeq ($(UNAME_S),Darwin)
97+
PROTOC_ZIP ?= protoc-${PROTOC_VERSION}-osx-x86_64.zip
98+
endif
99+
100+
proto-tools: proto-tools-stamp buf
101+
102+
proto-tools-stamp:
103+
echo "Installing protoc compiler..."
104+
(cd /tmp; \
105+
curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"; \
106+
unzip -o ${PROTOC_ZIP} -d ${BIN}/.. bin/protoc 'include/*'; \
107+
rm -f ${PROTOC_ZIP})
108+
109+
echo "Installing protoc-gen-gocosmos..."
110+
go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos
111+
112+
# Create dummy file to satisfy dependency and avoid
113+
# rebuilding when this Makefile target is hit twice
114+
# in a row
115+
touch $@
116+
117+
buf: buf-stamp
118+
119+
buf-stamp:
120+
echo "Installing buf..."
121+
curl -sSL \
122+
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-${UNAME_S}-${UNAME_M}" \
123+
-o "${BIN}/buf" && \
124+
chmod +x "${BIN}/buf"
125+
126+
touch $@
127+
128+
tools-clean:
129+
rm -f proto-tools-stamp buf-stamp

golang/cosmos/app/app.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ import (
8585
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
8686
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
8787

88-
gaiaappparams "github.com/Agoric/cosmic-swingset/app/params"
89-
"github.com/Agoric/cosmic-swingset/x/dibc"
90-
"github.com/Agoric/cosmic-swingset/x/swingset"
88+
gaiaappparams "github.com/Agoric/agoric-sdk/golang/cosmos/app/params"
89+
"github.com/Agoric/agoric-sdk/golang/cosmos/x/dibc"
90+
"github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset"
9191

9292
// unnamed import of statik for swagger UI support
9393
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"

golang/cosmos/app/encoding.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package app
22

33
import (
4-
"github.com/Agoric/cosmic-swingset/app/params"
4+
"github.com/Agoric/agoric-sdk/golang/cosmos/app/params"
55
"github.com/cosmos/cosmos-sdk/std"
66
)
77

golang/cosmos/cmd/helper/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"os"
99
"path/filepath"
1010

11-
"github.com/Agoric/cosmic-swingset/app"
12-
"github.com/Agoric/cosmic-swingset/lib/daemon"
11+
"github.com/Agoric/agoric-sdk/golang/cosmos/app"
12+
"github.com/Agoric/agoric-sdk/golang/cosmos/daemon"
1313
)
1414

1515
func main() {

golang/cosmos/cmd/libdaemon/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"errors"
1515
"os"
1616

17-
"github.com/Agoric/cosmic-swingset/lib/daemon"
18-
swingset "github.com/Agoric/cosmic-swingset/x/swingset"
17+
"github.com/Agoric/agoric-sdk/golang/cosmos/daemon"
18+
swingset "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset"
1919
)
2020

2121
type goReturn = struct {

golang/cosmos/daemon/cmd/root.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import (
3131
"github.com/tendermint/tendermint/libs/log"
3232
dbm "github.com/tendermint/tm-db"
3333

34-
gaia "github.com/Agoric/cosmic-swingset/app"
35-
"github.com/Agoric/cosmic-swingset/app/params"
34+
gaia "github.com/Agoric/agoric-sdk/golang/cosmos/app"
35+
"github.com/Agoric/agoric-sdk/golang/cosmos/app/params"
3636
)
3737

3838
// Sender is a function that sends a request to the controller.

golang/cosmos/daemon/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
sdk "github.com/cosmos/cosmos-sdk/types"
88

9-
"github.com/Agoric/cosmic-swingset/lib/daemon/cmd"
9+
"github.com/Agoric/agoric-sdk/golang/cosmos/daemon/cmd"
1010
)
1111

1212
const (

golang/cosmos/proto/agoric/dibc/msgs.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package agoric.dibc;
44
import "gogoproto/gogo.proto";
55
import "ibc/core/channel/v1/channel.proto";
66

7-
option go_package = "github.com/Agoric/cosmic-swingset/x/dibc/types";
7+
option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/dibc/types";
88

99
service Msg {
1010
rpc SendPacket(MsgSendPacket) returns (MsgSendPacketResponse);

golang/cosmos/proto/agoric/swingset/genesis.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package agoric.swingset;
33

44
import "gogoproto/gogo.proto";
55

6-
option go_package = "github.com/Agoric/cosmic-swingset/x/swingset/types";
6+
option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types";
77

88
message GenesisState {
99
option (gogoproto.equal) = false;

golang/cosmos/proto/agoric/swingset/msgs.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package agoric.swingset;
33

44
import "gogoproto/gogo.proto";
55

6-
option go_package = "github.com/Agoric/cosmic-swingset/x/swingset/types";
6+
option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types";
77

88
service Msg {
99
rpc DeliverInbound(MsgDeliverInbound) returns (MsgDeliverInboundResponse);

golang/cosmos/proto/agoric/swingset/query.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "agoric/swingset/storage.proto";
66
import "cosmos/base/query/v1beta1/pagination.proto";
77
import "google/api/annotations.proto";
88

9-
option go_package = "github.com/Agoric/cosmic-swingset/x/swingset/types";
9+
option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types";
1010

1111
// Query provides defines the gRPC querier service
1212
service Query {

golang/cosmos/proto/agoric/swingset/storage.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package agoric.swingset;
33

44
import "gogoproto/gogo.proto";
55

6-
option go_package = "github.com/Agoric/cosmic-swingset/x/swingset/types";
6+
option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types";
77

88
message Storage {
99
option (gogoproto.equal) = false;

golang/cosmos/x/dibc/alias.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package dibc
22

33
import (
4-
"github.com/Agoric/cosmic-swingset/x/dibc/keeper"
5-
"github.com/Agoric/cosmic-swingset/x/dibc/types"
4+
"github.com/Agoric/agoric-sdk/golang/cosmos/x/dibc/keeper"
5+
"github.com/Agoric/agoric-sdk/golang/cosmos/x/dibc/types"
66
)
77

88
const (

golang/cosmos/x/dibc/handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"encoding/json"
55
"fmt"
66

7-
"github.com/Agoric/cosmic-swingset/x/swingset"
7+
"github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset"
88

99
sdk "github.com/cosmos/cosmos-sdk/types"
1010
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

golang/cosmos/x/dibc/ibc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
sdk "github.com/cosmos/cosmos-sdk/types"
1515

16-
"github.com/Agoric/cosmic-swingset/x/swingset"
16+
"github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset"
1717
)
1818

1919
type portHandler struct {

golang/cosmos/x/dibc/keeper/keeper.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
1616

17-
"github.com/Agoric/cosmic-swingset/x/dibc/types"
17+
"github.com/Agoric/agoric-sdk/golang/cosmos/x/dibc/types"
1818
)
1919

2020
// Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

golang/cosmos/x/dibc/module.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/grpc-ecosystem/grpc-gateway/runtime"
88
"github.com/spf13/cobra"
99

10-
"github.com/Agoric/cosmic-swingset/x/dibc/types"
10+
"github.com/Agoric/agoric-sdk/golang/cosmos/x/dibc/types"
1111

1212
"github.com/cosmos/cosmos-sdk/client"
1313
"github.com/cosmos/cosmos-sdk/codec"

0 commit comments

Comments
 (0)