Skip to content
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

Add functionality to switchboard to link receiver capabilities to different receiver types #107

Merged
merged 16 commits into from
Dec 16, 2022

Conversation

alilloig
Copy link
Member

@alilloig alilloig commented Dec 12, 2022

Closes: #102 #104
(both issues are the same, 102 was raised before, 104 explains really good the problem)

Description

Includes a new method on the switchboard addNewVaultWrapper(capability: Capability<&{FungibleToken.Receiver}>, type: Type) that allows to link a receiver to the switchboard that will be able to receive a deposit from a different type of receiver than the linked one


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels
  • Update the version in package.json when there is a change in the smart contracts

@alilloig alilloig linked an issue Dec 12, 2022 that may be closed by this pull request
@alilloig alilloig added Feedback Improvement SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board labels Dec 12, 2022
Copy link
Member

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great!

README.md Outdated Show resolved Hide resolved
@bluesign
Copy link

When do we plan to release switchboard?

Co-authored-by: Joshua Hannan <[email protected]>
@alilloig
Copy link
Member Author

Hi @bluesign !! Couple of weeks ago we uploaded it to testnet in order to get it into mainnet asap. The lacking of this feature was noticed by @bjartek and another user. Once this get merged and updated on testnet probably we can deploy it on mainnet, I'll love to do it next week before the holidays.

@alilloig
Copy link
Member Author

@satyamakgec @sisyphusSmiling this is running okey locally, have you ever run into this issue?

Screenshot 2022-12-15 at 20 26 13

@sisyphusSmiling
Copy link
Contributor

@alilloig I was able to recreate this locally by updating flow-cli. Looks like the GH Action grabs the latest flow-cli release and runs the test. Taking a look at recent issues in the flow-cli repo, I see an issue that versions 0.42.0 and above are incompatible with flow-js-testing.

I've updated the flow-cli install command to include 0.41.2 as recommended by @sideninja in this issue, and it looks like ci is now passing.

@joshuahannan joshuahannan merged commit 1f51398 into master Dec 16, 2022
joshuahannan added a commit that referenced this pull request Mar 14, 2023
* avoid oppressive terminology

* avoid oppressive terminology

* Create FungibleTokenMetadataViews contract, include MetadataViews contract from NFT repo

* Apply suggestions from code review

Co-authored-by: Satyam Agrawal <[email protected]>

* Fix CI

* Remove unnecesary init parameter on ftvaultdata

* Fix CI

* Remove thumbnail and images from FTDisplay, add logo as only image and symbol string field

* Restore files after the testing crisis

* Fix setup account from view test

* Add auxiliary function for returning views and the case for returning the FTView

* Change logo (media) for logos (medias) at FTView

* Add comments and use of getFTView function instead of resolveView

* Add scripts for read metadata

* Delete returnview functions

* Switch to MetadataPublicPath

* Add metadata path

* Change balance for metadata path at transactions. Fix FTVaultData construction at ExampleToken

* Add default implementation for MetadataViews.Resolver methods

* Update contracts/FungibleToken.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleToken.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleTokenMetadataViews.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleTokenMetadataViews.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleToken.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleTokenMetadataViews.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleTokenMetadataViews.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleTokenMetadataViews.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleTokenMetadataViews.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleTokenMetadataViews.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Update contracts/FungibleTokenMetadataViews.cdc

Co-authored-by: Peter Siemens <[email protected]>

* Add consistency about vaultData field name

* Fix spelling typos

* FT metadata docs section

* Finish docs

* add metadata views to go tests

* move view methods to the balance interface

* Remove MetadataViews import from FungibleToken contract

* Normalize flow.json

* Split test suites

* Move timeout to jest config instead of per test suite

* Update go test for metadataviews

* get go tests working

* update ci

* Change references to ResolvePublicPath for VaultPublicPath

* Separate metadata tests from core features

* Create folder only for metadata transactions

* Rename utilityContracts folder as utility

* Remove the need of linking a resolver on the provider for returning a FTVaultData

* Add test case for FTDisplay and kill bug on ExampleToken catched with said test

* Fix github ci to get latest Flow CLI version

* Fix bug on event from issue #92

* Standarize comments on Example Token

* Standarize comments to docgen tool format on the FungibleToken contract interface

* Include contracts docs

* Fix broken links

* Update package.json version

* Fix typos

* Fix public path after merge conflicts

* Bump decode-uri-component from 0.2.0 to 0.2.2 in /lib/js/test (#105)

Bumps [decode-uri-component](https:/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https:/SamVerschueren/decode-uri-component/releases)
- [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add functionality to switchboard to link receiver capabilities to different receiver types (#107)

* Link the capabilty to the FT.Receiver also

* Add addNewVaultWrapper method

* Move create forwarder tx to its own folder

* Undo folder change to avoid modify tests

* Typo

* Create tx to add vault capability specifying the type to be deposited

* Create test for adding vault wrapper capability

* Make test

* Fix test name

* Fix comment

* Update version

* Update docs

* Update README.md

Co-authored-by: Joshua Hannan <[email protected]>

* Fix ci

* Update flow-cli version in ci workflow to 0.41.2 for flow-js-testing compatibility

Co-authored-by: Joshua Hannan <[email protected]>
Co-authored-by: Giovanni Sanchez <[email protected]>

* add import addresses

* Bump github.com/ethereum/go-ethereum in /lib/go/test (#117)

Bumps [github.com/ethereum/go-ethereum](https:/ethereum/go-ethereum) from 1.9.13 to 1.10.22.
- [Release notes](https:/ethereum/go-ethereum/releases)
- [Commits](ethereum/go-ethereum@v1.9.13...v1.10.22)

---
updated-dependencies:
- dependency-name: github.com/ethereum/go-ethereum
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump golang.org/x/text from 0.3.7 to 0.3.8 in /lib/go/test (#121)

Bumps [golang.org/x/text](https:/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https:/golang/text/releases)
- [Commits](golang/text@v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump golang.org/x/net in /lib/go/test (#122)

Bumps [golang.org/x/net](https:/golang/net) from 0.0.0-20220812174116-3211cb980234 to 0.7.0.
- [Release notes](https:/golang/net/releases)
- [Commits](https:/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump golang.org/x/text from 0.3.3 to 0.3.8 in /lib/go/templates (#120)

* Bump golang.org/x/text from 0.3.3 to 0.3.8 in /lib/go/templates

Bumps [golang.org/x/text](https:/golang/text) from 0.3.3 to 0.3.8.
- [Release notes](https:/golang/text/releases)
- [Commits](golang/text@v0.3.3...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* tidy

* update gomod

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Hannan <[email protected]>

* Bump golang.org/x/crypto from 0.0.0-20210220033148-5ea612d1eb83 to 0.1.0 in /lib/go/templates (#124)

* Bump golang.org/x/crypto in /lib/go/templates

Bumps [golang.org/x/crypto](https:/golang/crypto) from 0.0.0-20210220033148-5ea612d1eb83 to 0.1.0.
- [Release notes](https:/golang/crypto/releases)
- [Commits](https:/golang/crypto/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* go mod tidy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Hannan <[email protected]>

* update to latest v2 standard

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Bastian Müller <[email protected]>
Co-authored-by: Álvaro Lillo Igualada <[email protected]>
Co-authored-by: Satyam Agrawal <[email protected]>
Co-authored-by: Peter Siemens <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Giovanni Sanchez <[email protected]>
@joshuahannan joshuahannan deleted the alilloig/switchboard-vault-wrapper branch February 7, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feedback Improvement SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problems with Switchboard
5 participants