Skip to content

Commit

Permalink
fix: Use new version of the connector. (#527)
Browse files Browse the repository at this point in the history
* fix: Don't use env::signer_account_id

Instead use env::predecessor_account_id. Using signer_account_id
has the same problems of using tx.origin in Ethereum. See link
below for more details:

ethereum/solidity#683

* fix: Use fixed near-sdk-version

Need to use fixed near-sdk-version for compatibility
with rainbow-token-connector. This restriction will
be lifted once the special commit used by the connector
lands on near-sdk-rs.

* Add test to check near contracts are compiled correctly

* Fix pipeline.yml syntax

* Update near-sdk from eth-types

* Recompile contracts

* fix: Use new version of the connector.

TODO: Don't use current pinned commit from token-connector,
instead wait until it is merged into master

* Update arguments to deploy locker

using new interface

* Use fixed amount of gas

* Compile contracts

* Update tests

* Update cli/package.json

Use commit on master.
  • Loading branch information
mfornet authored Mar 14, 2021
1 parent b57f8fe commit 2f242ef
Show file tree
Hide file tree
Showing 25 changed files with 678 additions and 438 deletions.
13 changes: 13 additions & 0 deletions .buildkite/contracts-near.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
steps:
- label: "build all rust contracts"
command: |
cd contracts/near/eth-client
./build.sh
cd ../eth-prover
./build.sh
git status
changed_files=$$(git status --porcelain --untracked-files=no | wc -l)
if [ $$changed_files -gt 0 ]; then
echo 'contract changed, please rebuild contract'
exit 1
fi
3 changes: 3 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ steps:

- label: "contracts/eth/"
command: buildkite-agent pipeline upload .buildkite/contracts-eth.yml

- label: "contracts/near/"
command: buildkite-agent pipeline upload .buildkite/contracts-near.yml
7 changes: 6 additions & 1 deletion cli/init/eth-contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,17 @@ class InitEthLocker {

console.log('Using as locker admin:', ethAdminAddress)
const ethContractInitializer = new EthContractInitializer()
const minBlockAcceptanceHeight = 0
const pausedFlag = 0

const success = await ethContractInitializer.execute(
{
args: [
Buffer.from(nearTokenFactoryAccount, 'utf8'),
ethProverAddress,
ethAdminAddress
minBlockAcceptanceHeight,
ethAdminAddress,
pausedFlag
],
gas: 5000000,
ethContractAbiPath: ethLockerAbiPath,
Expand Down
4 changes: 2 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"rainbow-bridge-near2eth-block-relay": "1.0.0",
"rainbow-bridge-watchdog": "1.0.0",
"rainbow-bridge-testing": "1.0.0",
"rainbow-token-connector": "near/rainbow-token-connector#0646850267c42057e92f2d670eebe79c9c9211f9",
"rainbow-token-connector": "near/rainbow-token-connector#7fb86958362fe8e4455ebbcdb00caac067eda2ff",
"request": "^2.88.2"
}
}
}
Loading

0 comments on commit 2f242ef

Please sign in to comment.