ChorusOne / solido

Lido for Solana is a Lido-DAO governed liquid staking protocol for the Solana blockchain.
https://chorusone.github.io/solido/
GNU General Public License v3.0
101 stars 43 forks source link

Why are the structs different in the rust program vs js package? #575

Open deloused opened 2 years ago

deloused commented 2 years ago

Eg:

JS

  [
    RewardDistribution,
    {
      kind: 'struct',
      fields: [
        ['treasury_fee', 'u32'],
        ['validation_fee', 'u32'],
        ['developer_fee', 'u32'],
        ['st_sol_appreciation', 'u32'],
      ],
    },
  ],

rust

pub struct RewardDistribution {
    pub treasury_fee: u32,
    pub developer_fee: u32,
    pub st_sol_appreciation: u32,
}
kkonevets commented 2 years ago

Because we have not upgraded JS lib yet. We are in the process of translation to Solido version 2.

deloused commented 2 years ago

ok cheers. is the rust version the solido version 2?

kkonevets commented 2 years ago

No. Rust version and Solido version are two different things

On Sun, Jul 17, 2022, 22:30 deloused @.***> wrote:

ok cheers. is the rust version the solido version 2?

— Reply to this email directly, view it on GitHub https://github.com/ChorusOne/solido/issues/575#issuecomment-1186594139, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAJXXHXXYYGA3UKVCXEUKLVURNOZANCNFSM53Z5VUGQ . You are receiving this because you commented.Message ID: @.***>

ruuda commented 2 years ago

@deloused you want to look at the Rust code for the currently deployed version, not at the main branch: https://github.com/ChorusOne/solido/blob/v1.0.0/program/src/state.rs#L188