Update remappings.txt for upgradeable contracts and set up submodule (#4639)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Ernesto García <ernestognw@gmail.com>
This commit is contained in:
Francisco
2023-10-02 15:41:18 -03:00
committed by GitHub
parent 5ed5a86d1d
commit abba0d047a
16 changed files with 78 additions and 34 deletions

View File

@ -15,7 +15,7 @@ base="${2-}"
bash scripts/upgradeable/transpile.sh
commit="$(git rev-parse --short HEAD)"
branch="$(git rev-parse --abbrev-ref HEAD)"
start_branch="$(git rev-parse --abbrev-ref HEAD)"
git add contracts
@ -36,9 +36,19 @@ else
fi
fi
# commit if there are changes to commit
if ! git diff --quiet --cached; then
git commit -m "Transpile $commit"
# abort if there are no changes to commit at this point
if git diff --quiet --cached; then
exit
fi
git checkout "$branch"
if [[ -v SUBMODULE_REMOTE ]]; then
lib=lib/openzeppelin-contracts
git submodule add -b "${base#origin/}" "$SUBMODULE_REMOTE" "$lib"
git -C "$lib" checkout "$commit"
git add "$lib"
fi
git commit -m "Transpile $commit"
# return to original branch
git checkout "$start_branch"

View File

@ -319,6 +319,14 @@ index 3a1617c09..97e59c2d9 100644
},
"keywords": [
"solidity",
diff --git a/remappings.txt b/remappings.txt
index 304d1386a..a1cd63bee 100644
--- a/remappings.txt
+++ b/remappings.txt
@@ -1 +1,2 @@
-@openzeppelin/contracts/=contracts/
+@openzeppelin/contracts-upgradeable/=contracts/
+@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
diff --git a/test/utils/cryptography/EIP712.test.js b/test/utils/cryptography/EIP712.test.js
index faf01f1a3..b25171a56 100644
--- a/test/utils/cryptography/EIP712.test.js