Skip to content

Commit

Permalink
fixes (#357)
Browse files Browse the repository at this point in the history
* fixing transfer_keep_alive and origin for create community on parachain

* keep CI as it was

* fix srtool build

* pin srtool
  • Loading branch information
brenzi authored Feb 21, 2024
1 parent 2cbb4ed commit 679f06d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ jobs:
srtool-target-
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
uses: chevdor/srtool-actions@v0.9.2
with:
image: paritytech/srtool
tag: 1.74.0
chain: ${{ matrix.runtime }}
runtime_dir: runtime

Expand Down
22 changes: 11 additions & 11 deletions client/bootstrap_demo_community.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
start node with
../target/release/encointer-node-notee --dev --tmp --ws-port 9945 --enable-offchain-indexing true --rpc-methods unsafe
or start parachain with
or start parachain with
then run this script
./bootstrap_demo_community.py --port 9945
Expand Down Expand Up @@ -64,9 +64,9 @@ def update_spec_with_cid(file, cid):
spec_json.truncate()


def create_community(client, spec_file_path, ipfs_local):
# non sudoer can create community
cid = client.new_community(spec_file_path, signer=account2)
def create_community(client, spec_file_path, ipfs_local, signer):
# non sudoer can create community on gesell (provide --signer but don't use //Alice), but not on parachain (where council will create)
cid = client.new_community(spec_file_path, signer=signer)
if len(cid) > 10:
print(f'Registered community with cid: {cid}')
else:
Expand Down Expand Up @@ -293,11 +293,11 @@ def test_faucet(client, cid):
if(not client.balance("//Eve") == balance(9000)):
print(f"Dissolve failed")
exit(1)

if(not client.balance("//Bob") == balance_bob + balance(3000)):
print(f"Dissolve failed")
exit(1)

print('Faucet dissolved', flush=True)
client.create_faucet("//Bob", "TestFaucet", balance(10000), balance(9000), [cid], cid=cid, pay_fees_in_cc=True)
client.await_block(2)
Expand All @@ -314,7 +314,7 @@ def test_faucet(client, cid):
if(not client.balance(faucet_account) == 0):
print(f"Faucet closing failed with wrong faucet balance")
exit(1)

if(not client.balance("//Bob") == balance_bob + balance(3000)):
print(f"Faucet closing failed with wrong bob balance")
exit(1)
Expand Down Expand Up @@ -369,15 +369,15 @@ def test_democracy(client, cid):

@click.command()
@click.option('--client', default='../target/release/encointer-client-notee', help='Client binary to communicate with the chain.')
@click.option('--signer', help='optional account keypair creating the community')
@click.option('-u', '--url', default='ws://127.0.0.1', help='URL of the chain.')
@click.option('-p', '--port', default='9944', help='ws-port of the chain.')
@click.option('-l', '--ipfs-local', is_flag=True, help='if set, local ipfs node is used.')
@click.option('-s', '--spec-file', default=f'{TEST_DATA_DIR}{TEST_LOCATIONS_MEDITERRANEAN}', help='Specify community spec-file to be registered.')
@click.option('-t', '--test', is_flag=True, help='if set, run integration tests.')
def main(ipfs_local, client, url, port, spec_file, test):
def main(ipfs_local, client, signer, url, port, spec_file, test):
client = Client(rust_client=client, node_url=url, port=port)
cid = create_community(client, spec_file, ipfs_local)

cid = create_community(client, spec_file, ipfs_local, signer)

newbie = client.create_accounts(1)[0]
faucet(client, cid, [account3, newbie])
Expand Down Expand Up @@ -413,7 +413,7 @@ def main(ipfs_local, client, url, port, spec_file, test):
if not len(rep) > 0:
print("no reputation gained")
exit(1)

register_participants_and_perform_meetup(client, cid, accounts)
client.next_phase()
client.await_block(1)
Expand Down
2 changes: 1 addition & 1 deletion client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ async fn main() {
let call = compose_call!(
api.metadata(),
"Balances",
"transfer",
"transfer_keep_alive",
ExtrinsicAddress::from(to.clone()),
Compact(amount)
);
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/test_bootstrap_demo_community.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ CURRENT_DIR=$(pwd)

cd "$CLIENT_DIR"

python bootstrap_demo_community.py --client $CLIENT_BIN --test
python bootstrap_demo_community.py --client $CLIENT_BIN --signer //Bob --test

cd "$CURRENT_DIR"
cd "$CURRENT_DIR"
2 changes: 1 addition & 1 deletion scripts/install_python_deps.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail

python -m pip install --upgrade pip
python3 -m pip install --upgrade pip
pip install geojson pyproj RandomWords wonderwords requests flask substrate-interface click

0 comments on commit 679f06d

Please sign in to comment.