feat: getInflation() RPC (needs better documentation pending book terms) (#473)
* feat: getInflation() RPC (needs better documentation pending book terms) * feat: add test
This commit is contained in:
committed by
Michael Vines
parent
5b47eb2efc
commit
0379615c76
@ -128,6 +128,36 @@ test('get balance', async () => {
|
||||
expect(balance).toBeGreaterThanOrEqual(0);
|
||||
});
|
||||
|
||||
test('get inflation', async () => {
|
||||
const connection = new Connection(url);
|
||||
|
||||
mockRpc.push([
|
||||
url,
|
||||
{
|
||||
method: 'getInflation',
|
||||
params: [],
|
||||
},
|
||||
{
|
||||
error: null,
|
||||
result: {
|
||||
foundation: 0.05,
|
||||
foundation_term: 7.0,
|
||||
grant: 0.05,
|
||||
grant_term: 7.0,
|
||||
initial: 0.15,
|
||||
storage: 0.1,
|
||||
taper: 0.15,
|
||||
terminal: 0.015,
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const inflation = await connection.getInflation();
|
||||
expect(inflation.initial).toBeGreaterThan(0);
|
||||
expect(inflation.storage).toBeGreaterThan(0);
|
||||
expect(inflation.terminal).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('get slot', async () => {
|
||||
const connection = new Connection(url);
|
||||
|
||||
|
Reference in New Issue
Block a user