0LNetworkCommunity / libra-legacy-v6

Apache License 2.0
248 stars 116 forks source link

TransactionArgument to include AddressVector #316

Open 0o-de-lally opened 3 years ago

0o-de-lally commented 3 years ago

We want to add the type AddressVector to all transaction helpers in Rust, so that transaction scripts which use vector

as an argument can be called from Rust.

On branch address-vector

Steps to test:

  1. Build stdlib (which will generate the transaction helpers in client/transaction-builder/src/stdlib.rs)
  2. Check that Language can build with cargo check

Two issues:

  1. The Stdlib does not generate, when using the AddressVector here:

https://github.com/OLSF/libra/blob/9a4c230bc742545cbb70a5cf55610bbd7adfbebb/language/transaction-builder/generator/src/common.rs#L31-L37

  1. The cargo check fails because there is no type AddressVector = Vec in the generated client/transaction-builder/src/stdlib.rs

https://github.com/OLSF/libra/blob/9a4c230bc742545cbb70a5cf55610bbd7adfbebb/language/transaction-builder/generator/src/rust.rs#L455-L464

liangping commented 3 years ago

https://github.com/OLSF/libra/commit/2e4665f75243e5934d58390f13ac88cfc6c1b2b6

should work now.

0o-de-lally commented 3 years ago

@liangping I merged address-vector branch into miner-onboarding and fixed most of the test cases. All the functional tests are passing. Also swarm is working. Plus the transactions the depend on addressvector.

However all the e2e tests are not working. It gives a compiler error now. Probably related to creating the addressvector. Can you take a look?

repro: cd libra/language/e2e-testsuite/ && cargo test ol

liangping commented 3 years ago

I didn't reproduce this issue? Did you push you code?

liangping commented 3 years ago

Here's introduction for proptest framework. https://docs.rs/proptest/0.8.7/proptest/

0o-de-lally commented 3 years ago

@tarcieri can you take a quick look at this? Repro with cd libra/language/e2e-testsuite/ && cargo test ol

0o-de-lally commented 3 years ago
tarcieri commented 3 years ago

Is there a particular branch I should be running this on? On the default OLv4 branch it appears to be working:

running 9 tests
test tests::ol_minerstate_onboarding::miner_onboarding ... ignored
test tests::ol_trusted_account_update::demo ... ok
test tests::ol_demo::demo ... ok
test tests::ol_autopay_enable::autopay_enable_test ... ok
test tests::ol_autopay_create::autopay_create_test ... ok
test tests::ol_minerstate_commit::miner_commit ... ok
test tests::ol_reconfig::reconfig_bulk_update_test ... ok
test tests::ol_upgrade_oracle::test_single_oracle_tx ... ok
test tests::ol_upgrade_oracle::test_validators_oracle_tx ... ok
0o-de-lally commented 3 years ago

ahh yes would be branch address-vector

liangping commented 3 years ago

branch miner-onboarding