Skip to content

Commit

Permalink
chore: Update version of Substrate pallet (#377)
Browse files Browse the repository at this point in the history
Co-authored-by: Matija Petrunić <[email protected]>
  • Loading branch information
mj52951 and mpetrun5 authored Oct 23, 2024
1 parent 0b38483 commit 4a3613b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
33 changes: 0 additions & 33 deletions e2e/evm/evm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,39 +242,6 @@ func (s *IntegrationTestSuite) Test_Erc721Deposit() {
s.Equal(dstAddr.String(), owner.String())
}

func (s *IntegrationTestSuite) Test_GenericDeposit() {
transactor1 := signAndSend.NewSignAndSendTransactor(s.fabric1, s.gasPricer1, s.client1)
transactor2 := signAndSend.NewSignAndSendTransactor(s.fabric2, s.gasPricer2, s.client2)

bridgeContract1 := bridge.NewBridgeContract(s.client1, s.config1.BridgeAddr, transactor1)
assetStoreContract2 := centrifuge.NewAssetStoreContract(s.client2, s.config2.AssetStoreAddr, transactor2)

byteArrayToHash, _ := substrateTypes.NewI64(int64(rand.Int())).MarshalJSON()
hash := substrateTypes.NewHash(byteArrayToHash)

handlerBalanceBefore, err := s.client1.BalanceAt(context.TODO(), s.config1.BasicFeeHandlerAddr, nil)
s.Nil(err)

genericDepositData := evm.ConstructGenericDepositData(hash[:])
depositTxHash, err := bridgeContract1.ExecuteTransaction("deposit", transactor.TransactOptions{Value: s.config1.BasicFee}, uint8(2), s.config1.GenericResourceID, genericDepositData, []byte{})

s.Nil(err)

_, _, err = s.client1.TransactionByHash(context.Background(), *depositTxHash)
s.Nil(err)

err = evm.WaitForProposalExecuted(s.client2, s.config2.BridgeAddr)
s.Nil(err)
// Asset hash sent is stored in centrifuge asset store contract
exists, err := assetStoreContract2.IsCentrifugeAssetStored(hash)
s.Nil(err)
s.Equal(true, exists)

handlerBalanceAfter, err := s.client1.BalanceAt(context.TODO(), s.config1.BasicFeeHandlerAddr, nil)
s.Nil(err)
s.Equal(handlerBalanceAfter, big.NewInt(0).Add(handlerBalanceBefore, s.config1.BasicFee))
}

func (s *IntegrationTestSuite) Test_PermissionlessGenericDeposit() {
transactor1 := signAndSend.NewSignAndSendTransactor(s.fabric1, s.gasPricer1, s.client1)
transactor2 := signAndSend.NewSignAndSendTransactor(s.fabric2, s.gasPricer2, s.client2)
Expand Down
2 changes: 1 addition & 1 deletion e2e/substrate/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (
type USDCAsset struct{}

func (a USDCAsset) Encode(encoder scale.Encoder) error {
_ = encoder.Write([]byte{0, 1, 3, 0, 81, 31, 6, 5, 115, 121, 103, 109, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 4, 117, 115, 100, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4})
_ = encoder.Write([]byte{0, 1, 3, 0, 85, 31, 6, 5, 115, 121, 103, 109, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 4, 117, 115, 100, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4})
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ services:

substrate-pallet:
container_name: substrate-pallet
image: "ghcr.io/sygmaprotocol/sygma-substrate-pallets:e2e-v0.2.1"
image: "ghcr.io/sygmaprotocol/sygma-substrate-pallets:e2e-v0.3.1"
ports:
- "9944:9944"
- "9933:9933"
Expand Down

0 comments on commit 4a3613b

Please sign in to comment.