feat(interact): implement simple interact - #17
Open
happyhappy-jun wants to merge 7 commits into
Open
Conversation
junha1
reviewed
Jul 9, 2022
| tokio = { version = "1.0", features = ["full"] } | ||
| futures = "0.3" | ||
| reqwest = "0.11" | ||
| reqwest = { version = "0.11", features = ["json"] } |
|
|
||
| let first_json = first_res.json::<Value>().await.unwrap(); | ||
|
|
||
| thread::sleep(time::Duration::from_secs(2)); |
Member
There was a problem hiding this comment.
async 함수에서는 https://docs.rs/tokio/latest/tokio/time/fn.sleep.html 를 씁시다.
| #[tokio::test] | ||
| #[ignore] | ||
| async fn check_account() { | ||
| let _config = Config::read_from_env(); |
| #[tokio::test] | ||
| #[ignore] | ||
| async fn check_connection() { | ||
| let _config = Config::read_from_env(); |
Member
There was a problem hiding this comment.
변수명 앞에 _를 붙이는건 이 변수가 당장 안쓰인다는 것을 인지하고 있다는걸 알려주는 특수 린팅 규칙입니다. 이제 사용하니까 떼면 돼요.
| #[tokio::test] | ||
| #[ignore] | ||
| async fn check_block_number() { | ||
| let _config = Config::read_from_env(); |
| .unwrap(); | ||
|
|
||
| let json = res.json::<Value>().await.unwrap(); | ||
| assert_eq!(json["error"], Value::Null); |
Member
There was a problem hiding this comment.
has enough native token to pay gas fee 에 대한 테스트 내용이 없는 것 같네요.
happyhappy-jun
force-pushed
the
feat-implement-simple-interact
branch
from
July 9, 2022 17:35
ad68263 to
3497363
Compare
Contributor
Author
|
CI config 전달에 대해 좋은 아이디어 받습니다
현재의 목적이 각 테스트마다 다른 환경변수를 넣어준다거나 그런것이 목적이라면, 1,2,3 영 아닌거 같은데 좋은 의견 있으신가요 |
Member
|
@happyhappy-jun 그냥 CI에서 사용할 env파일을 지금처럼 repo 어딘가에 두고 그대로 쓰는게 제일 간단할 것 같습니다. 만약에 컨트랙트를 테스트넷에 재배포한다거나 하면 주소가 바뀔테니 적절히 업데이트 해주고요. |
happyhappy-jun
force-pushed
the
feat-implement-simple-interact
branch
from
July 17, 2022 01:19
7daaa74 to
fa4e428
Compare
happyhappy-jun
force-pushed
the
feat-implement-simple-interact
branch
from
July 20, 2022 13:54
cc42fca to
fab612f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of this PR
Describe your changes
reqwest를 사용해 json rpc 형태로 리퀘스트를 노드로 날립니다.serde_json으로 파싱합니다.Issue ticket number and other helpful resource
#1
Checklist before requesting a review
Checklist after creating a pull request