TreasuryProposal (#825)

This commit is contained in:
Jaco Greeff
2019-04-05 23:32:38 +02:00
committed by GitHub
parent b271bdb464
commit 33924367bc
9 changed files with 63 additions and 5 deletions
@@ -2708,7 +2708,7 @@
"type": {
"MapType": {
"key": "ProposalIndex",
"value": "Proposal"
"value": "TreasuryProposal"
}
},
"default": "0x00",
@@ -2461,7 +2461,7 @@
"type": {
"MapType": {
"key": "ProposalIndex",
"value": "Proposal"
"value": "TreasuryProposal"
}
},
"fallback": "0x00",
@@ -2573,7 +2573,7 @@
"type": {
"MapType": {
"key": "ProposalIndex",
"value": "Proposal",
"value": "TreasuryProposal",
"isLinked": false
}
},
@@ -2632,7 +2632,7 @@
"type": {
"MapType": {
"key": "ProposalIndex",
"value": "Proposal",
"value": "TreasuryProposal",
"isLinked": false
}
},
+2
View File
@@ -37,6 +37,8 @@ export default class Type extends Text {
const mappings: Array<Mapper> = [
// alias <T::InherentOfflineReport as InherentOfflineReport>::Inherent -> InherentOfflineReport
Type._alias('<T::InherentOfflineReport as InherentOfflineReport>::Inherent', 'InherentOfflineReport'),
// alias TreasuryProposal from Proposal<T::AccountId, BalanceOf<T>>
Type._alias('Proposal<T::AccountId, BalanceOf<T>>', 'TreasuryProposal'),
// <T::Balance as HasCompact>
Type._cleanupCompact(),
// Remove all the trait prefixes
@@ -0,0 +1,51 @@
// Copyright 2017-2019 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import Struct from '../codec/Struct';
import AccountId from './AccountId';
import Balance from './Balance';
/**
* @name TreasuryProposal
* @description
* A Proposal made for Treasury
*/
export default class TreasuryProposal extends Struct {
constructor (value: any) {
super({
proposer: AccountId,
value: Balance,
beneficiary: AccountId,
bond: Balance
}, value);
}
/**
* @description The beneficiary
*/
get beneficiary (): AccountId {
return this.get('beneficiary') as AccountId;
}
/**
* @description The bond
*/
get bond (): Balance {
return this.get('bond') as Balance;
}
/**
* @description The proposer
*/
get proposer (): AccountId {
return this.get('proposer') as AccountId;
}
/**
* @description The bond
*/
get value (): Balance {
return this.get('value') as Balance;
}
}
+1
View File
@@ -64,6 +64,7 @@ export { default as SessionKey } from './SessionKey';
export { default as Signature, Ed25519Signature, Sr25519Signature } from './Signature';
export { default as StakingLedger } from './StakingLedger';
export { default as StoredPendingChange } from './StoredPendingChange';
export { default as TreasuryProposal } from './TreasuryProposal';
export { default as UnlockChunk } from './UnlockChunk';
export { default as ValidatorPrefs } from './ValidatorPrefs';
export { default as VestingSchedule } from './VestingSchedule';