Skip to content

Use ink abi in contract-transfer #2563

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ jobs:
with:
command: |
mkdir -p measurements-${{ env.MEASUREMENTS_ID }}/
ls -lh measurements-${{ env.MEASUREMENTS_ID }}/
scripts/for_all_contracts_exec2.sh --path integration-tests \
--ignore solidity-abi/sol-cross-contract --ignore solidity-abi/sol-encoding \
--ignore solidity-abi/solidity-calls-flipper --ignore solidity-abi/events \
Expand All @@ -770,6 +771,7 @@ jobs:
--ignore solidity-abi/sol-cross-contract/other-contract-sol \
--ignore solidity-abi/trait-dyn-cross-contract-calls/contracts/incrementer -- \
scripts/build_and_determine_contract_size.sh {}
ls -lh measurements-${{ env.MEASUREMENTS_ID }}/

# NOTE: Sharing build artifacts (i.e. via a shared cargo target directory) with other contracts
# that don't have the same ABI set makes the builds fail.
Expand Down
5 changes: 2 additions & 3 deletions integration-tests/public/contract-transfer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ publish = false
ink = { path = "../../../crates/ink", default-features = false, features = ["unstable-hostfn"] }

[dev-dependencies]
#ink_e2e = { path = "../../../crates/e2e" }
ink_e2e = { path = "../../../crates/e2e", features = ["sandbox"] }
ink_e2e = { path = "../../../crates/e2e" }

[lib]
path = "lib.rs"
Expand All @@ -24,4 +23,4 @@ ink-as-dependency = []
e2e-tests = []

[package.metadata.ink-lang]
abi = "ink"
abi = "sol"
4 changes: 1 addition & 3 deletions integration-tests/public/contract-transfer/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ pub mod give_me {
type E2EResult<T> = std::result::Result<T, Box<dyn std::error::Error>>;

#[ink_e2e::test]
//#[ink_e2e::test(backend(runtime_only))]
async fn e2e_sending_value_to_give_me_must_fail<Client: E2EBackend>(
mut client: Client,
) -> E2EResult<()> {
Expand Down Expand Up @@ -235,8 +234,7 @@ pub mod give_me {
Ok(())
}

//#[ink_e2e::test]
#[ink_e2e::test(backend(runtime_only))]
#[ink_e2e::test]
async fn e2e_contract_must_transfer_value_to_sender<Client: E2EBackend>(
mut client: Client,
) -> E2EResult<()> {
Expand Down
17 changes: 13 additions & 4 deletions scripts/for_all_contracts_exec2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,25 @@ fi

for (( i = start; i <= end; i++ )); do
manifest_path="${filtered_manifests[$i]}"
echo "manifest_path" $manifest_path >&2
example="$(dirname "$manifest_path" | cut -d'/' -f3)"
echo "example" $example >&2
#export CONTRACT_SIZE_FILE="$CONTRACT_SIZE_FILE$manifest_parent"
#echo $CONTRACT_SIZE_FILE >&2
size_file="$CONTRACT_SIZE_FILE$example"
echo "size_file" $size_file >&2
command[$arg_index]="$manifest_path"
if [ "$quiet" = false ]; then
>&2 echo Running: "${command[@]}"
fi
eval "${command[@]}" >> ${CONTRACT_SIZE_FILE}$example
sed -ie 's/^integration-tests\/\(public\/\|internal\/\)\?//' ${CONTRACT_SIZE_FILE}$example
echo "writing to " $size_file >&2
echo "command: ${command[@]} >> $size_file"
ls -lh measurements-* >&2
eval "${command[@]}" >> $size_file
ls -lh ${CONTRACT_SIZE_FILE}$example* >&2
sed -ie 's/^integration-tests\/\(public\/\|internal\/\)\?//' $size_file
ls -lh ${CONTRACT_SIZE_FILE}$example* >&2
echo "cat: "
cat ${CONTRACT_SIZE_FILE}$example >&2
echo "" >&2

if [ $? -eq 0 ]; then
successes+=("$manifest_path")
Expand Down
Loading