Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Update godwoken and scripts #119

Merged
merged 4 commits into from
Feb 10, 2022
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
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ jobs:
export MOLC_VERSION=$(cat deps/godwoken-scripts/c/Makefile | egrep "MOLC_VERSION :=" | awk '{print $3}')
test "$(moleculec --version)" = "Moleculec $MOLC_VERSION" \
|| CARGO_TARGET_DIR=target/ cargo install moleculec --version $MOLC_VERSION
- name: Install ckb-cli
run: which ckb-cli || CARGO_TARGET_DIR=target/ cargo install ckb-cli --version 0.43.0
- name: Install ckb-cli from nervos/godwoken-prebuilds:latest
run: |
docker run --rm -v /bin:/bin-dir nervos/godwoken-prebuilds:latest \
cp /bin/ckb-cli /bin-dir/ && echo "Install ckb-cli to /bin/"
ckb-cli --version

- name: Validate the checksum of SudtERC20Proxy Contract.bin
run: make contract/sudt-erc20-proxy
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ all: build/blockchain.h build/godwoken.h \
build/generator_log build/validator_log \
build/eth_addr_reg_generator build/eth_addr_reg_validator

all-via-docker: generate-protocol
all-via-docker: generate-protocol fetch-gw-scripts
mkdir -p build
docker run --rm -v `pwd`:/code -w /code ${BUILDER_DOCKER} make
make patch-generator && make patch-generator_log
Expand Down Expand Up @@ -233,7 +233,6 @@ build/blockchain.h: build/blockchain.mol
${MOLC} --language c --schema-file $< > $@

build/godwoken.h: build/godwoken.mol
cat c/polyjuice.mol >> build/godwoken.mol
${MOLC} --language c --schema-file $< > $@

contract/sudt-erc20-proxy:
Expand All @@ -250,9 +249,8 @@ contract/sudt-erc20-proxy:

fetch-gw-scripts:
mkdir -p build
docker pull nervos/godwoken-prebuilds:latest
docker run --rm -v `pwd`/build:/build-dir \
nervos/godwoken-prebuilds:latest \
ghcr.io/flouse/godwoken-prebuilds:v1.0.x-aot-202202080748 \
cp -r /scripts/godwoken-scripts /build-dir \
&& echo "Copy godwoken-scripts"

Expand Down
4 changes: 2 additions & 2 deletions c/eth_addr_reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ int handle_fee(gw_context_t *ctx, uint64_t fee) {
return ret;
}

const uint32_t CKB_SUDT_ACCOUNT_ID = 1;
const uint32_t ckb_sudt_account_id = CKB_SUDT_ACCOUNT_ID;
const uint64_t SHORT_SCRIPT_HASH_LEN = DEFAULT_SHORT_SCRIPT_HASH_LEN;
return sudt_pay_fee(ctx, CKB_SUDT_ACCOUNT_ID, SHORT_SCRIPT_HASH_LEN,
return sudt_pay_fee(ctx, ckb_sudt_account_id, SHORT_SCRIPT_HASH_LEN,
payer_account_script_hash, fee);
}

Expand Down
29 changes: 0 additions & 29 deletions c/polyjuice.mol

This file was deleted.

2 changes: 1 addition & 1 deletion deps/godwoken-scripts
4 changes: 2 additions & 2 deletions devtools/ci/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ if [ -d "$GODWOKEN_DIR" ]
then
echo "godwoken project already exists"
else
git clone -b develop https://github.com/nervosnetwork/godwoken.git $GODWOKEN_DIR
git clone -b compatibility-breaking-changes https://github.com/nervosnetwork/godwoken.git $GODWOKEN_DIR
fi
cd $GODWOKEN_DIR
git checkout 9ae6b667d476c11bff5ce50e74e31c14135b955a # https://github.com/nervosnetwork/godwoken/commits/9ae6b66
git checkout 8da36de46fd703419869f013c41f4755add0a982 # https://github.com/nervosnetwork/godwoken/commits/8da36de
git submodule update --init --recursive --depth=1

cd $PROJECT_ROOT
Expand Down
Loading