Skip to content

Commit

Permalink
Migrate to labs (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry authored Aug 1, 2024
1 parent d7647a2 commit 56edbc6
Show file tree
Hide file tree
Showing 33 changed files with 175 additions and 276 deletions.
102 changes: 0 additions & 102 deletions .circleci/config.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ci

on:
pull_request:
branches:
- '**'

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/[email protected]
with:
run-unit-tests: true
run-integration-tests: true
run-lint: true

docker_pipeline:
uses: babylonlabs-io/.github/.github/workflows/[email protected]
secrets: inherit
with:
publish: false
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: docker_publish

on:
push:
branches:
- 'main'
- 'dev'
tags:
- '*'

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/[email protected]
with:
run-unit-tests: true
run-integration-tests: true
run-lint: true

docker_pipeline:
needs: ["lint_test"]
uses: babylonlabs-io/.github/.github/workflows/[email protected]
secrets: inherit
with:
publish: true
44 changes: 0 additions & 44 deletions CHANGELOG.md

This file was deleted.

10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ FROM golang:1.21.4 as builder
RUN apt-get update && apt-get install -y make git bash gcc curl jq

# Build
WORKDIR /go/src/github.com/babylonchain/covenant-emulator
WORKDIR /go/src/github.com/babylonlabs-io/covenant-emulator
# Cache dependencies
COPY go.mod go.sum /go/src/github.com/babylonchain/covenant-emulator/
COPY go.mod go.sum /go/src/github.com/babylonlabs-io/covenant-emulator/
RUN go mod download
# Copy the rest of the files
COPY ./ /go/src/github.com/babylonchain/covenant-emulator/
COPY ./ /go/src/github.com/babylonlabs-io/covenant-emulator/

RUN BUILD_TAGS=netgo \
LDFLAGS="-w -s" \
Expand All @@ -21,7 +21,7 @@ RUN addgroup --gid 1138 --system covenant-emulator && adduser --uid 1138 --syste

RUN apt-get update && apt-get install -y bash curl jq wget

COPY --from=builder /go/src/github.com/babylonchain/covenant-emulator/go.mod /tmp
COPY --from=builder /go/src/github.com/babylonlabs-io/covenant-emulator/go.mod /tmp
RUN WASMVM_VERSION=$(grep github.com/CosmWasm/wasmvm /tmp/go.mod | cut -d' ' -f2) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm.$(uname -m).so \
-O /lib/libwasmvm.$(uname -m).so && \
Expand All @@ -30,7 +30,7 @@ RUN WASMVM_VERSION=$(grep github.com/CosmWasm/wasmvm /tmp/go.mod | cut -d' ' -f2
sha256sum /lib/libwasmvm.$(uname -m).so | grep $(cat /tmp/checksums.txt | grep libwasmvm.$(uname -m) | cut -d ' ' -f 1)
RUN rm -f /tmp/go.mod

COPY --from=builder /go/src/github.com/babylonchain/covenant-emulator/build/covd /bin/covd
COPY --from=builder /go/src/github.com/babylonlabs-io/covenant-emulator/build/covd /bin/covd

WORKDIR /home/covenant-emulator
RUN chown -R covenant-emulator /home/covenant-emulator
Expand Down
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.

Parameters

Licensor: Babylonchain, Inc.
Licensor: Babylon Labs, Ltd.

Licensed Work: covenant-emulator
The Licensed Work is (c) 2023 Babylonchain, Inc.
The Licensed Work is (c) 2024 Babylon Labs, Ltd.

Additional Use Grant: None.

Change Date: 2027-01-20 (January 20th, 2027]
Change Date: 2027-01-20 (January 20th, 2027)

Change License: Apache 2.0

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BUILDDIR ?= $(CURDIR)/build
TOOLS_DIR := tools

BABYLON_PKG := github.com/babylonchain/babylon/cmd/babylond
BABYLON_PKG := github.com/babylonlabs-io/babylon/cmd/babylond

GO_BIN := ${GOPATH}/bin

Expand Down Expand Up @@ -48,7 +48,7 @@ $(BUILDDIR)/:
mkdir -p $(BUILDDIR)/

build-docker:
$(DOCKER) build --tag babylonchain/covenant-emulator -f Dockerfile \
$(DOCKER) build --tag babylonlabs-io/covenant-emulator -f Dockerfile \
$(shell git rev-parse --show-toplevel)

.PHONY: build build-docker
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ verified the validity of the transactions and sent corresponding signatures.

Upon a pending staking request being found, the covenant emulation daemon
(`covd`), validates it against the spending rules defined in
[Staking Script specification](https://github.com/babylonchain/babylon/blob/dev/docs/staking-script.md),
[Staking Script specification](https://github.com/babylonlabs-io/babylon/blob/dev/docs/staking-script.md),
and sends three types of signatures to the Babylon chain:

1. **Slashing signature**. This signature is an [adaptor signature](https://bitcoinops.org/en/topics/adaptor-signatures/),
Expand Down Expand Up @@ -100,11 +100,11 @@ the [official Go installation guide](https://golang.org/doc/install).
To get started, clone the repository to your local machine from Github:

```bash
$ git clone [email protected]:babylonchain/covenant-emulator.git
$ git clone [email protected]:babylonlabs-io/covenant-emulator.git
```

You can choose a specific version from
the [official releases page](https://github.com/babylonchain/covenant-emulator/releases):
the [official releases page](https://github.com/babylonlabs-io/covenant-emulator/releases):

```bash
$ cd covenant-emulator # cd into the project directory
Expand Down
22 changes: 10 additions & 12 deletions clientcontroller/babylon.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

bbnclient "github.com/babylonchain/babylon/client/client"
bbntypes "github.com/babylonchain/babylon/types"
btcctypes "github.com/babylonchain/babylon/x/btccheckpoint/types"
btclctypes "github.com/babylonchain/babylon/x/btclightclient/types"
btcstakingtypes "github.com/babylonchain/babylon/x/btcstaking/types"
bbnclient "github.com/babylonlabs-io/babylon/client/client"
bbntypes "github.com/babylonlabs-io/babylon/types"
btcctypes "github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
btclctypes "github.com/babylonlabs-io/babylon/x/btclightclient/types"
btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
sdkclient "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkquery "github.com/cosmos/cosmos-sdk/types/query"
"github.com/cosmos/relayer/v2/relayer/provider"
"go.uber.org/zap"

"github.com/babylonchain/covenant-emulator/config"
"github.com/babylonchain/covenant-emulator/types"
"github.com/babylonlabs-io/covenant-emulator/config"
"github.com/babylonlabs-io/covenant-emulator/types"
)

var _ ClientController = &BabylonController{}
Expand Down Expand Up @@ -363,12 +362,11 @@ func (bc *BabylonController) CreateBTCDelegation(
// Register a finality provider to Babylon
// Currently this is only used for e2e tests, probably does not need to add it into the interface
func (bc *BabylonController) RegisterFinalityProvider(
bbnPubKey *secp256k1.PubKey, btcPubKey *bbntypes.BIP340PubKey, commission *sdkmath.LegacyDec,
description *stakingtypes.Description, pop *btcstakingtypes.ProofOfPossession) (*provider.RelayerTxResponse, error) {
btcPubKey *bbntypes.BIP340PubKey, commission *sdkmath.LegacyDec,
description *stakingtypes.Description, pop *btcstakingtypes.ProofOfPossessionBTC) (*provider.RelayerTxResponse, error) {
registerMsg := &btcstakingtypes.MsgCreateFinalityProvider{
Signer: bc.mustGetTxSigner(),
Addr: bc.mustGetTxSigner(),
Commission: commission,
BabylonPk: bbnPubKey,
BtcPk: btcPubKey,
Description: description,
Pop: pop,
Expand Down
4 changes: 2 additions & 2 deletions clientcontroller/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/btcsuite/btcd/chaincfg"
"go.uber.org/zap"

"github.com/babylonchain/covenant-emulator/config"
"github.com/babylonchain/covenant-emulator/types"
"github.com/babylonlabs-io/covenant-emulator/config"
"github.com/babylonlabs-io/covenant-emulator/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion clientcontroller/retry_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package clientcontroller

import (
sdkErr "cosmossdk.io/errors"
btcstakingtypes "github.com/babylonchain/babylon/x/btcstaking/types"
btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types"
)

// these errors are considered unrecoverable because these indicate
Expand Down
4 changes: 2 additions & 2 deletions cmd/covd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/jessevdk/go-flags"
"github.com/urfave/cli"

covcfg "github.com/babylonchain/covenant-emulator/config"
"github.com/babylonchain/covenant-emulator/util"
covcfg "github.com/babylonlabs-io/covenant-emulator/config"
"github.com/babylonlabs-io/covenant-emulator/util"
)

var initCommand = cli.Command{
Expand Down
6 changes: 3 additions & 3 deletions cmd/covd/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"encoding/json"
"fmt"

"github.com/babylonchain/babylon/types"
"github.com/babylonlabs-io/babylon/types"
"github.com/jessevdk/go-flags"
"github.com/urfave/cli"

covcfg "github.com/babylonchain/covenant-emulator/config"
"github.com/babylonchain/covenant-emulator/covenant"
covcfg "github.com/babylonlabs-io/covenant-emulator/config"
"github.com/babylonlabs-io/covenant-emulator/covenant"
)

type covenantKey struct {
Expand Down
Loading

0 comments on commit 56edbc6

Please sign in to comment.