Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: github ci error #10

Merged
merged 7 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .github/workflows/autopr.yml

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/ci-smart-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- main

env:
TEST_DOCKER_IMAGE: finschianode:smartcontractci
TEST_DOCKER_IMAGE: finschianode-proxy:smartcontractci

jobs:
cleanup-runs:
Expand Down Expand Up @@ -66,8 +66,8 @@ jobs:
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: fnsad
path: ./build/fnsad
name: fnsad-proxy
path: ./build/fnsad-proxy

test-smart-contract-on-local-node:
runs-on: ubuntu-latest
Expand All @@ -92,7 +92,7 @@ jobs:
- name: Download build
uses: actions/download-artifact@v3
with:
name: fnsad
name: fnsad-proxy
path: ./build
- name: Build install
run: make install
Expand All @@ -103,14 +103,14 @@ jobs:
- name: Start local node
id: start
run: |
fnsad start &
fnsad-proxy start &
sleep 1
- name: CI test
run: bash ./ci_test/queue_ci.sh
shell: bash
- name: Stop local node
if: ${{ always() && steps.start.conclusion == 'success' }}
run: kill $(ps -ef | grep "fnsad start" | grep -v grep | awk '{print $2}')
run: kill $(ps -ef | grep "fnsad-proxy start" | grep -v grep | awk '{print $2}')

build-finschia-docker-image:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -161,7 +161,8 @@ jobs:
docker image ls -a
- name: Set configure file
run: |
export FNSAD="docker run -i --rm -p 26656:26656 -p 26657:26657 -v ${pwd}/.finschia:/root/.finschia ${{ env.TEST_DOCKER_IMAGE }} fnsad"
export FNSAD="docker run -i --rm -p 26656:26656 -p 26657:26657 -v $(pwd)/.fnsap:/root/.fnsap ${{ env.TEST_DOCKER_IMAGE }} fnsad-proxy"
export CHAIN_DIR="/root/.fnsap"
./init_single.sh
shell: bash
# sleep 5 seconds to wait for finschia to start up
Expand All @@ -170,10 +171,10 @@ jobs:
run: |
container_id=$(docker run -d \
-p 26656:26656 -p 26657:26657 \
-v ${pwd}/.finschia:/root/.finschia \
-v $(pwd)/.fnsap:/root/.fnsap \
-v $(pwd)/ci_test:/root/ci_test \
-v $(pwd)/contracts:/root/contracts \
${{ env.TEST_DOCKER_IMAGE }} fnsad start)
${{ env.TEST_DOCKER_IMAGE }} fnsad-proxy start --home=/root/.fnsap)
echo "container_id=$container_id" >> "$GITHUB_OUTPUT"
sleep 5
- name: CI test
Expand Down
88 changes: 0 additions & 88 deletions .github/workflows/docker.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/tag.yml

This file was deleted.

6 changes: 5 additions & 1 deletion ante/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ func (msc AppOptionsMock) Get(key string) any {
}

func DefaultTxFilter() []string {
return []string{"cosmos.bank"}
return []string{"cosmos", "lbm", "cosmwasm", "ibc"}
}

func DefaultDisableFilter() bool {
return true
}
2 changes: 0 additions & 2 deletions ante/txfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ func (tfd TxFilterDecorator) filterWasmLogics(msg sdk.Msg) error {
} else if !tfd.Options.AllowedContract[wasmExec.Contract] {
return fmt.Errorf("%s is not allowed contract", wasmExec.Contract)
}
} else {
return fmt.Errorf("%s is not allowed on proxy node", sdk.MsgTypeURL(msg))
}
return nil
}
Expand Down
56 changes: 28 additions & 28 deletions ante/txfilter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,114 +39,114 @@ func TestGenWhiteRegex(t *testing.T) {
func TestTxFilterDecorator_CheckIfAllowed(t *testing.T) {
tcs := []struct {
msgs []sdk.Msg
pass bool
ErrStr string
allowedTargets []string
allowedContracts []string
ErrStr string
pass bool
disableFilter bool
}{
{
[]sdk.Msg{&banktypes.MsgSend{}},
true,
"",
[]string{"cosmos.bank.v1beta1.MsgSend"},
nil,
"",
true,
false,
},
{
[]sdk.Msg{&banktypes.MsgSend{}},
true,
"",
[]string{"cosmos.bank.v1beta1"},
nil,
"",
true,
false,
},
{
[]sdk.Msg{&banktypes.MsgSend{}, &stakingtypes.MsgDelegate{}},
true,
"",
[]string{"cosmos.bank", "cosmos.staking"},
nil,
"",
true,
false,
},
{
[]sdk.Msg{&banktypes.MsgSend{}, &stakingtypes.MsgDelegate{}},
true,
"",
[]string{"cosmos"},
nil,
"",
true,
false,
},
{
[]sdk.Msg{&banktypes.MsgSend{}, &stakingtypes.MsgDelegate{}},
false,
"/cosmos.staking.v1beta1.MsgDelegate is not allowed on proxy node",
[]string{"cosmos.bank", "cosmos.sta"},
nil,
"/cosmos.staking.v1beta1.MsgDelegate is not allowed on proxy node",
false,
false,
},
{
[]sdk.Msg{&banktypes.MsgSend{}, &testdata.TestMsg{}},
false,
"/testdata.TestMsg is not allowed on proxy node",
[]string{"cosmos.bank"},
nil,
"/testdata.TestMsg is not allowed on proxy node",
false,
false,
},
{
[]sdk.Msg{},
true,
"",
[]string{"cosmos.bank"},
nil,
"",
true,
false,
},
{
[]sdk.Msg{&testdata.TestMsg{}},
false,
"/testdata.TestMsg is not allowed on proxy node",
nil,
nil,
"/testdata.TestMsg is not allowed on proxy node",
false,
false,
},
{
[]sdk.Msg{&wasmtypes.MsgExecuteContract{Contract: "allowedAddress"}},
true,
"",
[]string{"cosmwasm.wasm"},
[]string{"allowedAddress"},
"",
true,
false,
},
{
[]sdk.Msg{&wasmtypes.MsgExecuteContract{Contract: "forbiddenAddress"}},
false,
"forbiddenAddress is not allowed contract",
[]string{"cosmwasm.wasm"},
[]string{"allowedAddress"},
"forbiddenAddress is not allowed contract",
false,
false,
},
{
[]sdk.Msg{&wasmtypes.MsgExecuteContract{Contract: "forbiddenAddress"}},
true,
"",
[]string{"cosmwasm.wasm"},
[]string{"allowedAddress"},
"",
true,
true,
},
{
[]sdk.Msg{&wasmtypes.MsgExecuteContract{Contract: "forbiddenAddress"}},
false,
"forbiddenAddress is not allowed contract",
[]string{"cosmwasm.wasm"},
[]string{},
"forbiddenAddress is not allowed contract",
false,
false,
},
{
[]sdk.Msg{&lbmwasmtypes.MsgStoreCodeAndInstantiateContract{}},
false,
"/lbm.wasm.v1.MsgStoreCodeAndInstantiateContract is not allowed on proxy node",
[]string{"cosmwasm.wasm"},
nil,
"/lbm.wasm.v1.MsgStoreCodeAndInstantiateContract is not allowed on proxy node",
false,
false,
},
}
Expand Down
Loading
Loading