shank account

This commit is contained in:
Hardhat Chad
2024-02-17 17:00:06 +00:00
parent 82fdaaba62
commit adc8292fb5
4 changed files with 88 additions and 3 deletions

View File

@@ -497,6 +497,88 @@
}
}
],
"accounts": [
{
"name": "Bus",
"type": {
"kind": "struct",
"fields": [
{
"name": "id",
"type": "u64"
},
{
"name": "rewards",
"type": "u64"
}
]
}
},
{
"name": "Proof",
"type": {
"kind": "struct",
"fields": [
{
"name": "authority",
"type": "publicKey"
},
{
"name": "claimableRewards",
"type": "u64"
},
{
"name": "hash",
"type": {
"defined": "Hash"
}
},
{
"name": "totalHashes",
"type": "u64"
},
{
"name": "totalRewards",
"type": "u64"
}
]
}
},
{
"name": "Treasury",
"type": {
"kind": "struct",
"fields": [
{
"name": "admin",
"type": "publicKey"
},
{
"name": "bump",
"type": "u64"
},
{
"name": "difficulty",
"type": {
"defined": "Hash"
}
},
{
"name": "epochStartAt",
"type": "i64"
},
{
"name": "rewardRate",
"type": "u64"
},
{
"name": "totalClaimedRewards",
"type": "u64"
}
]
}
}
],
"errors": [
{
"code": 0,

View File

@@ -1,4 +1,5 @@
use bytemuck::{Pod, Zeroable};
use shank::ShankAccount;
use crate::{
impl_account_from_bytes, impl_to_bytes,
@@ -6,7 +7,7 @@ use crate::{
};
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, ShankAccount, Zeroable)]
pub struct Bus {
/// The ID of the bus account.
pub id: u64,

View File

@@ -1,4 +1,5 @@
use bytemuck::{Pod, Zeroable};
use shank::ShankAccount;
use solana_program::pubkey::Pubkey;
use crate::{
@@ -8,7 +9,7 @@ use crate::{
};
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, ShankAccount, Zeroable)]
pub struct Proof {
/// The account (i.e. miner) authorized to use this proof.
pub authority: Pubkey,

View File

@@ -1,4 +1,5 @@
use bytemuck::{Pod, Zeroable};
use shank::ShankAccount;
use solana_program::pubkey::Pubkey;
use crate::{
@@ -8,7 +9,7 @@ use crate::{
};
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, ShankAccount, Zeroable)]
pub struct Treasury {
/// The admin authority with permission to update the difficulty.
pub admin: Pubkey,