gagliardetto / anchor-go

Generate Go clients from anchor IDLs for Solana blockchain programs
MIT License
138 stars 31 forks source link

feat: add FetchIDL method to fetch idl json data #8

Open gtsigner opened 2 years ago

gtsigner commented 2 years ago

Add a method program.FetchIDL same as here https://github.com/project-serum/anchor/blob/master/ts/src/program/index.ts

gagliardetto commented 2 years ago

hey @godtoy

being able to fetch IDLs from the chain is a very useful thing to have! :smile:

from a first look, it looks good to me.

but can you please use the standard go formatter?

gtsigner commented 2 years ago

Do u mean the code formatter ? should i exec go fmt ... first right?

gtsigner commented 2 years ago

Hey i just finished go fmt ... submit

gagliardetto commented 2 years ago

The tests fail because the IDL has been updated :face_in_clouds:

gagliardetto commented 2 years ago

How about changing the test to something like this:

gtsigner commented 2 years ago

Yep, u are right. Because magiceden contract has been updated 2 days ago.