onflow / flips

Flow Improvement Proposals
24 stars 22 forks source link

update flip to split out parameter pragma from nested structure #236

Open bthaile opened 6 months ago

bthaile commented 6 months ago

update flip to split out parameter pragma from nested structure

Nested pragma structure can be parsed but not executed at runtime. To get around this issue the parameters get their own pragmas.

New way:

#interaction(
    version: "1.1.0",
    title: "Transfer Flow",
    description: "Transfer Flow to account",
    language: "en-US",  
)

#interaction-param-amount(
        title: "Amount", 
        description: "Amount of Flow to transfer",
    language: "en-US",
)   

#interaction-param-to(
    title: "Reciever", 
    description: "Destination address to receive Flow Tokens",
    language: "en-US",
)

Old way:

#interaction(
    version: "1.1.0",
    title: "Transfer Flow",
    description: "Transfer Flow to account",
    language: "en-US",
    parameters: [
        Parameter(
            name: "amount", 
            title: "Amount", 
            description: "Amount of Flow to transfer"
        ),
        Parameter(
            name: "to", 
            title: "Reciever", 
            description: "Destination address to receive Flow Tokens"
        )
    ],
)
bthaile commented 6 months ago

Putting PR in draft, pragmas are being update to allow for nested structures.