Adjust support fo US English as per substrate (#811)

* Rename ExtinsicStatus Finalised -> Finalized

* Finalised heads -> Finalized
This commit is contained in:
Jaco Greeff
2019-03-29 14:12:56 +01:00
committed by GitHub
parent 2528ac4bd5
commit 6fef86cc78
26 changed files with 193 additions and 111 deletions
@@ -36,11 +36,11 @@ async function main () {
api.tx.balances
.transfer(recipient, AMOUNT)
.sign(alicePair, { nonce })
.send(({ events = [], status, type }) => {
console.log('Transaction status:', type);
.send(({ events = [], status }) => {
console.log('Transaction status:', status.type);
if (type === 'Finalised') {
console.log('Completed at block hash', status.asFinalised.toHex());
if (status.isFinalized) {
console.log('Completed at block hash', status.asFinalized.toHex());
console.log('Events:');
events.forEach(({ phase, event: { data, method, section } }) => {
@@ -32,13 +32,13 @@ async function main () {
// preform the actual chain upgrade via the sudo module
api.tx.sudo
.sudo(proposal)
.signAndSend(adminPair, ({ events = [], status, type }) => {
console.log('Proposal status:', type);
.signAndSend(adminPair, ({ events = [], status }) => {
console.log('Proposal status:', status.type);
if (type === 'Finalised') {
if (status.isFinalized) {
console.error('You have just upgraded your chain');
console.log('Completed at block hash', status.asFinalised.toHex());
console.log('Completed at block hash', status.asFinalized.toHex());
console.log('Events:');
events.forEach(({ phase, event: { data, method, section } }) => {
+4 -4
View File
@@ -21,11 +21,11 @@ async function main () {
// Sign and send the transcation
.signAndSend(alice)
// Subscribe to the status updates of the transfer
.subscribe(({ status, type }) => {
if (type === 'Finalised') {
console.log(`Successful transfer of 12345 from Alice to Bob with hash ${status.asFinalised.toHex()}`);
.subscribe(({ status }) => {
if (status.isFinalized) {
console.log(`Successful transfer of 12345 from Alice to Bob with hash ${status.asFinalized.toHex()}`);
} else {
console.log(`Staus of transfer: ${type}`);
console.log(`Staus of transfer: ${status.type}`);
}
});
}
+5 -4
View File
@@ -36,12 +36,13 @@ async function main () {
// Sign and send it
.signAndSend(alicePair)
// And subscribe to the actual status
.subscribe(({ events = [], status, type }) => {
.subscribe(({ events = [], status }) => {
// Log transfer events
console.log('Transfer status:', type);
console.log('Transfer status:', status.type);
// Log system events once the transfer is finalised
if (type === 'Finalised') {
console.log('Completed at block hash', status.asFinalised.toHex());
if (status.isFinalized) {
console.log('Completed at block hash', status.asFinalized.toHex());
console.log('Events:');
events.forEach(({ phase, event: { data, method, section } }) => {
+4 -4
View File
@@ -32,14 +32,14 @@ async function main () {
// sign and send the proposal
.signAndSend(adminPair)
// subscribe to overall result
.subscribe(({ events = [], status, type }) => {
.subscribe(({ events = [], status }) => {
// Log transfer events
console.log('Proposal status:', type);
console.log('Proposal status:', status.type);
if (type === 'Finalised') {
if (status.isFinalized) {
console.error('You have just upgraded your chain');
console.log('Completed at block hash', status.asFinalised.toHex());
console.log('Completed at block hash', status.asFinalized.toHex());
console.log('Events:');
// Log system events once the chain update is finalised