Adjust support fo US English as per substrate (#811)
* Rename ExtinsicStatus Finalised -> Finalized * Finalised heads -> Finalized
This commit is contained in:
@@ -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 } }) => {
|
||||
|
||||
@@ -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}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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 } }) => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user